You may try to package as a EAR file (or expanded EAR file) to avoid class
path issue. The web application classloader is the child of the EJB class
loader once packaged as EAR so you don't have to include EJB client stubs
in your web application classpath.
Andy
The directory structure should be something like this:
myapp/META-INF/application.xml
myapp/myejb.jar
myapp/webapp/WEB-INF/classes/your web classes
myapp/webapp/WEB-INF/lib any jar library files for your web application
myapp/webapp/WEB-INF/weblogic.xml
myapp/webapp/WEB-INF/web.xml
or (you can even expand your EJB jar file)
myapp/META-INF/application.xml
myapp/myejb/META-INF/ejb-jar.xml
myapp/myejb/META-INF/weblogic-ejb-jar.xml
myapp/myejb/...*.class etc.
myapp/webapp/WEB-INF/classes/your web classes
myapp/webapp/WEB-INF/lib any jar library files for your web application
myapp/webapp/WEB-INF/weblogic.xml
myapp/webapp/WEB-INF/web.xml
application.xml should be something like:
<application>
<module>
<ejb>myejb.jar</ejb>
</module>
<module>
<web>
<web-uri>webapp</web-uri>
<context-root>webapp</context-root>
</web>
</module>
<application>
laurent.duperv
[EMAIL PROTECTED] To: Cactus Mailing List
<[EMAIL PROTECTED]>
05/02/02 11:08 cc:
AM Subject: Is there a WebLogic guru in the
house?
Please respond
to "Cactus
Users List"
Hi,
I'm having a hell of a time trying to get my head around the WebApp
configuration to get EJB tests to work correctly. I think my main problem
is
that I don't understand the relationship between the weblogic.xml file and
the EJB. So here's my setup. If someone can pinpoint my problem, I'd be so
ever thankful!
META-INF/
META-INF/MANIFEST.MF
META-INF/weblogic-ejb-jar.xml <I'm not sure I need this>
META-INF/ejb-jar.xml <If I include this I get a NPE when starting WL>
WEB-INF/
WEB-INF/classes/<contains all my classes including the
junit/home/remote/bean class>
WEB-INF/lib/
WEB-INF/lib/aspectjrt.jar
WEB-INF/lib/cactus-ant.jar
WEB-INF/lib/cactus.jar
WEB-INF/lib/crimson.jar
WEB-INF/lib/httpunit.jar
WEB-INF/lib/junit.jar
WEB-INF/lib/log4j.jar
WEB-INF/lib/mockobjects-core.jar
WEB-INF/lib/mockobjects-doc.jar
WEB-INF/lib/mockobjects-j2ee1.3.jar
WEB-INF/lib/mockobjects-jdk1.3.jar
WEB-INF/lib/xalan.jar
WEB-INF/lib/<some other jars specific to our project>
WEB-INF/weblogic.xml
WEB-INF/web.xml
in my web.xml I have the following:
<web-app>
<display-name>
handler
</display-name>
<description>
bla bla bla
</description>
<!-- Cactus configuration
Note: Do not place any XML comments in this Cactus configuration section
(Ant's filtered copy is used to activate this configuration when the test
web application is built)
-->
<!-- Begin Cactus Configuration -->
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<ejb-ref>
<ejb-ref-name>create_subscriber_profile</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<!-- these two classes are in the classes directory -->
<home>ca.masq.fido.handler.HandlerHome</home>
<remote>ca.masq.fido.handler.Handler</remote>
</ejb-ref>
<!-- End Cactus Configuration -->
</web-app>
In my weblogic.xml I have:
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web
Application 6.0//EN"
"http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd">
<weblogic-web-app>
<description>
Web app to test cactus
</description>
<weblogic-version/>
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>create_subscriber_profile</ejb-ref-name>
<jndi-name>create_subscriber_profile</jndi-name>
</ejb-reference-description>
</reference-descriptor>
</weblogic-web-app>
In my ejb-jar.xml file, I have the following. If I put this in my META-INF
directory, I get a
null pointer exception.
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<!-- CreateSubscriberHandler -->
<session>
<ejb-name>createSubscriberHandler</ejb-name>
<home>ca.masq.fido.handler.HandlerHome</home>
<remote>ca.masq.fido.handler.Handler</remote>
<ejb-class>ca.masq.fido.handler.registration.CreateSubscriberHandlerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>EndUserManager Jndi Name</description>
<env-entry-name>END_USER_MANAGER_JNDI_NAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>endusermanager.EndUserManagerHome</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>createSubscriberHandler</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
in my weblogic-ejb-jar file, I have this:
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0
EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>createSubscriberHandler</ejb-name>
<caching-descriptor>
<max-beans-in-cache>10</max-beans-in-cache>
</caching-descriptor>
<jndi-name>create_subscriber_profile</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
ant in my setUp() I have:
context = new InitialContext();
home = (HandlerHome) EjbUtil.lookupHome(Handler.class,
"create_subscriber_profile", context);
which throws a NamingException.
Does anyone know what part of my setup is messed up?
Thanks,
L
--
Laurent Duperval <mailto:[EMAIL PROTECTED]>
BOWIE'S THEOREM
If an experiment works, you must be using the wrong equipment.
--
To unsubscribe, e-mail: <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>