Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Persistence: unable to load mysql driver

Hi,

I'm having trouble with my sample GS persistence app where GS fails to deploy the PU complaining that it can't load the jdbc driver. Full stack trace is given below - note the ClassNotFoundException.

I have provided the mysql-connector jar in the PU lib directory, so I'm not sure why it's not able to load the class. I tried this with Postgres and it give me the same exception.

Any pointers please..

Thanks

[gsc][2/25404]  Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
[gsc][2/25404]  java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
[gsc][2/25404]          at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[gsc][2/25404]          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[gsc][2/25404]          at java.security.AccessController.doPrivileged(Native Method)
[gsc][2/25404]          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[gsc][2/25404]          at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[gsc][2/25404]          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[gsc][2/25404]          at java.lang.Class.forName0(Native Method)
[gsc][2/25404]          at java.lang.Class.forName(Class.java:190)
[gsc][2/25404]          at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
[gsc][2/25404]          at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
[gsc][2/25404]          at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:83)
[gsc][2/25404]          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
[gsc][2/25404]          at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
[gsc][2/25404]          at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
[gsc][2/25404]          at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
[gsc][2/25404]          at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
[gsc][2/25404]          at org.openspaces.persistency.hibernate.iterator.AbstractChunkDataIterator.initIterators(AbstractChunkDataIterator.java:151)
[gsc][2/25404]          at org.openspaces.persistency.hibernate.iterator.AbstractChunkDataIterator.iterators(AbstractChunkDataIterator.java:113)
[gsc][2/25404]          at org.openspaces.persistency.support.ConcurrentMultiDataIterator.<init>(ConcurrentMultiDataIterator.java:66)
[gsc][2/25404]          at org.openspaces.persistency.hibernate.AbstractHibernateSpaceDataSource.createInitialLoadIterator(AbstractHibernateSpaceDataSource.java:127)
[gsc][2/25404]          at org.openspaces.persistency.hibernate.DefaultHibernateSpaceDataSource.initialDataLoad(DefaultHibernateSpaceDataSource.java:84)
[gsc][2/25404]          at com.gigaspaces.datasource.concurrentaccess.SharedIteratorSpaceDataSourceDecorator.initialDataLoad(SharedIteratorSpaceDataSourceDecorator.java:157)
[gsc][2/25404]          at com.gigaspaces.internal.sync.SynchronizationStorageAdapter.initialLoad(SynchronizationStorageAdapter.java:294)
[gsc][2/25404]          at com.j_spaces.core.cache.CacheManager.loadDataFromDB(CacheManager.java:838)
[gsc][2/25404]          at com.j_spaces.core.cache.CacheManager.initCache(CacheManager.java:416)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.SpaceEngine.init(SpaceEngine.java:566)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.SpaceImpl.initAndRecoverFromDataStorage(SpaceImpl.java:1371)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.recovery.strategy.NonPrimaryBackupSpaceRecovery.recoverFromDB(NonPrimaryBackupSpaceRecovery.java:67)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.recovery.strategy.NonPrimaryBackupSpaceRecovery.recover(NonPrimaryBackupSpaceRecovery.java:58)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.SpaceImpl.initAndStartRegularSpace(SpaceImpl.java:1344)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.SpaceImpl.start(SpaceImpl.java:3403)
[gsc][2/25404]          at com.gigaspaces.internal.server.space.SpaceImpl.<init>(SpaceImpl.java:260)
[gsc][2/25404]          at com.j_spaces.core.JSpaceContainerImpl.createSpaceImpl(JSpaceContainerImpl.java:2451)
[gsc][2/25404]          at com.j_spaces.core.JSpaceContainerImpl.loadSpace(JSpaceContainerImpl.java:2394)
[gsc][2/25404]          at com.j_spaces.core.JSpaceContainerImpl.xmlInit(JSpaceContainerImpl.java:1184)
[gsc][2/25404]          at com.j_spaces.core.JSpaceContainerImpl.initContainer(JSpaceContainerImpl.java:682)
[gsc][2/25404]          at com.j_spaces.core.JSpaceContainerImpl.<init>(JSpaceContainerImpl.java:566)
[gsc][2/25404]          at com.j_spaces.core.client.SpaceFinder.initContainer(SpaceFinder.java:675)
[gsc][2/25404]          at com.j_spaces.core.client.SpaceFinder.findEmbeddedService(SpaceFinder.java:797)
[gsc][2/25404]          at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:519)
[gsc][2/25404]          at com.j_spaces.core.client.SpaceFinder.findService(SpaceFinder.java:472)
[gsc][2/25404]          at com.j_spaces.core.client.SpaceFinder.find(SpaceFinder.java:361)
[gsc][2/25404]          at org.openspaces.core.space.UrlSpaceFactoryBean.doCreateSpace(UrlSpaceFactoryBean.java:373)
[gsc][2/25404]          at org.openspaces.core.space.AbstractSpaceFactoryBean.afterPropertiesSet(AbstractSpaceFactoryBean.java:185)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1531)
[gsc][2/25404]          at java.security.AccessController.doPrivileged(Native Method)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1529)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
[gsc][2/25404]          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
[gsc][2/25404]          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
[gsc][2/25404]          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
[gsc][2/25404]          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
[gsc][2/25404]          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
[gsc][2/25404]          at org.openspaces.pu.container.integrated.IntegratedProcessingUnitContainerProvider.createContainer(IntegratedProcessingUnitContainerProvider.java:283)
[gsc][2/25404]          at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.startPU(PUServiceBeanImpl.java:713)
[gsc][2/25404]          at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.doStart(PUServiceBeanImpl.java:236)
[gsc][2/25404]          at org.jini.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:297)
[gsc][2/25404]          at org.jini.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:310)
[gsc][2/25404]          at org.jini.rio.jsb.JSBLoader.create(JSBLoader.java:106)
[gsc][2/25404]          at org.jini.rio.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:276)
[gsc][2/25404]          at org.jini.rio.cybernode.JSBDelegate.startServiceBean(JSBDelegate.java:475)
[gsc][2/25404]          at org.jini.rio.cybernode.JSBDelegate.load(JSBDelegate.java:330)
[gsc][2/25404]          at org.jini.rio.cybernode.JSBContainer.activate(JSBContainer.java:213)
[gsc][2/25404]          at org.jini.rio.cybernode.CybernodeImpl.instantiate(CybernodeImpl.java:1054)
[gsc][2/25404]          at org.jini.rio.core.provision.ServiceBeanInstantiatorGigaspacesMethodinternalInvoke3.internalInvoke(Unknown Source)
[gsc][2/25404]          at ...
(more)

asked 2014-06-30 14:17:52 -0500

myth gravatar image

updated 2014-06-30 14:20:16 -0500

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

I figured it out. It turns out that the jdbc connector jar should be placed in gs_home/lib/platform/ext directory rather than in the PU.

answered 2014-07-16 16:00:28 -0500

myth gravatar image
edit flag offensive delete link more
0

Make sure the jar has the com/mysql/jdbc/Driver.class file in it, and make sure the actual pu jar file has the mysql jar in it.

answered 2014-06-30 22:55:19 -0500

DeWayne gravatar image
edit flag offensive delete link more

Comments

I have already checked both. My PU does have the jar and the jar has the class file.

myth gravatar imagemyth ( 2014-07-16 15:57:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-06-30 14:17:52 -0500

Seen: 329 times

Last updated: Jul 16 '14