Hi.

Has anyone of you managed to make Struts and JBoss working together?

This is my current situation: I use JBoss-2.2.2 + Tomcat-3.2.2 (by
run_with_tomcat.bat - so they are running in one VM) and Struts 1.0.


The problem is briefly: When I deploy a .ear-archive that contains a
.war-archive with the classes Struts should use (e.g. the form and
action-classes), it throws an exception:

javax.servlet.jsp.JspException: Exception creating bean of class
<path>/DetailsForm: java.lang.ClassNotFoundException: <path>/DetailsForm
        at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568)

These are the lines of the Struts source-code where the exception is thrown:
   try {
      Class clazz = Class.forName(type);
      bean = clazz.newInstance();
      if (bean instanceof ActionForm)
           ((ActionForm) bean).setServlet(servlet);
   } catch (Exception e) {
      throw new JspException
        (messages.getMessage("formTag.create", type,
             e.toString()));
   }


The reason I blame Struts for that is the following:
When I try to instanciate DetailsForm manually from the .jsp-page there is
absolutely no problem. But Struts seems to use another classpath.


Using the same .jsp-pages/classes/struts-config.xml/web.xml with Tomcat and
J2EE-reference implementation works fine. - So I can say for sure that
struts-config.xml and web.xml okay.


This is the way the .ear-File looks like:

.ear
   META-INF\
      sun-j2ee-ri.xml, Manifest.mf, application.xml
   war-ic.war
        lots of stuff
      WEB-INF\
          web.xml, struts-*.tld, struts-config.xml, global.properties
          classes\
              Resources.properties
              all my classes
   ejb-jar-ic.jar
      the beans (they work fine)


I once tried to add the .class-files manually to the classpath (not the ones
that are created by jboss, when I deploy the .ear, but the .class-files,
that I built before building the .ear-file).

After that Struts was able to find the classes, but my classpath was
completely messed up. The global.properties for example (which is accessible
via InputStream is = getClass().getResourceAsStream("/global.properties")
normally) was not found any more.

Thanks in advance
Dominic

Reply via email to