Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException(org.h2.Driver not found by KernelBundleClassLoader )
greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #756276] Fri, 11 November 2011 18:42 Go to next message
Richard J. Schiller is currently offline Richard J. SchillerFriend
Messages: 3
Registered: April 2011
Location: New York
Junior Member

I wondered if anybody can help me get greenpages 2.5.0 sample app running in eclipse-rt virgo 3.1.0?

I built the greenpages sample, as I have in the past for an earlier version of SpringSourceDM Server 2.0; and when I deploy it to the $SERVER_HOME/pickup directory the virgo server 3.1.0 can not find the class: org.h2.Driver. Note org.h2.Driver class can not be loaded even after numerous attempts at making the template.mf, MANIFEST.MF and pom.xml adjustments as suggested on other blog posts ... I even updated the h2 to 1.3.161 to see if that may have been the cause of the inability for the KernelBundleClassLoader to find the class. What lookes wrong with my configuration or is ther an issue with the KernelBundleClassLoader that I'm missing?

-----------------------------------------------------------------------------
---- CONSOLE OUTPUT ----
-----------------------------------------------------------------------------
[2011-11-11 13:04:03.000] start-signalling-2 <DE0006E> Start failed for bundle 'greenpages-2.5.0.RELEASE-greenpages.db' version '2.5.0'. org.springframework.beans.factory.BeanCreationException: Error creating bean with n
ame 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSo
urce' defined in URL [bundleentry://129.fwk239625678/META-INF/spring/module-context.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.h2.Driv
er'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
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:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [bundleentry://129.fwk239625678/META-INF/spring/module-context.xml]: Invocation of init method failed; n
ested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.h2.Driver'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean.afterPropertiesSet(OsgiServiceFactoryBean.java:167)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 17 common frames omitted
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.h2.Driver'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 26 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.h2.Driver in KernelBundleClassLoader: [bundle=greenpages-2.5.0.RELEASE-synthetic.context_2.5.0.RELEASE]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1138)
... 33 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
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)
... 35 common frames omitted

see attached file for :
- greenpages.db/template.mf
- greenpages.db/src/main/resources/META-INF/MANIFEST.MF
- greenpages.db/src/main/resources/META-INF/spring/module-context.xml
- greenpages.db/src/main/resources/META-INF/spring/osgi-context.xml
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #756571 is a reply to message #756276] Mon, 14 November 2011 11:36 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Did you mean Greenpages 2.4.0, which is the latest release? Or are you building Greenpages 2.5.0 from the git repo?

Assuming you mean 2.4.0, have you followed the installation instructions in the documentation? There's more to it than simply dropping the PAR into pickup - for example, you need to put the dependencies in repository/usr and start the database.
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #756604 is a reply to message #756571] Mon, 14 November 2011 13:52 Go to previous messageGo to next message
Richard J. Schiller is currently offline Richard J. SchillerFriend
Messages: 3
Registered: April 2011
Location: New York
Junior Member

Thanks for your response and help!

I rebuilt the sample application from the GIT hub and deployed (version 2.5.0) with h2 (version 1.3.161). I already am running with prior virgo 2.10 in a production environment on the amazon EC2 cloud under ubuntu natty linux. This has been running just fine for a long time already and on many machines. I and the rest of my development team have deployed many real time OSGI services under SpringSourceDM and now Virgo but wish to make sure we can build and deploy to the latest virgo 3.1.0 release. In summary, I previously built and deployed these prior versions of the sample greenpages app successfully, but I'm stummped on whatever is causing the kernel class loader to fail to find the org.h2.Driver class. I am familiar with the installation instructions link you provided in the prior message on this thread and feel all those steps were followed. I included what I think were the important configuration files in the top posting. Is there something I missed?
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #756618 is a reply to message #756604] Mon, 14 November 2011 14:22 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
You could divide the problem by trying to install Greenpages 2.5.0 as per the documentation. If that fails, you should raise a bug which we can then look into. If it succeeds, you can play spot the difference. For another line of diagnostic attack, see this FAQ.
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #779967 is a reply to message #756618] Mon, 16 January 2012 22:56 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1340
Registered: July 2009
Senior Member
We're seeing the same thing. I've raised bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=368781 and we'll see if we can get to the bottom of it.
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #780454 is a reply to message #779967] Wed, 18 January 2012 03:33 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1340
Registered: July 2009
Senior Member
Richard, can you give me a console from your manual setup -- i.e. the non-eclipse version that worked?
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #780633 is a reply to message #780454] Wed, 18 January 2012 20:18 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1340
Registered: July 2009
Senior Member
Richard, I don't need the console, but I'd appreciate your confirming two things:

1. Have you been able to get 3.1.0 running standalone with the greenpages? Or have you only used 3.1.0 in conjunction with Virgo?
2. Can you get things working by targetting Virgo Server 3.0.2. (The answer for me is yes, see bug for more info.)

thanks,

Miles
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #780866 is a reply to message #780633] Thu, 19 January 2012 18:11 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1340
Registered: July 2009
Senior Member
OK everyone.. Please see above referenced bug. There appear to be a number of potential issues with targeting the 3.1.0 from the tooling 3.1.0. So please use the 3.0.2 server for now. I'll put a note on the Virgo tooling wiki re: that.
Re: greenpages 2.5.0 on Virgo 3.1.0 org.h2.Driver ClassNotFoundException [message #797903 is a reply to message #780866] Tue, 14 February 2012 02:02 Go to previous message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1340
Registered: July 2009
Senior Member
Back on this now. We'd hoped that the support for 3.5.0 tooling would take care of this issue, but it doesn't seem to be the case. By the way, for 3.1.0 above read "3.5.0".
Previous Topic:Virgo Server Tooling on STS 2.9.0.M1 works!
Next Topic:Exporting bundle project uses incorrect MANIFEST.MF
Goto Forum:
  


Current Time: Fri Nov 28 16:10:00 GMT 2014

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

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