java - TomEE DataSource isn't found -


i have strange problem regarding tomee , using datasource specified in tomee.xml. might worth noting i'm using netbeans, tomee , mysql. running on ubuntu 13.04 (xubuntu latest)

the tomee.xml file follows:

<?xml version="1.0" encoding="utf-8"?> <tomee>     <resource id="booktablesds" type="datasource">         jdbcdriver com.mysql.jdbc.driver         jdbcurl jdbc:mysql:localhost:3306/book_tables         username juser         password jpassword         jtamanaged true     </resource> </tomee> 

and small codesnippet, testing connection pool:

@resource datasource booktablesds;      protected void processrequest(httpservletrequest request, httpservletresponse response)             throws servletexception, ioexception {         try {      connection c = booktablesds.getconnection();     statement stmt = c.createstatement();     resultset rs = stmt.executequery("select * books"); 

the output i'm getting tomee is:

severe: null org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create jdbc driver of class '' connect url 'null' 

full stacktrace follows.

may 06, 2013 11:08:53 org.apache.catalina.util.lifecyclebase start info: start() method called on component [standardengine[catalina].standardhost[localhost].standardcontext[/ejbtest]] after start() had been called. second call ignored. may 06, 2013 11:08:54 mains processrequest severe: null org.apache.tomcat.dbcp.dbcp.sqlnestedexception: cannot create jdbc driver of class '' connect url 'null'     @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(basicdatasource.java:1452)     @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createdatasource(basicdatasource.java:1371)     @ org.apache.tomcat.dbcp.dbcp.basicdatasource.getconnection(basicdatasource.java:1044)     @ mains.processrequest(mains.java:35)     @ mains.doget(mains.java:64)     @ javax.servlet.http.httpservlet.service(httpservlet.java:621)     @ javax.servlet.http.httpservlet.service(httpservlet.java:728)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:171)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:99)     @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:936)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:407)     @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1004)     @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:589)     @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:312)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615)     @ java.lang.thread.run(thread.java:722) caused by: java.lang.nullpointerexception     @ sun.jdbc.odbc.jdbcodbcdriver.getprotocol(jdbcodbcdriver.java:524)     @ sun.jdbc.odbc.jdbcodbcdriver.knownurl(jdbcodbcdriver.java:493)     @ sun.jdbc.odbc.jdbcodbcdriver.acceptsurl(jdbcodbcdriver.java:307)     @ java.sql.drivermanager.getdriver(drivermanager.java:273)     @ org.apache.tomcat.dbcp.dbcp.basicdatasource.createconnectionfactory(basicdatasource.java:1437)     ... 22 more  may 06, 2013 11:08:55 org.apache.catalina.startup.hostconfig deleteredeployresources info: undeploying context [/ejbtest] 

basicly feels netbeans deploying project tomee.xml file? disregarding values in tomee.xml, under tom-ee/conf/tomee.xml

help awesome.

looks url wrong.

jdbc:mysql:localhost:3306/book_tables 

should be

jdbc:mysql://localhost:3306/book_tables 

can double-check whether mysql driver jar there in tomee/lib folder.


Comments