Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » sample spring mvc app not working in virgo(sample spring mvc app not working in virgo)
sample spring mvc app not working in virgo [message #777017] Mon, 09 January 2012 16:56 Go to next message
john smith is currently offline john smith
Messages: 4
Registered: January 2012
Junior Member
Hi Friends,

I have created sample web app using STS 2.8. No code change once the app is created. Only thing i changed is pom to use 3.0.5 version spring. Then deploy the war file to pickup directory and getting an exception

"
Start failed for bundle 'abc' version '0.0.0'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Web application failed to start
"

Looking back in to the log file , it is complaining about

"
[2012-01-09 11:49:25.453] ERROR Thread-35 o.a.catalina.core.ContainerBase.[Catalina].[localhost].[/abc] Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
"

Same app workig in tomcat 7.

File attachment is not allowing me to attach sample was generated, saying file is too big
Re: sample spring mvc app not working in virgo [message #777402 is a reply to message #777017] Tue, 10 January 2012 12:25 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Please could you paste the MANIFEST.MF and web.xml.
Re: sample spring mvc app not working in virgo [message #777473 is a reply to message #777402] Tue, 10 January 2012 15:13 Go to previous messageGo to next message
john smith is currently offline john smith
Messages: 4
Registered: January 2012
Junior Member
Thanks Glyn for your response.
As I said I smiply created a sample mvc app based on STS 2.8 and drop it in virgo server. Only thing I changed is version of the spring framework from 3.0.6 to 3.0.5 release.
I dont have manifest file in it. I was thinking plain vanila war file does not need OSGi specific menifest file. Here is the web.xml code snippet

<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>

<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Re: sample spring mvc app not working in virgo [message #777477 is a reply to message #777473] Tue, 10 January 2012 15:17 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I see. What JARs do you have in WEB-INF/lib?
Re: sample spring mvc app not working in virgo [message #777541 is a reply to message #777477] Tue, 10 January 2012 16:46 Go to previous messageGo to next message
john smith is currently offline john smith
Messages: 4
Registered: January 2012
Junior Member
here is the list of spring libs i have included in war file
spring-aop-3.0.5.RELEASE
spring-asm-3.0.5.RELEASE
spring-beans-3.0.5.RELEASE
spring-context-3.0.5.RELEASE
spring-context-support-3.0.5.RELEASE
spring-core-3.0.5.RELEASE
spring-expression-3.0.5.RELEASE
spring-web-3.0.5.RELEASE
spring-webmvc-3.0.5.RELEASE

there are some other log4j and sl4j libs too
Re: sample spring mvc app not working in virgo [message #818571 is a reply to message #777541] Sun, 11 March 2012 21:27 Go to previous messageGo to next message
Filipe Dias is currently offline Filipe Dias
Messages: 2
Registered: March 2012
Junior Member
Hy,
Did you find a solution for this? I'm having exactly the same problem with a standard WAR file ... I admit, it's a somewhat bigger WAR-application but nevertheless plain-vanilla....
I've seen a lot of posts in the forum having simillar problems.. but no solution so far..

I will dive deeper into this later, but I share my dump... Very Happy


Exception..
Mar 11, 2012 9:49:13 PM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener 
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener 
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306) 
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415) 
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397) 
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118) 
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660) 
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) 
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) 
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
	at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
	at java.lang.Thread.run(Thread.java:680) 
Mar 11, 2012 9:49:13 PM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener 
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 
	at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306) 
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415) 
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397) 
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118) 
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660) 
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) 
	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) 
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
	at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
	at java.lang.Thread.run(Thread.java:680) 


META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_29-b11 (Sun Microsystems Inc.)


WEB-INF/web.xml
....
<listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
....


WEB-INF/lib/
activemq-core-5.5.0.jar
activemq-pool-5.5.0.jar
aopalliance-1.0.jar
bcmail-jdk16-1.45.jar
bcprov-jdk16-1.45.jar
bctsp-jdk16-1.45.jar
bsh-2.0b4.jar
cglib-full-2.0.2.jar
commons-beanutils-1.7.0.jar
commons-codec-1.4.jar
commons-collections-3.2.1.jar
commons-compress-1.0.jar
commons-dbcp-1.4.jar
commons-digester-1.6.jar
commons-fileupload-1.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-net-2.1.jar
commons-pool-1.5.4.jar
commons-primitives-1.0.jar
commons-validator-1.3.1.jar
commons-vfs-1.0.jar
connector-1.5.jar
dom4j-1.6.1.jar
dsn-1.4.1.jar
ehcache-core-2.0.0.jar
ehcache-terracotta-2.0.0.jar
ehcache-web-2.0.0.jar
fontbox-1.4.0.jar
freemarker-2.3.16.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-stax-api_1.0_spec-1.0.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
itext-2.1.7.jar
jai_codec-1.1.3.jar
jai_core-1.1.3.jar
javax.jms-1.1.jar
jcifs-1.3.14-kohsuke-1.jar
jcl-over-slf4j-1.6.1.jar
jcommon-1.0.12.jar
jdom-1.1.jar
jempbox-1.4.0.jar
jfreechart-1.0.9.jar
joda-time-1.6.2.jar
jsch-0.1.42.jar
jstl-1.1.2.jar
junit-4.6.jar
log4j-1.2.16.jar
lucene-analyzers-3.0.2.jar
lucene-core-3.0.2.jar
lucene-highlighter-3.0.2.jar
lucene-memory-3.0.2.jar
lucene-snowball-3.0.2.jar
mail-1.4.1.jar
mlibwrapper_jai-1.1.3.jar
mvel2-2.0.16.jar
odmg-3.0.jar
oro-2.0.8.jar
pdfbox-1.4.0.jar
poi-3.7.jar
poi-ooxml-3.7.jar
poi-ooxml-schemas-3.7.jar
poi-scratchpad-3.7.jar
postgresql-9.0-801.jdbc4.jar
rtf-parser-1.0.jar
sarasvati-1.0.0-rc3.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
spring-aop-3.0.5.RELEASE.jar
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
spring-jdbc-3.0.5.RELEASE.jar
spring-jms-3.0.5.RELEASE.jar
spring-tx-3.0.5.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
standard-1.1.2.jar
stax-api-1.0.1.jar
stax2-2.1.jar
tagishauth-1.0.3.jar
tidy-r938.jar
tnef-1.5.0.jar
waffle-jna-1.3.jar
webservices-api-2.0.jar
webservices-extra-2.0.jar
webservices-extra-api-2.0.jar
webservices-rt-2.0.jar
webservices-tools-2.0.jar
XAMLibrary-1.0.p2.jar
xml-apis-1.0.b2.jar
xmlbeans-2.3.0.jar
Re: sample spring mvc app not working in virgo [message #820158 is a reply to message #818571] Tue, 13 March 2012 20:04 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Can you try to modify the org.eclipse.virgo.web.properties properties file located in the $SERVER_HOME/repository/ext directory. Change the WABHeaders property to have a value of defaulted. Then redeploy the application.
Re: sample spring mvc app not working in virgo [message #820229 is a reply to message #820158] Tue, 13 March 2012 21:59 Go to previous messageGo to next message
Filipe Dias is currently offline Filipe Dias
Messages: 2
Registered: March 2012
Junior Member
Thanks, must have forgotten to switch that thing on.. But that got me up and running to the next exception.. Rolling Eyes

Now during loading of the following class org.apache.commons.logging.impl.SLF4JLogFactory (I guess):
.... 
[2012-03-13 22:14:26.988] DEBUG Thread-37                    org.eclipse.virgo.kernel.serviceability.Assert                    < public static transient void org.eclipse.virgo.kernel.serviceability.Assert.isNull(java.lang.Object, java.lang.String, java.lang.Object[])
[2012-03-13 22:14:27.005] DEBUG Thread-37                    o.a.c.c.C.[Catalina].[localhost].[/com.irisnext-7.3.44]           Sending application start events
[2012-03-13 22:14:27.008] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.support.EquinoxBundleFileResolver  Resolved bundle 'com.irisnext-7.3.44' to file '/Users/dias/Software/virgo-tomcat-server-3.0.2.RELEASE/work/org.eclipse.virgo.kernel.deployer_3.0.2.RELEASE/staging/global/bundle/com.irisnext-7.3.44/0.0.0/com.irisnext-7.3.44.war'
[2012-03-13 22:14:27.008] INFO  Thread-37                    o.a.c.c.C.[Catalina].[localhost].[/com.irisnext-7.3.44]           Set web app root system property: 'webapp.root' = [/Users/dias/Software/virgo-tomcat-server-3.0.2.RELEASE/work/org.eclipse.virgo.kernel.deployer_3.0.2.RELEASE/staging/global/bundle/com.irisnext-7.3.44/0.0.0/com.irisnext-7.3.44.war/]
[2012-03-13 22:14:27.012] DEBUG Thread-37                    org.eclipse.virgo.kernel.serviceability.Assert                    > public static transient void org.eclipse.virgo.kernel.serviceability.Assert.notNull(java.lang.Object, java.lang.String, java.lang.Object[])
[2012-03-13 22:14:27.012] DEBUG Thread-37                    org.eclipse.virgo.kernel.serviceability.Assert                    < public static transient void org.eclipse.virgo.kernel.serviceability.Assert.notNull(java.lang.Object, java.lang.String, java.lang.Object[])
[2012-03-13 22:14:27.019] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader    getResources(commons-logging.properties)
[2012-03-13 22:14:27.030] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader    getResource(META-INF/services/org.apache.commons.logging.LogFactory)
[2012-03-13 22:14:27.038] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader    loadClass(org.apache.commons.logging.impl.SLF4JLogFactory, false)
[2012-03-13 22:14:27.038] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader      Searching the application's bundle
[2012-03-13 22:14:27.039] DEBUG Thread-37                    o.e.gemini.web.tomcat.internal.loading.BundleWebappClassLoader      Loading class from the delegating classloader
[2012-03-13 22:14:27.046] DEBUG Thread-37                    org.eclipse.virgo.kernel.serviceability.Assert                    > public static transient void org.eclipse.virgo.kernel.serviceability.Assert.notNull(java.lang.Object, java.lang.String, java.lang.Object[])



That goes on for a while... and 36 milliseconds later...

[2012-03-13 22:14:27.082] DEBUG Thread-37                    org.eclipse.virgo.kernel.serviceability.Assert                    < public static transient void org.eclipse.virgo.kernel.serviceability.Assert.isNull(java.lang.Object, java.lang.String, java.lang.Object[]) 
org.eclipse.virgo.kernel.serviceability.Assert$FatalAssertionException: input packageImports must not contain duplicate items
        at org.eclipse.virgo.kernel.serviceability.Assert.isNull(Assert.java:103)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.AbstractTrackedPackageImports.convertImportedPackageListToMap(AbstractTrackedPackageImports.java:323)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.BundleTrackedPackageImports.getInitialImportedPackages(BundleTrackedPackageImports.java:58)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.BundleTrackedPackageImports.<init>(BundleTrackedPackageImports.java:43)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.StandardTrackedPackageImportsFactory.create(StandardTrackedPackageImportsFactory.java:37)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.mergeImports(ImportExpansionHandler.java:160)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.mergePromotedImports(ImportExpansionHandler.java:151)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.mergePromotedImports(ImportExpansionHandler.java:144)
        at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.expandImports(ImportExpansionHandler.java:121)
        at org.eclipse.virgo.kernel.userregion.internal.equinox.TransformedManifestProvidingBundleFileWrapper$TransformedManifestProvidingBundleFile.getEntry(TransformedManifestProvidingBundleFileWrapper.java:160)
        at org.eclipse.osgi.baseadaptor.bundlefile.BundleFileWrapperChain.getEntry(BundleFileWrapperChain.java:43)
        at org.eclipse.core.runtime.internal.adaptor.ClasspathManifest.getManifest(ClasspathManifest.java:49)
        at org.eclipse.core.runtime.internal.adaptor.EclipseClassLoadingHook.processClass(EclipseClassLoadingHook.java:88)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:596)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:567)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:490)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:478)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:458)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
        at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
        at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
        at org.springframework.util.PropertyPlaceholderHelper.<clinit>(PropertyPlaceholderHelper.java:40)
        at org.springframework.util.SystemPropertyUtils.<clinit>(SystemPropertyUtils.java:49)
        at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:129)
        at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)


input packageImports must not contain duplicate items

I checked the virgo code and unfortunately there seems to be no option to deactivate these assertions... So one of my dependencies is having an erroneous manifest file...
Guess I will have to go throught the slf4j dependencies where it stucks. Maybe I could simply strip OSGI headers from their manifest?

[Updated on: Tue, 13 March 2012 22:01]

Report message to a moderator

Re: sample spring mvc app not working in virgo [message #902110 is a reply to message #820229] Wed, 15 August 2012 21:52 Go to previous message
Alex Antonov is currently offline Alex Antonov
Messages: 1
Registered: August 2012
Junior Member
It actually seems like there is a bug in the AbstractTrackedPackageImports.java:convertImportedPackageListToMap() method.

protected static Map<String, ImportedPackage> convertImportedPackageListToMap(List<ImportedPackage> importedPackages) {
        Map<String, ImportedPackage> initialPackageImports = new HashMap<String, ImportedPackage>();
        for (ImportedPackage importedPackage : importedPackages) {
            Assert.isNull(initialPackageImports.put(importedPackage.getPackageName(), importedPackage),
                "input packageImports must not contain duplicate items");
        }

        return initialPackageImports;
    }


The way it is coded above, the exception will always be thown if the importedPackages list argument is not empty.
Since the initialPackageImports variable is being initialized to an empty HashMap, the subsequent 'put' operation will always return 'null' upon insertion because the map is empty and there is no previous key!
It seems like the check should be the other way around, if we indeed check for duplicates. If the returned value from 'put' is "NOT NULL", then we know there was already a package under that name imported.
Previous Topic:Virgo Snaps Sample 3.5 not complete
Next Topic:cxf_dosgi running under virgo
Goto Forum:
  


Current Time: Tue Sep 23 14:31:28 GMT 2014

Powered by FUDForum. Page generated in 0.04905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software