I didn't see it in your deployment output, but restart your jBoss server 
and take a close look at the name being bound to your Datasource.  I 
found that  java:/ is prepended to the name I specify.  If this is the 
case, in your example the JNDI name that is being bound to your 
datasource might be java:/jdbc/UnitStockingDB instead of 
java:comp/env/UnitStockingDB that you have specified in your code.

By the way, it seems that other EJB servers, e.g. Suns reference 
implementation, are adhearing to the standard of java:comp/ instead of 
java:/, am I correct?

Scot.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 11/18/00, 7:19:45 PM, "Steve Delaney" <[EMAIL PROTECTED]> 
wrote regarding [jBoss-User] NameNotFoundException looking up datasources:


> I have setup a datasource called UnitStockingDB when starting the server 
i
> get

> [UnitStockingDB] Starting
> [UnitStockingDB] XA Connection pool UnitStockingDB bound to
> java:/UnitStockingDB
> [UnitStockingDB] Started

> i deploy my bean with the following in jboss.xml

> <?xml version="1.0" encoding="Cp1252"?>

> <jboss>
>   <secure>false</secure>
>   <container-configurations />
>   <resource-managers>
>  <resource-manager>
>   <res-name>UnitStockingDB</res-name>
>     <res-jndi-name>jdbc/UnitStockingDB</res-jndi-name>
>    </resource-manager>
>   </resource-managers>
>   <enterprise-beans>
>      <entity>
>        <ejb-name>Course</ejb-name>
>        <jndi-name>ejb/Course</jndi-name>
>        <configuration-name></configuration-name>
>      </entity>
>   </enterprise-beans>
> </jboss>

> and get a valid deployment

> [J2EE Deployer] Installing EJB package: Course.jar
> [J2EE Deployer] Starting module Course.jar
> [Container factory]
> Deploying:file:/C:/jboss/bin/../tmp/deploy/Course.jar/ejb1002.jar
> [Container factory] Loading ejb-jar.xml :
> 
jar:file:/C:/jboss/bin/../tmp/deploy/Course.jar/ejb1002.jar!/META-INF/ejb-
ja
> r.xml
> [Container factory] Loading standardjboss.xml :
> file:/C:/jboss/conf/default/standardjboss.xml
> [Container factory]
> 
jar:file:/C:/jboss/bin/../tmp/deploy/Course.jar/ejb1002.jar!/META-INF/jbos
s.
> xml found. Overriding defaults
> [Verifier] Verifying 
file:/C:/jboss/bin/../tmp/deploy/Course.jar/ejb1002.jar
> [Verifier] Course: Verified.
> [Container factory] Deploying Course
> [Container factory] Container Invoker RMI Port='4444'
> [Container factory] Container Invoker Optimize='true'
> [JAWS] Initializing JAWS plugin for Course
> [JAWS] Loading standardjaws.xml :
> file:/C:/jboss/conf/default/standardjaws.xml
> [JAWS]
> 
jar:file:/C:/jboss/bin/../tmp/deploy/Course.jar/ejb1002.jar!/META-INF/jaws
.x
> ml found. Overriding defaults
> [JAWS] Table 'Course' already exists
> [Container factory] Bound Course to ejb/Course
> [Bean Cache] Cache policy scheduler started
> [Container factory] Deployed application: 
file:/C:/jboss/bin/../tmp/deploy/C
> ourse.jar/ejb1002.jar
> [J2EE Deployer] J2EE application: file:/C:/jboss/deploy/Course.jar is
> deployed.


> however when i try to get the datasource

>       DataSource ds = (DataSource)
> ic.lookup("java:comp/env/UnitStockingDB");

> i get a naming exception comp not bound.

> any ideas why ?




> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to