On Mon, 9 Apr 2001, Scott M Stark wrote:

> This jboss.xml is not consistent with the one you previously showed so which
> jboss.xml are you using? The one in this msg looks ok to me. In the previous
> msg you did not have a <resource-managers>..</resource-managers> section
> to map from the java:comp/env/jdbc/JBossDB value to java:/MSQLDB

You are correct..I have spent all day trying to understand why it does not work,
searching the archives and reading whatever docs I can find.
I could just leave it and use java:/MSQLDB in my code, but I don't believe
that is the preferred/correct approach, so I would like to do it right.
The point is that the below code is what I have so far and it still does not
work either.

so there is my jboss.xml (below) and here is my ejb-jar.xml:

<ejb-jar>
  <description>no description</description>
  <display-name>LoginServletJar</display-name>
  <enterprise-beans>
    <entity>
      <display-name>LoginServletBean</display-name>
      <ejb-name>LoginServletBean</ejb-name>
      <home>LoginHome</home>
      <remote>Login</remote>
      <ejb-class>LoginEJB</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Object</prim-key-class>
      <reentrant>False</reentrant>
      <resource-ref>
             <res-ref-name>jdbc/JBossDB</res-ref-name>
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
      </resource-ref>
    </entity>
  </enterprise-beans>

<snip />

</ejb-jar>

************************
and here is my EJB code:
************************

//private String dbName = "java:comp/env/jdbc/JBossDB"; //this does not work
private String dbName = "java:/MSQLDB"; //this works

DataSource ds = (DataSource)ic.lookup(dbName);
con = ds.getConnection();

Any more ideas..??
TIA,
Daren



> > I am still trying to work my way into using JBoss/EJB so forgive me, but could you
> > please explain to me what is screwed up..I have looked thru the archives
> > and searched the mailing list and see many different posts that are not the same.
> > The DTD for jboss.xml may be clear to someone who is experienced, but for a 
>beginner (me)
> > it is not entirely clear.
> > This configuration works except for the jdbc/JBossDb entry...I can only
> > access the DB pool using "java:/MSQLDB"  not "java:comp/env/jdbc/JBossDB".
> >
> > thanks
> > Daren
> >
> > jboss.xml
> > ========
> >
> > <jboss>
> >
> >   <web>
> >     <ejb-ref>
> >      <ejb-ref-name>ejb/MyLoginServlet</ejb-ref-name>
> >      <jndi-name>MyLoginServlet</jndi-name>
> >     </ejb-ref>
> >   </web>
> >
> >   <enterprise-beans>
> >     <ejb>
> >       <ejb-name>LoginServletBean</ejb-name>
> >       <jndi-name>MyLoginServlet</jndi-name>
> >       <resource-ref>
> >         <res-ref-name>jdbc/JBossDB</res-ref-name>
> >         <resource-name>MSQLJDBC</resource-name>
> >       </resource-ref>
> >     </ejb>
> >   </enterprise-beans>
> >
> >   <resource-managers>
> >     <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
> >        <res-name>MSQLJDBC</res-name>
> >        <res-jndi-name>java:/MSQLDB</res-jndi-name>
> >     </resource-manager>
> >   </resource-managers>
> >
> > </jboss>


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

Reply via email to