You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Alexey Styrov <Al...@malva.ua> on 2003/09/05 10:49:25 UTC

JNDI, J2EE store and JBOSS

High!
 
I've encountered a strange behaviour of my first slide-powered web
application deployed under JBOSS 3.2.1
My DataSource is described in my-ds.xml, placed to JBOSS depoymnet dir
and it deploys cleanly. The JNDI
name <jndo-name> for it is "my_datasource".
 
The following j2ee store def is placed to Domain.xml:
 
                        <definition>
                                   <store name="j2ee">
                                               <nodestore
classname="slidestore.j2ee.J2EEDescriptorsStore">
                                                           <parameter
name="datasource"> my_datasource</parameter>
                                               </nodestore>
                                               <securitystore>
                                                           <reference
store="nodestore"/>
                                               </securitystore>
                                               <lockstore>
                                                           <reference
store="nodestore"/>
                                               </lockstore>
 
<revisiondescriptorsstore>
                                                           <reference
store="nodestore"/>
 
</revisiondescriptorsstore>
                                               <revisiondescriptorstore>
                                                           <reference
store="nodestore"/>
 
</revisiondescriptorstore>
                                               <contentstore
classname="slidestore.j2ee.J2EEContentStore">
                                                           <parameter
name="datasource"> my_datasource</parameter>
                                               </contentstore>
                                   </store>
                                   <scope match="/" store="j2ee"/>
                        </definition>
The problem I've faced is: this code 
                                   Context initCtx = new
InitialContext();
                                   Context envCtx = (Context)
initCtx.lookup("java:comp/env");
                                    ds = (DataSource)
envCtx.lookup(datasource); 
produces NameNotFoundException, while the code
                                   Context initCtx = new
InitialContext();
                                   ds = (DataSource)
initCtx.lookup("java:/" + datasource);
works just fine. Could someone point me to the problem roots.
 
PS. I tried to put <resource-ref> to web.xml, but got another error:
"couldn't dereference reference".
 
With best regards,
Alexey Styrov, web programmer
Karvali, ltd.