David,
I appreciate your exhaustive and helpful answer very much. I promise to read the specs before sending another silly question to the list :-) Pavel On Wed, 20 Feb 2002, David Ward wrote: > Pavel, > > You've got way to much stuff in both the .war and .jar you have in your > .ear. You don't need to include all those jars in your war lib since > they're already in jboss' classpath. You also don't need any web > classes in your ejb tier, and you only need the home and remote > interface of your EJB in the web tier - NOT the bean impl itself. > > Look what I found in there (pulled out of the .ear file you had on your > website): > > strutstest.jar - WRONG (too much) > --------------------------------- > META-INF/ejb-jar.xml > net/templation/strutstest/ejb/TestSessionEJB.class > net/templation/strutstest/ejb/TestSessionHome.class > net/templation/strutstest/ejb/TestSession.class > net/templation/strutstest/web/TestForm.class > net/templation/strutstest/web/EJBManagerServlet.class > net/templation/strutstest/web/TextBean.class > net/templation/strutstest/web/TestAction.class > > strutstest.war - WRONG (WAY too much) > ------------------------------------- > WEB-INF/tlds/struts-bean.tld > WEB-INF/tlds/struts-form.tld > WEB-INF/tlds/struts-html.tld > WEB-INF/tlds/struts-logic.tld > WEB-INF/tlds/struts-template.tld > WEB-INF/tlds/struts.tld > WEB-INF/struts-config.xml > WEB-INF/web.xml > WEB-INF/classes/ApplicationResources.properties > WEB-INF/lib/admin/lib/jpl-util-0_6b.jar > WEB-INF/lib/admin/lib/jboss-util.jar > WEB-INF/lib/admin/monitor.jar > WEB-INF/lib/admin/jndi.properties > WEB-INF/lib/connector.jar > WEB-INF/lib/jbossmq-client.jar > WEB-INF/lib/jboss-client.jar > WEB-INF/lib/stop.jar > WEB-INF/lib/jbosssx-client.jar > WEB-INF/lib/auth.conf > WEB-INF/lib/jnp-client.jar > WEB-INF/lib/TestBeanClient.jar > WEB-INF/lib/deploy.jar > WEB-INF/lib/struts.jar > WEB-INF/lib/jaas.jar > WEB-INF/lib/jboss-j2ee.jar > WEB-INF/lib/log4j.jar > WEB-INF/lib/oswego-concurrent.jar > WEB-INF/lib/jndi.jar > WEB-INF/lib/strutstest.jar > test.jsp > test_ok.jsp > > > ** These lists are all that you should have in the respective archives: > > strutstest.jar - CORRECT (should be) > --------------------------------- > META-INF/ejb-jar.xml > META-INF/jboss.xml > net/templation/strutstest/ejb/TestSessionEJB.class > net/templation/strutstest/ejb/TestSessionHome.class > net/templation/strutstest/ejb/TestSession.class > > strutstest.war - CORRECT (should be) > ------------------------------------ > WEB-INF/tlds/struts-bean.tld > WEB-INF/tlds/struts-form.tld > WEB-INF/tlds/struts-html.tld > WEB-INF/tlds/struts-logic.tld > WEB-INF/tlds/struts-template.tld > WEB-INF/tlds/struts.tld > WEB-INF/struts-config.xml > WEB-INF/web.xml > WEB-INF/jboss-web.xml > WEB-INF/lib/struts.jar > WEB-INF/classes/ApplicationResources.properties > WEB-INF/classes/net/templation/strutstest/ejb/TestSessionHome.class > WEB-INF/classes/net/templation/strutstest/ejb/TestSession.class > WEB-INF/classes/net/templation/strutstest/web/TestForm.class > WEB-INF/classes/net/templation/strutstest/web/EJBManagerServlet.class > WEB-INF/classes/net/templation/strutstest/web/TextBean.class > WEB-INF/classes/net/templation/strutstest/web/TestAction.class > test.jsp > test_ok.jsp > > Notice how I added a jboss.xml to your ejb-jar file and a jboss-web.xml > in your war file. Those allow you to map the (btw, MISSING) ejb-ref > block in your web.xml file to the global deployment names in your (btw, > MISSING) jboss.xml file so you can use the java:comp/env namespace I see > coded in your servlet. You will not need to have a jndi.properties file > anywhere in your archives. > > You should have a jboss.xml with this block in it: > <jboss> > <enterprise-beans> > <session> > <ejb-name>TestSession</ejb-name> > <jndi-name>templation/TestSession</jndi-name> > </session> > </enterprise-beans> > </jboss> > > You should have a jboss-web.xml with this block in it: > <jboss-web> > <ejb-ref> > <ejb-ref-name>ejb/TestSession</ejb-ref-name> > <jndi-name>templatation/TestSession</jndi-name> > </ejb-ref> > </jboss-web> > > Last but not least, you should have a block like this in your web.xml: > <ejb-ref> > <ejb-ref-name>ejb/TestSession</ejb-ref-name> > <ejb-ref-type>Session</ejb-ref-type> > <home>net.templation.strutstest.ejb.TestSessionHome</home> > <remote>net.templation.strutstest.ejb.TestSession</remote> > <ejb-link>TestSession</ejb-link> > </ejb-ref> > > If you want to know the siginificance of any of those tag elements, I > suggest you read the specs. Trust me; it's worth it. > > In your servlet you do a lookup of "java:comp/env/testSession". If you > wanted to, you could move the jndi name to an init parameter in your > web.xml so you have no jndi paths hardcoded anywhere in your java code. > > Also, I just noticed that you specified "testSession" with a lower case > "t" - my xml config examples use a capital "T" - just my convention. > Just make sure they match up. > > BTW, my theory of your NoClassDefFoundError is that JBoss might have > gotten its ClassLoaders confused when finding it's core extension jars > in your application. > > Hope all this helps, > David > > -- > > Pavel Kolesnikov wrote: > > On Wed, 20 Feb 2002, Dmitri Colebatch wrote: > > > > > >>where is the struts.jar? This error is the classical error that comes up > >>when the struts classes are loaded by a different classloader than the > >>action classes. put struts.jar in WEB-INF/lib inside the .war and you > >>shouldn't have any problems. > >> > > > > Yes, struts.jar is in WEB-INF/lib. > > > > BTW I guess if it wasn't there I wouldn't be able to run neither > > strutstest.war standalone. And strutstest.WAR itself works well, > > the problem occurs only if I deploy it together with ejb classes > > in one EAR package. > > > > Pavel > > > > > > > > > > _______________________________________________ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user