Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items"
war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items" [message #669265] Mon, 09 May 2011 15:58 Go to next message
Ryan  is currently offline Ryan Friend
Messages: 17
Registered: May 2011
Junior Member
I'm new to Virgo and fairly new to OSGi. I'm trying to deploy an existing WAR to Virgo, which the docs say is supported, but it fails with an error that seems to be saying someone is trying to import the same package twice. The relevant stacktrace is at the end of this message. The Assert$FatalAssertionException shown is the root cause of a org.springframework.beans.BeanInstantiationException when one of my Spring contexts is starting. You can see that a class is being loaded, which gets into the Virgo ClassLoader. The class in question is StaticLoggerBinder from slf4j. From there, I can only guess what's happening. I found this post from last year with exactly the same problem, but I'm not sure what to do with the reply:
http://www.eclipse.org/forums/index.php/m/588049/

It's suggested that there's an import statement in a manifest file that's causing this duplicate import. My WAR doesn't have a manifest file. Would the jars in WEB-INF/lib affect this? What would I look for? If two jars inside the war import the same package, will that cause this error? How can I possibly fix that?

   Caused by: 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:322) 
          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:44) 
          at org.eclipse.core.runtime.internal.adaptor.ClasspathManifest.getManifest(ClasspathManifest.java:49) 
          at org.eclipse.core.runtime.internal.adaptor.EclipseClassLoadingHook.processClass(EclipseClassLoadingHook.java:87) 
          at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:575) 
          at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550) 
          at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481) 
          at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:469) 
          at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449) 
          at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) 
          at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393) 
          at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469) 
          at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422) 
          at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410) 
          at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) 
          at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135) 
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248) 
          at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230) 
          at org.slf4j.LoggerFactory.bind(LoggerFactory.java:138) 
          at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:112) 
          at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:275) 
          at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248) 
...

[Updated on: Mon, 09 May 2011 16:08]

Report message to a moderator

Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&q [message #669783 is a reply to message #669265] Wed, 11 May 2011 14:12 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Hi,

can you provide us a simple application that we can use in order to reproduce the issue?

Thanks in advance.
Regards
Violeta
Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&a [message #671095 is a reply to message #669783] Mon, 16 May 2011 18:30 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 17
Registered: May 2011
Junior Member
I'll try to get something together, though it might take a while, and I imagine I'll discover the problem myself in the process of doing so. I had hoped my questions had simple answers since I've never touched Virgo, and it seems like this would be something frequently encountered.
Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&a [message #671127 is a reply to message #671095] Mon, 16 May 2011 20:04 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 17
Registered: May 2011
Junior Member
Now I'm only getting "org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at 'xxxxx' failed to start. Check the logs for more details." What logs is it talking about? I've looked through all the logs I can find, and that's all I see.
Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&a [message #673984 is a reply to message #671127] Wed, 25 May 2011 12:07 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 278
Registered: October 2010
Senior Member
Did you check the log files in the <Virgo-Home-Dir>/serviceability folder
Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&a [message #674121 is a reply to message #673984] Wed, 25 May 2011 21:34 Go to previous messageGo to next message
Ryan  is currently offline Ryan Friend
Messages: 17
Registered: May 2011
Junior Member
Yes, all of them. I'm moving on from this and trying some other approaches that don't entail deploying my current war file to Virgo.
Re: war works in Tomcat, fails in Virgo with "packageImports must not contain duplicate items&a [message #674382 is a reply to message #671127] Thu, 26 May 2011 17:26 Go to previous message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
I've had issues with the logs as well.

One thing to try might be to start your Virgo in debug & suspend mode and connect your debugger. Add a breakpoint watcher for any exception. I've had to do that a couple of times

./bin/startup.sh -debug <port> -suspend

Eclipse > Run > Debug Configurations > Remote Java Application

Add a new one to your server and debug port and connect.
Previous Topic:java.lang.VerifyError and Virgo
Next Topic:Virgo OSGI lifecycle with dependencies
Goto Forum:
  


Current Time: Sun Dec 08 16:28:10 GMT 2024

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

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

Back to the top