What I would do is just create a test Servlet with teh code in your setup method and put the Home, Remote classses in the Servlet Classpath and try running that Servlet. If that works, it shud work in setup() too.
BTW, did u check ur weblogic console to see if the JNDI name is registered for ur EJB? Cheers Raj --- [EMAIL PROTECTED] wrote: > 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. > > > > > === message truncated === __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
