We want to deploy our Applications (.war-Files) via Tomcat 8.5 into a k8s-infrastructure, having the depending Database on Google Cloud SQL (MySQL).
Google offers the MySQL-Connector-Librarys ( see https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/main/docs/jdbc-mysql.md & https://cloud.google.com/sql/docs/mysql/connect-connectors), sadly with only documentation about implementation into the java application itself.
for company strategic reasons we don't want to do that.
We already tried to use a fat jar with all the dependencies of the mysql-connector and put that (together with the connectorJ/8.jar) into the tomcat/libs/ directory and configured the resource in the server.xml as follows:
<Resource name="jdbc/cloudSQL" auth="Container" type="javax.sql.DataSource" maxTotal="100" maxIdle="30" maxWaitMillis="10000"
factory="com.google.cloud.sql.mysql.SocketFactory" driverClassName="com.mysql.cj.jdbc.Driver" removeAbandonedOnBorrow="true" removeAbandonedTimeout="60" logAbandoned="true"
username="${db.user}" password="${db.pass}" url="jdbc:mysql:///${db.name}?cloudSqlInstance=${db.instance}&autoReconnect=true"
testOnBorrow="true" validationQuery="SELECT 1" />
Doesn't work too bad, but is not successfully either:
javax.naming.NamingException: Could not create resource factory instance
[Root exception is java.lang.ClassCastException: com.google.cloud.sql.mysql.SocketFactory cannot be cast to javax.naming.spi.ObjectFactory]
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:86)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:332)
at org.apache.naming.NamingContext.lookup(NamingContext.java:846)
at org.apache.naming.NamingContext.lookup(NamingContext.java:157)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:115)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:69)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:32)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:138)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:145)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:112)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:87)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:695)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: java.lang.ClassCastException: com.google.cloud.sql.mysql.SocketFactory cannot be cast to javax.naming.spi.ObjectFactory
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:75) ... 22 more
I'd appreciate any idea how to tackle this issue.
I replicate the issue on Google Cloud, then instead of using the library from Google Cloud I was able to connect to Cloud SQL using Connector/J following the Tomcat instructions (https://tomcat.apache.org/tomcat-8.5-doc/jndi-datasource-examples-howto.html)
Related
In my server.xml, I'm defining a resource:
<Resource name="global" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxIdle="30" maxWaitMillis="10000"
username="user" password="betterThanThis"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:memory:test;create=true"/>
In my webapp context.xml I'm linking to it:
<ResourceLink name="local"
auth="Container"
global="global"
type="javax.sql.DataSource" />
In my web.xml I'm referencing it
<resource-ref>
<res-ref-name>local</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And in my code, I'm using it
DataSource ds = InitialContext.doLookup("java:/comp/env/local");
ds.getConnection();
That last line throws an exception:
java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2167) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2037) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
Question: Why is a class in the org.apache.tomcat.dbcp.dbcp2 package throwing an error when I've specified factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" on my Resource?
It's not a missing jar problem, because I can see the Derby init in tomcat's logs. I don't think it's a naming issue, because when I change the name in InitialContext.doLookup("java:/comp/env/local") I get a naming error.
Edit: Full stack trace as requested:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:315) ~[na:1.8.0_151]
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2151) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
... 8 common frames omitted
Wrapped by: java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2167) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2037) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1543) ~[tomcat8-dbcp-8.5.14.jar:8.5.14]
at com.moosemorals.webmail.Database.getConnection(Database.java:46) ~[classes/:na]
at com.moosemorals.webmail.Database.getAccountForAlias(Database.java:55) ~[classes/:na]
at com.moosemorals.webmail.authserver.PostfixLookupServer.lookup(PostfixLookupServer.java:61) ~[classes/:na]
at com.moosemorals.webmail.authserver.PostfixLookupServer.execute(PostfixLookupServer.java:40) ~[classes/:na]
at com.moosemorals.webmail.authserver.GenericServer$Client.run(GenericServer.java:151) [classes/:na]
It says "No suitable driver" so you may be missing some derby jdbc jar. Putting it in Tomcat lib may be needed.
I have a spring application running on a Tomcat 8.0 server the following error when either Stopping the server or Redeploying the app on the server.
INFO: Closing Spring root WebApplicationContext
Jul 25, 2016 10:18:40 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
WARNING: The web application [APP_NAME] appears to have started a thread named [AS400 Read Daemon [system:*connectionurl*;job:768339/QUSER/QZDASOINIT]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.socketRead(Unknown Source)
java.net.SocketInputStream.read(Unknown Source)
java.net.SocketInputStream.read(Unknown Source)
com.ibm.as400.access.DataStream.readFromStream(DataStream.java:52)
com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:58)
com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:357)
java.lang.Thread.run(Unknown Source)
I am connecting to an AS400 db with the JT400 maven dependency (version 9.0, though I've tried others), so the AS400JDBCDriver. Here is how my connection is set up in my app's context.xml
<Resource name="jdbc/test_name"
auth="Container"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
initialSize="3"
logAbandoned="true"
maxActive="100"
maxIdle="40"
maxWait="30000"
minEvictableIdleTimeMillis="60000"
minIdle="10"
password="*password*"
removeAbandoned="true"
removeAbandonedTimeout="60"
testOnBorrow="true"
testOnReturn="false"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="30000"
type="javax.sql.DataSource"
url="jdbc:as400:*connection url*;date format=iso;time format=iso;"
username="*username*"
validationInterval="30000"
validationQuery="SELECT current date FROM sysibm.sysdummy1"
/>
The datasource is then declared in a spring configuration file:
<bean id="dataSourceTester" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/test_name"/>
</bean>
And then I have dozens of beans using that datasource.
<bean id="testTesterDAO" class="*class url*" scope="request">
<property name="dataSource" ref="dataSourceTester" />
So the problem is, when I stop my Tomcat or redeploy, I am greeted with a number of these messages about threads that have failed to stop. I know that it specifically comes from this connection source because when I change the "initialSize" attribute (like from 3 to 5), I get that many messages when the server stops. So it's clear that all of these connections being opened by the connection pool are not getting terminated.
When the server shuts down, the threads do dissappear (obviously, the server doesn't exist anymore), but when its just a redeploy, these threads definitely stay open. I know this because I can go on the as400 machine and find the open job, and they dont really seem to time out.
I've tried a bunch of things, I have a ServletContextListener which deregisters the driver (which got rid of that warning, but not these), I have tried moving the jt400.jar to the tomcat/lib folder (but I can't really tell if its working off of there or not when I run it), and I've tried tweaking the settings and trying different versions of the jt400.jar. No luck.
Any advice or help would be greatly appreciated.
I have a web application that is deployed locally to a Liberty Profile server, and that is already working with log4j2. My end goal is to log all of the PreparedStatements with their parameter values included in the query string, just before they are run against a DB2 database.
I've been following the instructions at https://code.google.com/p/log4jdbc-log4j2 to set up log4jdbc-log4j2. I was able to pull down the dependency files with Maven:
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4</artifactId>
<version>1.16</version>
</dependency>
However, I've been stuck at steps 3.1 and 3.2 for awhile, and so far, nothing on stackoverflow or instructional blogs has helped me move forward, so I thought it was time to ask my own question.
Could someone please let me know in which file(s), and how, I should make the changes mentioned in steps 3.1 ("Change your JDBC URL") and 3.2 ("Change the driver used")? Please let me know if there's something I can clarify further in order to help get my question answered, and thank you in advance for any help or guidance you can provide.
Update
After making the changes to server.xml suggested aguibert and including all log4j*.jar files from the dependency in the db2 drivers directory, my server.xml entry looks like this:
<dataSource id="myDataSource" jndiName="jdbc/myDataSource" type="javax.sql.DataSource">
<jdbcDriver javax.sql.DataSource="net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy">
<library>
<fileset dir="<path to dir>/db2" includes="db2jcc_license_cisuz.jar db2jcc4.jar log4j-api-2.3.jar log4j-core-2.3.jar log4jdbc-log4j2-jdbc4-1.16-sources.jar log4jdbc-log4j2-jdbc4-1.16.jar"/>
</library>
</jdbcDriver>
<properties
password="password"
user="user"
URL="jdbc:log4jdbc:db2://<normal jdbc url>" />
</dataSource>
Now, when the first query is made, I get an InstantiationException on net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy:
java.lang.Exception:
at <my files>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) [com.ibm.ws.javaee.servlet.3.0_1.0.8.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) [com.ibm.ws.javaee.servlet.3.0_1.0.8.jar:?]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4845) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:297) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262) [com.ibm.ws.webcontainer_1.0.8.jar:?]
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955) [com.ibm.ws.transport.http_1.0.8.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_60]
Caused by: javax.naming.NamingException: CWWKN0008E: An object could not be obtained for name jdbc/myDataSource.
at com.ibm.ws.jndi.internal.WSContext.resolveObject(WSContext.java:128) ~[?:?]
at com.ibm.ws.jndi.internal.WSContext.lookup(WSContext.java:364) ~[?:?]
at com.ibm.ws.jndi.internal.WSContext.lookup(WSContext.java:359) ~[?:?]
at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161) ~[?:?]
at javax.naming.InitialContext.lookup(InitialContext.java:411) ~[?:1.7.0_60]
at <my files>
... 16 more
[ERROR ] CWWKE0701E: FrameworkEvent ERROR Bundle:com.ibm.ws.jdbc(id=69) org.osgi.framework.ServiceException: Exception in com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService()
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222)
at [internal classes]
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at <my files>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
at [internal classes]
Caused by: java.lang.RuntimeException: java.sql.SQLNonTransientException: java.lang.InstantiationException: net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy
at com.ibm.ws.resource.internal.ResourceFactoryTrackerData$1.getService(ResourceFactoryTrackerData.java:109)
... 10 more
Caused by: java.sql.SQLNonTransientException: java.lang.InstantiationException: net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy
at com.ibm.ws.jdbc.internal.JDBCDriverService.create(JDBCDriverService.java:287)
... 10 more
Caused by: java.lang.InstantiationException: net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy
at java.lang.Class.newInstance(Class.java:359)
at com.ibm.ws.jdbc.internal.JDBCDriverService$1.run(JDBCDriverService.java:228)
... 10 more
Event:org.osgi.framework.FrameworkEvent[source=com.ibm.ws.jdbc_1.0.8.cl50520150305-2202 [69]]
If it looks like there's anything that I've missed, please let me know. Searching for the errors in the stack trace hasn't resulted in any solutions.
Final Status
As aguibert pointed out, it seems like a different direction will be best here. Based on a comment in Logging PreparedStatements in Java, I've decided to implement a LoggableStatement wrapper as described here: ibm.com/developerworks/java/library/j-loggable
For a WebSphere Liberty server, all of the global server config is done in the server.xml file (located by defualt at WLP_INSTALL/usr/servers//server.xml).
You will probably want something along these lines in your server.xml:
<dataSource id="myDataSource" jndiname="jdbc/myDataSource" type="javax.sql.DataSource">
<jdbcDriver javax.sql.DataSource="net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy">
<library>
<fileset dir="C:/path/to/libs" includes="thedb2jar.jar log4j.jar" />
</library>
</jdbcDriver>
<properties user="user" password="password"
url="jdbc:log4jdbc:<the normal jdbc url>"/>
</dataSource>
The key parts here is that the element has the "javax.sql.DataSource" property set and the value is the name of the DataSource class for the log4j jar. Also, in the element, you'll see that the url is specified with the "jdbc:log4jdbc" prefix as described in section 3.1.
This is untested advice, but you may need to include both jars (the db2 jar and the log4j jar) in the same folder so they are picked up in the same element.
I am getting the above exception, and I don't know why.
Here is some more information:
Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mysql://localhost:3306/staffing_2014'
I am using Spring. In the Spring application context, I have the following dataSource:
<jee:jndi-lookup id="dataSource"
jndi-name="jdbc/StaffingDB"
expected-type="javax.sql.DataSource" />
It seems to read the database URL and credentials OK from tomcat's context.xml:
<Resource name="jdbc/StaffingDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="xxx" password="yyy" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/staffing_2014"/>
Before anyone suggests Googling it, I have. The obvious answers I've found have been:
Database URL malformed? - checked and OK.
MySQL driver in classpath? Yes- jar is in $TOMCAT_HOME/lib
Any other suggesions?
EDIT - way down the bottom:
java.sql.SQLException: No suitable driver
java.sql.DriverManager.getDriver(DriverManager.java:279)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
What version of Tomcat are you using? In some Tomcats (T5), TOMCAT_HOME/lib may not be the right location. You have to put the driver in Tomcat's endorsed folder which could be
TOMCAT_HOME/endorsed or
TOMCAT_HOME/shared/lib
Check your Tomcat setup.
I want to do connection pooling using BoneCP. But i got a log of Could not load the resource factory class.
I got a this error log on tomcat startup
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: com.jolbox.bonecp.BoneCPDataSource]
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:81)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:747)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: com.jolbox.bonecp.BoneCPDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:79)
... 17 more
I have added the resource to server.xml like this.
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource type='javax.sql.DataSource'
name='demodb'
factory='com.jolbox.bonecp.BoneCPDataSource'
driverClassName='oracle.jdbc.driver.OracleDriver'
jdbcUrl='jdbc:oracle:thin:#localhost:1521:XE'
username='system'
password='system'
idleMaxAge='240'
idleConnectionTestPeriod='60'
partitionCount='3'
acquireIncrement='5'
maxConnectionsPerPartition='10'
minConnectionsPerPartition='5'
statementsCacheSize='50'
releaseHelperThreads='5'
/>
</GlobalNamingResources>
can anyone tell me what the problem is ?
The exception says that the class com.jolbox.bonecp.BoneCPDataSource was not found. Have you made sure that the class is loaded either by the server or your application?
It should be located in one of those jars.
Hope this helped, have Fun!
You have to add this line:
<pathelement location="/path/bonecp-0.7.1.RELEASE.jar"/>
into your classpath. Please correct the path if you want to use Netbeans.
Sometimes the error can come due to mixed up jars. The connection pool uses a custom class loader and will not allow jars from different BoneCP/Datanucleus versions.