2 Replies Latest reply on Sep 23, 2002 5:30 AM by po1089

    Jboss with struts 1.1 and ejb?

    po1089


      Hi everybody,

      I am currently working on a small project which uses a WAR to present some jsp pages built with the struts (1.1-b2) framework. It works like a charm _until_ I use a simple session bean as a backend to do some processing.

      I have created an ejb-jar that contains this session bean. For now, I have chosen not to package the lot as a single EAR file.

      The contents of the WAR and JAR file are:
      WAR: jsp's, struts jars, web classes, ejb classes
      JAR: web classes, ejb classes

      Now the following problem occurs: When i deploy the WAR, everything is OK. When i then deploy the ejb, the WAR no longer works (it issues an exception on that the org.apache.struts.action.Action class is not defined).

      When i undeploy the ejb-jar, the web app works okay again.

      The other way around: when i first deploy the ejb, all is ok. Then with the war file it issues an exception on the org.apache.action.ActionServlet being not defined).

      Again: when i only deploy the WAR (without actually accessing the EJB yet!) all works OK...

      (it's sooo depressing....)

      Would it be a good idea to add the struts framework jar's to the jboss-lib directory?

      Anyone?

      Chris Polderman


        • 1. Re: Jboss with struts 1.1 and ejb?
          joelvogt

          this error is because you have the web classes in your jar as well. (should only have them in war).
          What you might want to do is have it the other way around which is for example an ejb-client.jar which just has your home interface of your session bean so your web side can make a reference and call your bean.
          You will need this in the classpath of your war manifest. Then your struts action, for example can look it up and you will have your link to your model.

          • 2. Re: Jboss with struts 1.1 and ejb?
            po1089


            Thanks for the quick reply!

            I will try this and let you know. It sounds logical to me anyway.

            Chris