geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject Re: Geronimo 2.2 + Spring + Hibernate and a Geronimo managed DB Pool with XA driver
Date Fri, 16 Jul 2010 04:17:03 GMT
I think that you might need to define the resource reference in your ejb
deployment plan, or server will not map the resource to the bean scope
naming context. Or you could directly lookup it by the global naming if the
portable application is not your concern.

2010/7/16 Billy Vandory <billy_vandory@yahoo.com>

>
> I'm still having a problem with this.  I've determined it's not spring,
> it's
> most likely just a configuration issue.  The problem is trying to get a
> lookup to a global database pool in geronimo.  In an SL-EJB I have:
>
> InitialContext ctx = new InitialContext();
> DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/testmydb");
> Connection con = ds.getConnection();
>
> and my deployment plan for the db looks like (copied from geronimo's show
> plan button):
>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>    <dep:environment
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
>        <dep:moduleId>
>            <dep:groupId>console.dbpool</dep:groupId>
>            <dep:artifactId>jdbc_testmydb</dep:artifactId>
>            <dep:version>1.0</dep:version>
>            <dep:type>car</dep:type>
>        </dep:moduleId>
>        <dep:dependencies>
>            <dep:dependency>
>                <dep:groupId>postgresql</dep:groupId>
>                <dep:artifactId>postgresql-8.2</dep:artifactId>
>                <dep:version>508.jdbc3</dep:version>
>                <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>testmydb</name>
>                    <config-property-setting
> name="DatabaseName">walmart0192</config-property-setting>
>                    <config-property-setting
> name="Password"></config-property-setting>
>                    <config-property-setting
> name="UserName">itmgr</config-property-setting>
>                    <config-property-setting
> name="ServerName">192.168.0.10</config-property-setting>
>                     <config-property-setting name="PrepareThreshold"/>
>                    <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>
>
> but i always get the exception:
>
> 80041:  2010-07-15 21:30:06,442 ERROR [CategoryEJB]
> javax.naming.NotContextException: jdbc/testmydb
>
> Note that I am not running a web app, just an EJB backend, so I am not
> configuring anything in web.xml.  is the configuration in web.xml required?
> I tried it and its the same result, but I would like to rule this out, that
> web.xml resource-ref config is not required if not running in a web app.
>
> The JNDI name under geronimo's JNDI viewer is: (resource adapters)
> console.dbpool/testmydb/1.0/car
>
> also shows:
> jca:/default/wakapeek-persist-ear/JCAManagedConnectionFactory/testmydb
>
> In the geronimo deployment plan i have a connector defined:
>
> <app:module>
>  <app:connector>tranql-connector-postgresql-local-1.2.rar</app:connector>
>  <app:alt-dd>testmydb.xml</app:alt-dd>
> </app:module>
>
> Using dbpool in the geronimo console, i can query this database just fine.'
>
> Any ideas?  Thanks alot.
> Billy
>
>
>
> --
> View this message in context:
> http://apache-geronimo.328035.n3.nabble.com/Geronimo-2-2-Spring-Hibernate-and-a-Geronimo-managed-DB-Pool-with-XA-driver-tp874759p971182.html
> Sent from the Users mailing list archive at Nabble.com.
>



-- 
Ivan

Mime
View raw message