Add the following text to your web.xml file to use container based datasource
<resource-ref> <res-ref-name>esme</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> On Thu, Jan 14, 2010 at 4:49 AM, Chatree Srichart <[email protected]> wrote: > Hi, all > > When I run "mvn clean jetty:run" command. The ESME server is work fine. But > when I deploy war to other Tomcat, it is not found > "jdbc:derby:esme_db;create=true". The error occur like this: > > java.sql.SQLException: No suitable driver found for > jdbc:derby:esme_db;create=true > at java.sql.DriverManager.getConnection(DriverManager.java:602) > at java.sql.DriverManager.getConnection(DriverManager.java:207) > at bootstrap.liftweb.DBVendor$.createOne(Boot.scala:268) > at bootstrap.liftweb.DBVendor$.newConnection(Boot.scala:277) > at net.liftweb.mapper.DB$$anonfun$1$$anonfun$apply$2.apply(DB.scala:113) > at net.liftweb.mapper.DB$$anonfun$1$$anonfun$apply$2.apply(DB.scala:113) > at net.liftweb.common.EmptyBox.or(Box.scala:374) > at net.liftweb.mapper.DB$$anonfun$1.apply(DB.scala:113) > at net.liftweb.mapper.DB$$anonfun$1.apply(DB.scala:113) > at net.liftweb.common.Full.flatMap(Box.scala:332) > at net.liftweb.mapper.DB$.newConnection(DB.scala:113) > at net.liftweb.mapper.DB$.getConnection(DB.scala:209) > at net.liftweb.mapper.DB$.use(DB.scala:554) > at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:54) > at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:37) > at bootstrap.liftweb.Boot.boot(Boot.scala:76) > 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 > net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:409) > at > net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:407) > at > net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:1247) > at > net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:1247) > at net.liftweb.common.Full.map(Box.scala:330) > at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:1247) > at > net.liftweb.http.provider.HTTPProvider$class.bootLift(HTTPProvider.scala:70) > at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:532) > at > net.liftweb.http.provider.servlet.ServletFilterProvider$class.init(ServletFilterProvider.scala:20) > at net.liftweb.http.LiftFilter.init(LiftServlet.scala:532) > .... > .... This is probably occuring, because there already is a derby running in the same container > .... > 2010-01-14 10:35:33,496 (main) [ Log.scala:208:ERROR] Failed > to Boot > java.lang.NullPointerException: Looking for Connection Identifier > ConnectionIdentifier(esme) but failed to find either a JNDI data source with > the name esme or a lift connection manager with the correct name > at net.liftweb.mapper.DB$$anonfun$2$$anonfun$apply$9.apply(DB.scala:120) > at net.liftweb.mapper.DB$$anonfun$2$$anonfun$apply$9.apply(DB.scala:120) > at net.liftweb.common.EmptyBox.openOr(Box.scala:372) > at net.liftweb.mapper.DB$$anonfun$2.apply(DB.scala:119) > at net.liftweb.mapper.DB$$anonfun$2.apply(DB.scala:119) > at net.liftweb.common.EmptyBox.openOr(Box.scala:372) > at net.liftweb.mapper.DB$.newConnection(DB.scala:113) > at net.liftweb.mapper.DB$.getConnection(DB.scala:209) > at net.liftweb.mapper.DB$.use(DB.scala:554) > at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:54) > at net.liftweb.mapper.Schemifier$.schemify(Schemifier.scala:37) > at bootstrap.liftweb.Boot.boot(Boot.scala:76) > .... > .... > .... > > I already have other database is running, "jdbc:derby:ofbiz;create=true." > How I use this database? > Can any one help me? > > Regards, If the other database is available via jndi, then you could use the "jndi.name" to set it. A quick fix might be to change line 265 in Boot.scala from ""jdbc:derby:esme_db;create=true" to "jdbc:derby:ofbiz;create=true." >
