here's a bit more info on my situation.  when i deploy my ejb, here's the
log that's displayed.

[DEBUG,EntityContainer] Begin java:comp/env for EJB: EmployeeEJB
[DEBUG,EntityContainer] TCL: java.net.URLClassLoader@ec5677
[DEBUG,EntityContainer] Binding resource manager: jdbc/mcs/database to JDNI
ENC
as: jdbc/mcs/mcsuser
[DEBUG,EntityContainer] End java:comp/env for EJB: EmployeeEJB

that still hasn't helped me figure out which JNDI name I should be using
inside my ejb.  thanks again.

-----Original Message-----
From: Sonnek, Ryan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 11:06 AM
To: '[EMAIL PROTECTED]'
Subject: [JBoss-user] Binding Datasource problems


hopefully this will be a simple question for someone out there.  I'm trying
to use an already configured datasource from an ejb, but i'm getting mixed
up on how the JNDI name is bound.  I'm using jboss 2.4.4 with tomcat 4.0.1.
I've tried several different JNDI names, and servlets are able to use the
literal JNDI name from the jboss.jcml, but my EJB can't connect.

any help would be greatly appreciated.  thanks.

EJB DAO source code:
--------------------
Context naming = new InitialContext();
DataSource dataSource = (DataSource)
naming.lookup("java:comp/env/jdbc/mcs/mcsuser);
connection = dataSource.getConnection();

ejb.xml
--------------------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

<ejb-jar>
  <description>Machine Crewing System Enterprise Java Beans</description>
  <display-name>MCS EJB</display-name>
  <enterprise-beans>
    <entity>
      <description>Employee BMP</description>
      <display-name>EmployeeEJB</display-name>
      <ejb-name>EmployeeEJB</ejb-name>
      <home>bpc.mcs.ejb.employee.EmployeeHome</home>
      <remote>bpc.mcs.ejb.employee.Employee</remote>
      <ejb-class>bpc.mcs.ejb.employee.EmployeeEJB</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <reentrant>False</reentrant>
      <security-identity>
        <description></description>
        <use-caller-identity></use-caller-identity>
      </security-identity>
      <resource-ref>
        <res-ref-name>jdbc/mcs/mcsuser</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
    </entity>
  </enterprise-beans>
  <assembly-descriptor>
    <container-transaction>
      <method>
        <ejb-name>EmployeeEJB</ejb-name>
            <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
    </container-transaction>
</ejb-jar>

jboss.xml
--------------------
<?xml version="1.0"?>
<jboss>
  <enterprise-beans>
    <entity>
          <ejb-name>EmployeeEJB</ejb-name>
          <jndi-name>ejb/mcs/employee</jndi-name>
          <resource-ref>
            <res-ref-name>jdbc/mcs/mcsuser</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <jndi-name>jdbc/mcs/database</jndi-name>
          </resource-ref>
        </entity>
  </enterprise-beans>
</jboss>

jboss.jcml
--------------------
<mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=jdbc/mcs/database">
  <attribute name="PoolName">jdbc/mcs/database</attribute>
  <attribute
name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attr
ibute>
  <attribute name="URL">jdbc:oracle:thin:@xxx.xx.xxx:orcl</attribute>
  <attribute name="JDBCUser">blah</attribute>
  <attribute name="Password">blah</attribute>
  <attribute name="MaxSize">20</attribute>      
  <attribute name="IdleTimeout">300000</attribute>
  <attribute name="IdleTimeoutEnabled">true</attribute>
  <attribute name="GCMinIdleTime">300000</attribute>
  <attribute name="GCEnabled">true</attribute>   
  <attribute name="GCInterval">120000</attribute>
</mbean>

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to