Hello everybody. Thank you for reading my thing. I believe the classpath is ok because I check individual ejbs by deploying them standalone in war and they seem to work ok.
I think the ear deployment is ok because the war containing the webapp does it's thing and deploys into appropriate file directories (just like a standalone war)...and all the jsps and javabeans are working ok. I also don't get errors on the server console...it sez "EnterpriseApplication[nctims] starting". I have a feeling the disconnect is due to either the individual ejb deployment descriptors or perhaps the web.xml in the webapp...cuz I'm not exactly sure where the jndi connection between the webapp and the ejb jars lies. Anyways, it's probably best to give a very brief summary of my descriptors and junk, focusing on "bridging" the javabean in the webapp to the facade ejb, whcih is inside it's own jar...
1. After deploying, the war containing the webapp, as I said, unbundles and the server puts jsp and javabeans into the appropriate directories within the indicated context root under the webapps directory. Here is the web.xml...
<web-app xmlns="http://caucho.com/ns/resin">
<session-config>
<session-timeout>120</session-timeout>
</session-config>
</web-app>
The calling javabean is located in com/cn directory within the web app, and it's package is com.cn.
2. The jar (cnf.jar) containing the session facade ejb (CnFacade) is located in the root directory of the enterprise bean. This jar contains three classes...CnFacade, CnFacadeHome, CnFacadeBean. All three classes have package com.cn indicated. This is the desployment descriptor for this ejb...
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>CnFacade</ejb-name>
<jndi-name>CnFacade</jndi-name>
<local-home>com.cn.CnFacadeHome</local-home>
<local>com.cn.CnFacade</local>
<ejb-class>com.cn.CnFacadeBean</ejb-class>
<session-type>Stateless</session-type>
</session>
</enterprise-beans>
</ejb-jar>
3. As I said, the jar (cnf.jar), in 2 above, containing the CnFacade ejb is in the root of the enterprise app, and this is the application.xml...
<application>
<display-name>NCTIMS</display-name>
<module>
<ejb>cnf.jar</ejb>
</module>
<module>
<web>
<web-uri>nctims.war</web-uri>
<context-root>/nctims</context-root>
</web>
</module>
</application>
4. When I deployed the ear, the server wanted the ejb server and database jndi stuff in it's configuration file. When I was
testing ejb in individual wars, this stuff was in the web.xml of the war. Here is the ejb server tag in the server config file...
<ear-deploy path='deploy'>
<ear-default>
<ejb-server>
<config-directory>WEB-INF</config-directory>
<jndi-name>
java:comp/env/cmp</jndi-name>
<data-source>java:comp/env/jdbc/test</data-source>
</ejb-server>
</ear-default>
</ear-deploy>
5. As was stated at the start of the
thread, this is the calling javabean that is trying to create a jndi reference to CnFacade...and I am printing Object is null...
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
Object obj = ctx.lookup("java:comp/env/cmp/CnFacade");
if (obj == null) {
System.out.println ("Object is null");
}
In summary, my suspicions lie in three places...
a. How does the webapp (deployed in 1 above) use jndi to bridge to the ejb stored in the root in a jar (cnf.jar)? Is there supposed to be something in the web.xml of the web app to indicate jndi info? Like I said, when I deployed the ear, it wanted that info in the config file for the server, so I figured that would cover it.
b. Do the ejb jars have to be put into a com/cn directory somewhere within the enterprise app as opposed to the root?...since they are all in com.cn package.
c. This line within the ejb server tag in the server config file...
<config-directory>WEB-INF</config-directory>
I don't know about this one since all the ejb jars are in the root of the ear, not within Web-inf.
I hope that this isn't too confusing...I really appreciate any help. What concerns me with tinkering with this stuff is stepping the wrong way and getting deeper into a quagmire (like being lost in a forest) since there are so many parts to the ear. Forgetting to reset something as I attempt the next experiment, etc. It could also be a combination of two factors. Thank you so much again.
[ April 19, 2005: Message edited by: Tom Griffith ]