Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » war to wab(why some classes are not awailable?)
war to wab [message #999551] Sat, 12 January 2013 12:31 Go to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

Hi,

I tried to convert my application to an osgi wab. I added OSGI bundle support, created MANIFEST.MF and tried to deploy a application into the virgo. Imediatelly I received ClassNotFound exceptions, so I checked my maven configuration and in WEB-INF/lib were all necesarry libraries, which were sufficient before theconversion. So after sometime I accidently found out that I have to add jars with import packages. But there were just some of the packages that my application needs.
From where is this context built? If I havejars included in the libdirectory, that does not count? Must classes be available through OSGI bundles? What is with versions that I can not get - like my application uses hibernate 3.6, but hibernate 3.4GA is the highest version accesible through bundles.
Thanks for all the help.
Re: war to wab [message #999660 is a reply to message #999551] Sat, 12 January 2013 20:06 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Can you post here the Bundle-Classpath that you specified in the MANIFEST.MF file?
Re: war to wab [message #1000058 is a reply to message #999660] Sun, 13 January 2013 22:51 Go to previous messageGo to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

Here is my MANIFEST.MF from my test configuration.
Manifest-Version: 1.0
Bundle-ClassPath: WEB-INF/classes,
 hibernate-core-3.6.5.Final.jar,
 .
Bundle-Version: 1.0.0
Tool: Bundlor 1.1.1.RELEASE
Bundle-Name: Objectverse Fusion Core
Import-Library: org.springframework.spring;version="[3.0, 3.5)"
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.objectverse
Web-ContextPath: objectverse
Import-Package: 
 javax.servlet;version="[3.0.0,3.1.0)",
 javax.servlet.jsp.jstl.core;version="[1.2.0,2.0.0)",
 org.eclipse.virgo.snaps.core;version="[3.6.0.RELEASE,3.6.0.RELEASE]",
 org.eclipse.virgo.web.dm;version="[3.0.0,4.0.0)"


And an exception from Virgo logs:

[2013-01-13 23:45:38.552] ERROR start-signalling-1           org.apache.catalina.core.ContainerBase                            ContainerBase.addChild: start:  org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/objectverse]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
	at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
	at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:109)
	at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
	at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:271)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:319)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:316)
	at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:252)
	at org.eclipse.virgo.nano.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:140)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/FlushMode;
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
	at java.lang.Class.getDeclaredFields(Class.java:1760)
	at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:87)
	at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
	at org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:110)
	at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)
	at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 14 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.hibernate.FlushMode in KernelBundleClassLoader: [bundle=org.springframework.orm_3.1.0.RELEASE]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:139)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 28 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.hibernate.FlushMode
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135)
	... 29 common frames omitted


I tried several Classpath configurations without success. I'd like that all the classes in my WEB-INF/lib folder are accessible to my application as they are if I run this in Tomcat.

Re: war to wab [message #1000075 is a reply to message #999660] Mon, 14 January 2013 00:10 Go to previous messageGo to next message
Bojan Kraut is currently offline Bojan Kraut
Messages: 22
Registered: July 2009
Location: Maribor
Junior Member

Here it is:
Manifest-Version: 1.0
Bundle-ClassPath: WEB-INF/classes,
 hibernate-core-3.6.5.Final.jar,
 .
Bundle-Version: 1.0.0
Tool: Bundlor 1.1.1.RELEASE
Bundle-Name: Objectverse Fusion Core
Import-Library: org.springframework.spring;version="[3.0, 3.5)"
Bundle-ManifestVersion: 2
Bundle-SymbolicName: com.objectverse
Web-ContextPath: objectverse
Import-Package: 
 javax.servlet;version="[3.0.0,3.1.0)",
 javax.servlet.jsp.jstl.core;version="[1.2.0,2.0.0)",
 org.eclipse.virgo.snaps.core;version="[3.6.0.RELEASE,3.6.0.RELEASE]",
 org.eclipse.virgo.web.dm;version="[3.0.0,4.0.0)"
Re: war to wab [message #1000173 is a reply to message #1000075] Mon, 14 January 2013 07:24 Go to previous message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Where is the 'hibernate-core-3.6.5.Final.jar' located?
If it is in the WEB-INF/lib then you should describe it like this:

Bundle-ClassPath: WEB-INF/classes,
 WEB-INF/lib/hibernate-core-3.6.5.Final.jar,
 .
Previous Topic:Tomcat 7.0.32 springsource availability
Next Topic:"bundleContext property is required"?
Goto Forum:
  


Current Time: Sat Sep 20 08:02:21 GMT 2014

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

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