Re: [JBoss-user] problem deploying struts app as ear
Paval, I've written i simple struts based web application, which calls a session bean deployed at JBoss server and tries to display the result. If I deploy jar with my EJB and war with struts based web application separately, everything works fine. But if I create an ear package and deploy it, JSP pages report java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm You can check it out at http://server.netizen.cz/~koles/work/struts/ Don't you have an idea where is the problem? I found few e-mails reporting similar problems on the web, but no solution. Did you figure this out? I've just updated CVS and found that I now have the same thing with the following project structure: myapplication.ear - myejbs.jar - myclasses - myweb.war - WEB-INF/lib/struts.jar - WEB-INF/classes/myclasses I'd appreciate hearing how you went with it. cheers dim ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] problem deploying struts app as ear
On Mon, 25 Feb 2002, Dmitri Colebatch wrote: Did you figure this out? I've just updated CVS and found that I now have the same thing with the following project structure: myapplication.ear - myejbs.jar - myclasses - myweb.war - WEB-INF/lib/struts.jar - WEB-INF/classes/myclasses I'd appreciate hearing how you went with it. I've figured out that this problem occures if you have some struts related stuff (e.g. your form classes) in myejbs.jar. Pavel ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] problem deploying struts app as ear
Did you figure this out? I've just updated CVS and found that I now have the same thing with the following project structure: myapplication.ear - myejbs.jar - myclasses - myweb.war - WEB-INF/lib/struts.jar - WEB-INF/classes/myclasses I'd appreciate hearing how you went with it. I've figured out that this problem occures if you have some struts related stuff (e.g. your form classes) in myejbs.jar. hmm I didn't think I did... but will check - thanks. cheers dim ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] problem deploying struts app as ear
Which version of JBoss ? Which Servlet Container (Jetty, Tomcat, Catalina)... Anything else you think may be helpful. Jules --- Pavel Kolesnikov [EMAIL PROTECTED] wrote: Hallo, I've written i simple struts based web application, which calls a session bean deployed at JBoss server and tries to display the result. If I deploy jar with my EJB and war with struts based web application separately, everything works fine. But if I create an ear package and deploy it, JSP pages report java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm You can check it out at http://server.netizen.cz/~koles/work/struts/ Don't you have an idea where is the problem? I found few e-mails reporting similar problems on the web, but no solution. Thanks Pavel ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] problem deploying struts app as ear
JBoss 2.4.4 Tomcat 3.2.3. and Struts 1.0.2 Pavel On Wed, 20 Feb 2002, [iso-8859-1] Julian Gosnell wrote: Which version of JBoss ? Which Servlet Container (Jetty, Tomcat, Catalina)... Anything else you think may be helpful. Jules --- Pavel Kolesnikov [EMAIL PROTECTED] wrote: Hallo, I've written i simple struts based web application, which calls a session bean deployed at JBoss server and tries to display the result. If I deploy jar with my EJB and war with struts based web application separately, everything works fine. But if I create an ear package and deploy it, JSP pages report java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm You can check it out at http://server.netizen.cz/~koles/work/struts/ Don't you have an idea where is the problem? I found few e-mails reporting similar problems on the web, but no solution. Thanks Pavel ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] problem deploying struts app as ear
Hi, 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. cheers dim - Original Message - From: Pavel Kolesnikov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 20, 2002 9:15 PM Subject: [JBoss-user] problem deploying struts app as ear Hallo, I've written i simple struts based web application, which calls a session bean deployed at JBoss server and tries to display the result. If I deploy jar with my EJB and war with struts based web application separately, everything works fine. But if I create an ear package and deploy it, JSP pages report java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm You can check it out at http://server.netizen.cz/~koles/work/struts/ Don't you have an idea where is the problem? I found few e-mails reporting similar problems on the web, but no solution. Thanks 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
Re: [JBoss-user] problem deploying struts app as ear
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
Re: [JBoss-user] problem deploying struts app as ear
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-nameTestSession/ejb-name jndi-nametemplation/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-nameejb/TestSession/ejb-ref-name jndi-nametemplatation/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-nameejb/TestSession/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homenet.templation.strutstest.ejb.TestSessionHome/home remotenet.templation.strutstest.ejb.TestSession/remote ejb-linkTestSession/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
Re: [JBoss-user] problem deploying struts app as ear
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-nameTestSession/ejb-name jndi-nametemplation/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-nameejb/TestSession/ejb-ref-name jndi-nametemplatation/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-nameejb/TestSession/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homenet.templation.strutstest.ejb.TestSessionHome/home remotenet.templation.strutstest.ejb.TestSession/remote ejb-linkTestSession/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