Paul Ryan wrote:

> Hi,
> 
> We would like to test our J2EE app. on a JBoss-Tomcat platform. We 
> have a mixture of servlets and EJB's and I have used the deployment 
> tool to generate a jboss.xml file. When this is packaged in our ear 
> file the deployment seems to go ok and I can see the file being 
> exploded and the web context being created.
> 
> My problem is that I can't seem to access a database connection pool 
> from within the first servlet. We are using an Oracle 8i database with 
> a thin ( type 4) driver.
> 
> Note: We have sucessfully deployed this app to Orion, Weblogic & 
> iPlanet servers.
> 
> The relevant entries are
> 
> 1) In jboss.jcml I have added
> 
>  <!-- JDBC -->
>  <mbean code="org.jboss.jdbc.JdbcProvider" 
> name="DefaultDomain:service=JdbcProvider">
>    <attribute name="Drivers">oracle.jdbc.driver.OracleDriver</attribute>
>  </mbean>
> 
>  <mbean code="org.jboss.jdbc.XADataSourceLoader" 
> name="DefaultDomain:service=XADataSource,name=mcs">
>   <attribute name="PoolName">jdbc/mcs_general</attribute>
>   <attribute 
> 
>name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
> 
> 
>   <attribute name="URL">jdbc:oracle:thin:@test:1521:test</attribute>
>   <attribute name="JDBCUser">test</attribute>
>   <attribute name="Password">test</attribute>
>  </mbean>
> 
> 2) Our web.xml has the following entry
> 
>   <resource-ref>
>       <description>Data source</description>
>       <res-ref-name>jdbc/mcs_general</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
> 
> 3) Finally out code is calling the connection like this
> 
> 
>       try {
>           if (lookupName != null) {
>               if (jndiContext == null) {  // Double Check Locking
>                   synchronized (lockObject) {
>                       if (jndiContext == null) {
>                           jndiContext = new InitialContext();
>                       }
>                   }
>               }
> 
>                            DataSource dataSource = (DataSource)
>                                jndiContext.lookup("java:comp/env/"
>                                          + lookupName);
> 
>   Note: In the above line the variable lookupName evaluates to 
> "jdbc/mcs_general"
> 
> 
> 
> I have used a debugger to try to compare the Context object returned 
> by JBoss and the object returned by an Orion server but it didn't help.
> 
> 
> Any help would be appreciated.
> 
> Paul Ryan
> 
> 
> Apologies,


I forgot to list the error, we get a javax.naming.NameNotFoundException 
: jdbc not bound.

Paul.

> 
> 



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to