cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Can not load JDBC driver named 'org.apache.derby.jdbc.ClientDriver'
Date Mon, 30 Apr 2012 09:24:56 GMT
Hi there,

You are probably using derby.jar. It contains EmbeddedDriver, but not ClientDriver. Try derbyclient.jar
instead:


~/opt/db-derby-10.5.3.0-bin/lib: jar tvf derby.jar |grep ClientDriver
(no output)

~/opt/db-derby-10.5.3.0-bin/lib: jar tvf derbyclient.jar |grep ClientDriver
  6948 Mon Aug 10 13:16:38 FEST 2009 org/apache/derby/jdbc/ClientDriver.class

Andrus




On Apr 30, 2012, at 12:09 PM, Tadrierion wrote:

> Hello,
> 
> I'm French so I'm sorry if I make some mistakes.
> I have created a database and I have generated classes thanks to Cayenne.
> Driver used : org.apache.derby.jdbc.EmbeddedDriver
> URL : jdbc:derby:database
> I have created a "main" class to insert and delete some informations from
> the database (it's not a memory database). It works perfectly and this, from
> a remote client.
> 
> Now I want to connect more than one client on the database at the same time.
> So in CayenneModeler I change the driver and the URL :
> Driver used : org.apache.derby.ClientDriver
> URL : jdbc:derby://localhost/database
> After' I launch the jetty server (port 8080) and the derby server (port
> 1527) from Eclipse. I run the main class in the client machine and I obtain
> an error :
> 
> /26-Apr-2012 10:25:15 org.apache.cayenne.access.QueryLogger
> logConnectFailure  
>    INFO: *** Connecting: FAILURE.  
>    java.sql.SQLException: Can not load JDBC driver named
> 'org.apache.derby.jdbc.ClientDriver': org.apache.derby.jdbc.ClientDriver  
>        at
> org.apache.cayenne.conn.DriverDataSource.loadDriver(DriverDataSource.java:59)  
>        at
> org.apache.cayenne.conn.DriverDataSource.setDriverClassName(DriverDataSource.java:253)
 
>        at
> org.apache.cayenne.conn.DriverDataSource.<init>(DriverDataSource.java:98)  
>        at
> org.apache.cayenne.conn.DriverDataSource.<init>(DriverDataSource.java:84)  
>        at org.apache.cayenne.conn.PoolManager.<init>(PoolManager.java:89)  
>        at
> org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:82)
 
>        at
> org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:334)
 
>        at
> org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:345)  
>        at
> org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:222)
 
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)  
>        at
> org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:78)  
>        at
> org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:152)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initCayenneStack(BaseRemoteService.java:207)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initService(BaseRemoteService.java:76)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianService.init(HessianService.java:65)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianServlet.init(HessianServlet.java:76)
 
>        at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)  
>        at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)  
>        at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)  
>        at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)  
>        at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)  
>        at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)  
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 
>        at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)  
>        at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)  
>        at org.mortbay.jetty.Server.handle(Server.java:326)  
>        at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)  
>        at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)  
>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)  
>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)  
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)  
>        at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)  
>        at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)  
>    26-Apr-2012 10:25:15 org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLoadDataNode  
>    INFO: Error: DataSource load failed  
>    java.sql.SQLException: Can not load JDBC driver named
> 'org.apache.derby.jdbc.ClientDriver': org.apache.derby.jdbc.ClientDriver  
>        at
> org.apache.cayenne.conn.DriverDataSource.loadDriver(DriverDataSource.java:59)  
>        at
> org.apache.cayenne.conn.DriverDataSource.setDriverClassName(DriverDataSource.java:253)
 
>        at
> org.apache.cayenne.conn.DriverDataSource.<init>(DriverDataSource.java:98)  
>        at
> org.apache.cayenne.conn.DriverDataSource.<init>(DriverDataSource.java:84)  
>        at org.apache.cayenne.conn.PoolManager.<init>(PoolManager.java:89)  
>        at
> org.apache.cayenne.conf.DriverDataSourceFactory.getDataSource(DriverDataSourceFactory.java:82)
 
>        at
> org.apache.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataNode(RuntimeLoadDelegate.java:334)
 
>        at
> org.apache.cayenne.conf.ConfigLoader$NodeHandler.init(ConfigLoader.java:345)  
>        at
> org.apache.cayenne.conf.ConfigLoader$DomainHandler.startElement(ConfigLoader.java:222)
 
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)  
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)  
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)  
>        at
> org.apache.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java:78)  
>        at
> org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:152)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initCayenneStack(BaseRemoteService.java:207)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initService(BaseRemoteService.java:76)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianService.init(HessianService.java:65)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianServlet.init(HessianServlet.java:76)
 
>        at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)  
>        at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)  
>        at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)  
>        at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)  
>        at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)  
>        at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)  
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 
>        at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)  
>        at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)  
>        at org.mortbay.jetty.Server.handle(Server.java:326)  
>        at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)  
>        at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)  
>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)  
>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)  
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)  
>        at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)  
>        at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)  
>    26-Apr-2012 10:25:15 org.apache.cayenne.conf.RuntimeLoadDelegate
> initAdapter  
>    INFO: no adapter set, using automatic adapter.  
>    26-Apr-2012 10:25:15 org.apache.cayenne.conf.RuntimeLoadDelegate
> shouldLinkDataMap  
>    INFO: loaded map-ref: DomainMap.  
>    2012-04-26 10:25:15.859:WARN:/tutorial:unavailable  
>    org.apache.cayenne.CayenneRuntimeException: [v.3.0.2 Jun 19 2011
> 09:29:50] Error starting Cayenne  
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initCayenneStack(BaseRemoteService.java:211)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initService(BaseRemoteService.java:76)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianService.init(HessianService.java:65)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianServlet.init(HessianServlet.java:76)
 
>        at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)  
>        at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)  
>        at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)  
>        at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)  
>        at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)  
>        at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)  
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 
>        at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)  
>        at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)  
>        at org.mortbay.jetty.Server.handle(Server.java:326)  
>        at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)  
>        at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)  
>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)  
>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)  
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)  
>        at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)  
>        at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)  
>    2012-04-26 10:25:15.859:WARN::/tutorial/cayenne-service  
>    org.apache.cayenne.CayenneRuntimeException: [v.3.0.2 Jun 19 2011
> 09:29:50] Error starting Cayenne  
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initCayenneStack(BaseRemoteService.java:211)
 
>        at
> org.apache.cayenne.remote.service.BaseRemoteService.initService(BaseRemoteService.java:76)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianService.init(HessianService.java:65)
 
>        at
> org.apache.cayenne.remote.hessian.service.HessianServlet.init(HessianServlet.java:76)
 
>        at
> org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)  
>        at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)  
>        at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)  
>        at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)  
>        at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)  
>        at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)  
>        at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)  
>        at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 
>        at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)  
>        at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)  
>        at org.mortbay.jetty.Server.handle(Server.java:326)  
>        at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)  
>        at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)  
>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:842)  
>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)  
>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)  
>        at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)  
>        at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)  
> /
> 
> One project on the server, with all generated classes (CayenneModeler). One
> Database on the server.
> One project on the client with all generated classes and one main class
> which connect to the server.
> 
> I launch two servers : Jetty Server and Derby Server. 
> I tried to do the same things but on the same computer, and I have the same
> error.
> I tried to enter an unknown driver and I have the same error.
> I verify in the library if the driver is here : 
> http://http://www.hostingpics.net/viewer.php?id=139903untitled.png
> http://www.hostingpics.net/viewer.php?id=139903untitled.png 
> 
> Thanks
> Tadrierion 
> 
> --
> View this message in context: http://cayenne.195.n3.nabble.com/Can-not-load-JDBC-driver-named-org-apache-derby-jdbc-ClientDriver-tp3950272.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
> 


Mime
View raw message