geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: ejb 3.0--connecting to a DB
Date Wed, 20 Jun 2007 03:00:13 GMT

On Jun 19, 2007, at 10:26 PM, Viet Hung Nguyen wrote:

> Thanks David, I resolved the PersistenceUnit problem from the hints  
> that you gave me.


Excellent!
>
> However, once all of that was resolved I am having problems  
> connecting to the DB....

It looks like you generated the db pool plan from the console.  I'm  
not an expert on how well the console works, but I think there are  
some questionable things here:

-- In my experience derby connectors don't work very well unless they  
get their classes from the system-database configuration where the  
derby engine is running.  Unless you use non-embedded derby client  
and maybe even then, you tend to run into classloading problems.  So  
I would replace the dependency on derby with a dependency on  
org.apache.geronimo.configs/system-database//car

- Unless you have previously created your database, you need to include
                     <config-property-setting  
name="CreateDatabase">true</config-property-setting>
to get derby to create it for you when you try to use it.

- You haven't got this far yet :-) but the jta and non-jta datasource  
should be pointing to the same database or you will get very strange  
results when openjpa tries to generate  a key.  It's also likely that  
all the tables will be generated in one of the databases and not  
available in the other.

I'm not sure which tranql connector you are using, either.  I would  
copy the system-database plan and remove the gbeans from it and  
change the dependencies so it depends on system-database and change  
the db names.

How are you deploying the db pool?

Hope this helps
david jencks


>
> I have the following:
>
> --BankPool.xml--
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
> connector-1.1">
>    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/ 
> deployment-1.1">
>        <dep:moduleId>
>            <dep:groupId>console.dbpool</dep:groupId>
>            <dep:artifactId>BankPool</dep:artifactId>
>            <dep:version>1.0</dep:version>
>            <dep:type>rar</dep:type>
>        </dep:moduleId>
>        <dep:dependencies>
>            <dep:dependency>
>                <dep:groupId>org.apache.derby</dep:groupId>
>                <dep:artifactId>derby</dep:artifactId>
>                <dep:type>jar</dep:type>
>            </dep:dependency>
>        </dep:dependencies>
>    </dep:environment>
>    <resourceadapter>
>        <outbound-resourceadapter>
>            <connection-definition>
>                <connectionfactory-interface>javax.sql.DataSource</ 
> connectionfactory-interface>
>                <connectiondefinition-instance>
>                    <name>BankPool</name>
>                    <config-property-setting  
> name="Driver">org.apache.derby.jdbc.EmbeddedDriver</config-property- 
> setting>
>                    <config-property-setting name="UserName">app</ 
> config-property-setting>
>                    <config-property-setting  
> name="ConnectionURL">jdbc:derby:BankDB</config-property-setting>
>                    <connectionmanager>
>                        <local-transaction/>
>                        <single-pool>
>                            <max-size>10</max-size>
>                            <min-size>0</min-size>
>                            <match-one/>
>                        </single-pool>
>                    </connectionmanager>
>                </connectiondefinition-instance>
>            </connection-definition>
>        </outbound-resourceadapter>
>    </resourceadapter>
> </connector>
>
> --persistence.xml--
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence     xmlns="http://java.sun.com/xml/ns/persistence"
>                xmlns:xsi="http://www.w3.org/2001/XMLSchema- 
> instance" version="1.0"
>                xsi:schemaLocation="http://java.sun.com/xml/ns/ 
> persistence http://java.sun.com/xml/ns/persistence/ 
> persistence_1_0.xsd">
>    <persistence-unit name="BankPU" transaction-type="JTA">
>        <description>Entity Beans for Bank</description>
>         
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</ 
> provider>
>        <class>org.apache.geronimo.samples.bank.ejb.Account</class>
>        <class>org.apache.geronimo.samples.bank.ejb.Customer</class>
>        <class>org.apache.geronimo.samples.bank.ejb.ExchangeRate</ 
> class>
>        <exclude-unlisted-classes />
>        <jta-data-source>BankPool</jta-data-source>
>        <non-jta-data-source>NoTxDatasource</non-jta-data-source>
>    </persistence-unit>
> </persistence>
>
>
> --web.xml--
>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http:// 
> java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
>        version="2.5">
>      <welcome-file-list>
>        <welcome-file>/jsp/index.jsp</welcome-file>
>    </welcome-file-list>
>
>    <servlet>
>        <display-name>CustomerServiceServlet</display-name>
>        <servlet-name>CustomerServiceServlet</servlet-name>
>        <servlet- 
> class>org.apache.geronimo.samples.bank.web.CustomerServiceServlet</ 
> servlet-class>
>    </servlet>
>      <servlet>
>        <display-name>CommonServiceServlet</display-name>
>        <servlet-name>CommonServiceServlet</servlet-name>
>        <servlet- 
> class>org.apache.geronimo.samples.bank.web.CommonServiceServlet</ 
> servlet-class>
>    </servlet>
>        <servlet-mapping>
>        <servlet-name>CustomerServiceServlet</servlet-name>
>        <url-pattern>/customer_info</url-pattern>
>    </servlet-mapping>
>      <servlet-mapping>
>        <servlet-name>CommonServiceServlet</servlet-name>
>        <url-pattern>/exchange_rates</url-pattern>
>    </servlet-mapping>
> </web-app>
>
> --geronimo-web.xml--
>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"  
> xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
>    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/ 
> deployment-1.1">
>        <dep:moduleId>
>            <dep:groupId>org.apache.geronimo.samples</dep:groupId>
>            <dep:artifactId>BankWeb</dep:artifactId>
>            <dep:version>1.2</dep:version>
>            <dep:type>car</dep:type>
>        </dep:moduleId>
>
>        <dep:dependencies>
>            <dep:dependency>
>                <dep:groupId>console.dbpool</dep:groupId>
>                <dep:artifactId>BankPool</dep:artifactId>
>                <dep:version>1.0</dep:version>
>                <dep:type>rar</dep:type>
>            </dep:dependency>
>            <dep:dependency>
>                <dep:groupId>org.tranql</dep:groupId>
>                <dep:artifactId>tranql-connector-ra</dep:artifactId>
>                <dep:version>1.3</dep:version>
>                <dep:type>rar</dep:type>
>            </dep:dependency>
>        </dep:dependencies>
>
>        <dep:hidden-classes/>
>
>        <dep:non-overridable-classes/>
>    </dep:environment>
>      <context-root>/Bank</context-root>
> </web-app>
>
>
> --WEB-APP snippet--
>
> public class CommonServiceServlet extends HttpServlet {
>    @EJB
>    private BankManagerFacadeLocal bm = null;
>
>    // some mo
>    private void viewRates(HttpServletRequest req,  
> HttpServletResponse res) throws ServletException, IOException{
>        String path = "/jsp/error.jsp";;
>               try {
>            Collection<ExchangeRate> rates = bm.getExchangeRates();
>            req.setAttribute("rateList",rates);
>                       path = "/jsp/exchange_rates.jsp";
>                   } catch (Exception e) {
>            e.printStackTrace();
>        }
>        getServletContext().getRequestDispatcher(path).forward 
> (req,res);
>    }
> }
>
> --EJB snippet--
> @Stateless
> public class BankManagerFacadeBean implements BankManagerFacadeLocal {
>      @PersistenceUnit(unitName="BankPU")
>    protected EntityManagerFactory emf;
>
>    // some mo
>
>    public Collection<ExchangeRate> getExchangeRates() {
>        EntityManager em = emf.createEntityManager();
>
>        String query = "SELECT * FROM ExchangeRate";
>        Collection<ExchangeRate> rateList =  
> (Collection<ExchangeRate>)em.createNativeQuery 
> ( query ).getResultList();
>
>        em.close();
>        return rateList;
>    }
> }
>
> I get the following stacktrace:
>
> ERROR [MCFConnectionInterceptor] Error occurred creating  
> ManagedConnection for  
> org.apache.geronimo.connector.outbound.ConnectionInfo@1ebe4d6
> javax.resource.spi.ResourceAllocationException: Unable to obtain  
> physical connection to jdbc:derby:BankDB
>    at org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection 
> (JDBCDriverMCF.java:98)
>    at  
> org.tranql.connector.jdbc.JDBCDriverMCF.createManagedConnection 
> (JDBCDriverMCF.java:73)
>    at  
> org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getCon 
> nection(MCFConnectionInterceptor.java:48)
>    at  
> org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterce 
> ptor.getConnection(LocalXAResourceInsertionInterceptor.java:41)
>    at  
> org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor 
> .internalGetConnection(SinglePoolConnectionInterceptor.java:66)
>    at  
> org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInt 
> erceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java: 
> 78)
>    at  
> org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor 
> .getConnection(TransactionEnlistingInterceptor.java:46)
>    at  
> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.g 
> etConnection(TransactionCachingInterceptor.java:87)
>    at  
> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.get 
> Connection(ConnectionHandleInterceptor.java:43)
>    at  
> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection 
> (TCCLInterceptor.java:39)
>    at  
> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.g 
> etConnection(ConnectionTrackingInterceptor.java:66)
>    at  
> org.apache.geronimo.connector.outbound.AbstractConnectionManager.alloc 
> ateConnection(AbstractConnectionManager.java:61)
>    at org.tranql.connector.jdbc.DataSource.getConnection 
> (DataSource.java:56)
>    at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection 
> (DelegatingDataSource.java:106)
>    at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection 
> (DecoratingDataSource.java:87)
>    at  
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal 
> (JDBCStoreManager.java:738)
>    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect 
> (JDBCStoreManager.java:723)
>    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection 
> (JDBCStoreManager.java:211)
>    at org.apache.openjpa.jdbc.kernel.SQLStoreQuery 
> $SQLExecutor.executeQuery(SQLStoreQuery.java:265)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:985)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)
>    at org.apache.openjpa.kernel.DelegatingQuery.execute 
> (DelegatingQuery.java:517)
>    at org.apache.openjpa.persistence.QueryImpl.execute 
> (QueryImpl.java:230)
>    at org.apache.openjpa.persistence.QueryImpl.getResultList 
> (QueryImpl.java:269)
>    at  
> org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean.getExchange 
> Rates(BankManagerFacadeBean.java:93)
>    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:585)
>    at  
> org.apache.openejb.core.interceptor.ReflectionInvocationContext 
> $Invocation.invoke(ReflectionInvocationContext.java:146)
>    at  
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.procee 
> d(ReflectionInvocationContext.java:129)
>    at org.apache.openejb.core.interceptor.InterceptorStack.invoke 
> (InterceptorStack.java:67)
>    at org.apache.openejb.core.stateless.StatelessContainer._invoke 
> (StatelessContainer.java:203)
>    at org.apache.openejb.core.stateless.StatelessContainer.invoke 
> (StatelessContainer.java:165)
>    at  
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod 
> (EjbObjectProxyHandler.java:211)
>    at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke 
> (EjbObjectProxyHandler.java:65)
>    at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke 
> (BaseEjbProxyHandler.java:306)
>    at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke 
> (Jdk13InvocationHandler.java:49)
>    at $Proxy42.getExchangeRates(Unknown Source)
>    at  
> org.apache.geronimo.samples.bank.web.CommonServiceServlet.viewRates 
> (CommonServiceServlet.java:54)
>    at  
> org.apache.geronimo.samples.bank.web.CommonServiceServlet.doGet 
> (CommonServiceServlet.java:43)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>    at org.mortbay.jetty.servlet.ServletHolder.handle 
> (ServletHolder.java:487)
>    at org.apache.geronimo.jetty6.InternalJettyServletHolder.handle 
> (InternalJettyServletHolder.java:65)
>    at org.mortbay.jetty.servlet.ServletHandler.handle 
> (ServletHandler.java:367)
>    at org.mortbay.jetty.security.SecurityHandler.handle 
> (SecurityHandler.java:216)
>    at org.mortbay.jetty.servlet.SessionHandler.handle 
> (SessionHandler.java:181)
>    at  
> org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.handle 
> (ThreadClassloaderHandler.java:46)
>    at  
> org.apache.geronimo.jetty6.handler.InstanceContextHandler.handle 
> (InstanceContextHandler.java:58)
>    at  
> org.apache.geronimo.jetty6.handler.UserTransactionHandler.handle 
> (UserTransactionHandler.java:48)
>    at org.mortbay.jetty.handler.ContextHandler.handle 
> (ContextHandler.java:712)
>    at org.mortbay.jetty.webapp.WebAppContext.handle 
> (WebAppContext.java:405)
>    at  
> org.apache.geronimo.jetty6.handler.ComponentContextHandler.handle 
> (ComponentContextHandler.java:47)
>    at org.mortbay.jetty.handler.ContextHandlerCollection.handle 
> (ContextHandlerCollection.java:211)
>    at org.mortbay.jetty.handler.HandlerCollection.handle 
> (HandlerCollection.java:114)
>    at org.mortbay.jetty.handler.HandlerWrapper.handle 
> (HandlerWrapper.java:139)
>    at org.mortbay.jetty.Server.handle(Server.java:295)
>    at org.mortbay.jetty.HttpConnection.handleRequest 
> (HttpConnection.java:503)
>    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete 
> (HttpConnection.java:827)
>    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
>    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>    at org.mortbay.io.nio.SelectChannelEndPoint.run 
> (SelectChannelEndPoint.java:361)
>    at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:201)
>    at org.apache.geronimo.pool.ThreadPool 
> $ContextClassLoaderRunnable.run(ThreadPool.java:331)
>    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask 
> (ThreadPoolExecutor.java:650)
>    at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:675)
>    at java.lang.Thread.run(Thread.java:595)
> Caused by: java.sql.SQLException: Database 'BankDB' not found.
>    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.Util.generateCsSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown  
> Source)
>    at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown  
> Source)
>    at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
>    at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
>    at org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection 
> (JDBCDriverMCF.java:96)
>    ... 70 more
> 22:16:33,765 ERROR [OpenEJB] The bean instances business method  
> encountered a system exception: Database 'BankDB' not found.
> <1.0.0-SNAPSHOT-SNAPSHOT nonfatal general error>  
> org.apache.openjpa.persistence.PersistenceException: Database  
> 'BankDB' not found.
>    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException 
> (DBDictionary.java:3784)
>    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore 
> (SQLExceptions.java:97)
>    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore 
> (SQLExceptions.java:83)
>    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore 
> (SQLExceptions.java:59)
>    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect 
> (JDBCStoreManager.java:727)
>    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection 
> (JDBCStoreManager.java:211)
>    at org.apache.openjpa.jdbc.kernel.SQLStoreQuery 
> $SQLExecutor.executeQuery(SQLStoreQuery.java:265)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:985)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
>    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762)
>    at org.apache.openjpa.kernel.DelegatingQuery.execute 
> (DelegatingQuery.java:517)
>    at org.apache.openjpa.persistence.QueryImpl.execute 
> (QueryImpl.java:230)
>    at org.apache.openjpa.persistence.QueryImpl.getResultList 
> (QueryImpl.java:269)
>    at  
> org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean.getExchange 
> Rates(BankManagerFacadeBean.java:93)
>    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:585)
>    at  
> org.apache.openejb.core.interceptor.ReflectionInvocationContext 
> $Invocation.invoke(ReflectionInvocationContext.java:146)
>    at  
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.procee 
> d(ReflectionInvocationContext.java:129)
>    at org.apache.openejb.core.interceptor.InterceptorStack.invoke 
> (InterceptorStack.java:67)
>    at org.apache.openejb.core.stateless.StatelessContainer._invoke 
> (StatelessContainer.java:203)
>    at org.apache.openejb.core.stateless.StatelessContainer.invoke 
> (StatelessContainer.java:165)
>    at  
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod 
> (EjbObjectProxyHandler.java:211)
>    at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke 
> (EjbObjectProxyHandler.java:65)
>    at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke 
> (BaseEjbProxyHandler.java:306)
>    at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke 
> (Jdk13InvocationHandler.java:49)
>    at $Proxy42.getExchangeRates(Unknown Source)
>    at  
> org.apache.geronimo.samples.bank.web.CommonServiceServlet.viewRates 
> (CommonServiceServlet.java:54)
>    at  
> org.apache.geronimo.samples.bank.web.CommonServiceServlet.doGet 
> (CommonServiceServlet.java:43)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>    at org.mortbay.jetty.servlet.ServletHolder.handle 
> (ServletHolder.java:487)
>    at org.apache.geronimo.jetty6.InternalJettyServletHolder.handle 
> (InternalJettyServletHolder.java:65)
>    at org.mortbay.jetty.servlet.ServletHandler.handle 
> (ServletHandler.java:367)
>    at org.mortbay.jetty.security.SecurityHandler.handle 
> (SecurityHandler.java:216)
>    at org.mortbay.jetty.servlet.SessionHandler.handle 
> (SessionHandler.java:181)
>    at  
> org.apache.geronimo.jetty6.handler.ThreadClassloaderHandler.handle 
> (ThreadClassloaderHandler.java:46)
>    at  
> org.apache.geronimo.jetty6.handler.InstanceContextHandler.handle 
> (InstanceContextHandler.java:58)
>    at  
> org.apache.geronimo.jetty6.handler.UserTransactionHandler.handle 
> (UserTransactionHandler.java:48)
>    at org.mortbay.jetty.handler.ContextHandler.handle 
> (ContextHandler.java:712)
>    at org.mortbay.jetty.webapp.WebAppContext.handle 
> (WebAppContext.java:405)
>    at  
> org.apache.geronimo.jetty6.handler.ComponentContextHandler.handle 
> (ComponentContextHandler.java:47)
>    at org.mortbay.jetty.handler.ContextHandlerCollection.handle 
> (ContextHandlerCollection.java:211)
>    at org.mortbay.jetty.handler.HandlerCollection.handle 
> (HandlerCollection.java:114)
>    at org.mortbay.jetty.handler.HandlerWrapper.handle 
> (HandlerWrapper.java:139)
>    at org.mortbay.jetty.Server.handle(Server.java:295)
>    at org.mortbay.jetty.HttpConnection.handleRequest 
> (HttpConnection.java:503)
>    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete 
> (HttpConnection.java:827)
>    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
>    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>    at org.mortbay.io.nio.SelectChannelEndPoint.run 
> (SelectChannelEndPoint.java:361)
>    at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:201)
>    at org.apache.geronimo.pool.ThreadPool 
> $ContextClassLoaderRunnable.run(ThreadPool.java:331)
>    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask 
> (ThreadPoolExecutor.java:650)
>    at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:675)
>    at java.lang.Thread.run(Thread.java:595)
> Caused by: java.sql.SQLException: Database 'BankDB' not found.
>    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.Util.generateCsSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException 
> (Unknown Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown  
> Source)
>    at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown  
> Source)
>    at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown  
> Source)
>    at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
>    at org.apache.derby.jdbc.EmbeddedDriver.connect(Unknown Source)
>    at org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection 
> (JDBCDriverMCF.java:96)
>    at  
> org.tranql.connector.jdbc.JDBCDriverMCF.createManagedConnection 
> (JDBCDriverMCF.java:73)
>    at  
> org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getCon 
> nection(MCFConnectionInterceptor.java:48)
>    at  
> org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterce 
> ptor.getConnection(LocalXAResourceInsertionInterceptor.java:41)
>    at  
> org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor 
> .internalGetConnection(SinglePoolConnectionInterceptor.java:66)
>    at  
> org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInt 
> erceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java: 
> 78)
>    at  
> org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor 
> .getConnection(TransactionEnlistingInterceptor.java:46)
>    at  
> org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.g 
> etConnection(TransactionCachingInterceptor.java:87)
>    at  
> org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.get 
> Connection(ConnectionHandleInterceptor.java:43)
>    at  
> org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection 
> (TCCLInterceptor.java:39)
>    at  
> org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.g 
> etConnection(ConnectionTrackingInterceptor.java:66)
>    at  
> org.apache.geronimo.connector.outbound.AbstractConnectionManager.alloc 
> ateConnection(AbstractConnectionManager.java:61)
>    at org.tranql.connector.jdbc.DataSource.getConnection 
> (DataSource.java:56)
>    at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection 
> (DelegatingDataSource.java:106)
>    at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection 
> (DecoratingDataSource.java:87)
>    at  
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal 
> (JDBCStoreManager.java:738)
>    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect 
> (JDBCStoreManager.java:723)
>    ... 54 more
>
> I am using Geronimo 2.0 (trunk). Am I missing something in the  
> persistence.xml or BankPool.xml?
>
> Thanks,
> Viet Nguyen


Mime
View raw message