9 Replies Latest reply on Jul 27, 2010 5:50 AM by ciccio1476

    Invalid invocation, check your deployment packaging

    gugrim

      Hi!

      I'm trying to call a local session bean from a JSP page and get the error:

      javax.ejb.EJBException: Invalid invocation, check your deployment packaging

      The JSP is contained in a WAR, the session bean in an EJB JAR, all of it packaged in an EAR.

      The page successfully looks up the home interface but fails when it calls create.

      I have read some articles on the Wiki KB that seems to address this problem but not found any solution that works.

      BTW, the application works fine on Sun AS 8 and WebLogic 9 so I assume it is some configuration problem.

      Hope someone can help me!

      TIA,
      Gunnar Grim

        • 2. Re: Invalid invocation, check your deployment packaging
          gugrim

          Thanks Scott, but I've read that, and the article it refers to, and I don't think it applies to my problem. Only one application is involved and all libraries it uses (except the JRE) are included in the EAR, so I can't see any reason why the page controller in the WAR should be loaded by another classloader than the session bean.

          • 3. Re: Invalid invocation, check your deployment packaging
            starksm64

            Because classes used by the ejbs are duplicately deployed in the war.

            • 4. Re: Invalid invocation, check your deployment packaging
              tnine

              I'm also experiencing this problem, except it is between two EJBs packaged in seperate EARs. One EJB is making a remote call to another. Each ear has its own classloader defined with the Meta-inf/jboss-app.xml with

               <?xml version="1.0" encoding="UTF-8" ?>
              <jboss-app>
              <loader-repository>travelawards.ata.com:loader=travelawards.ear</loader-repository>
              </jboss-app>
              

              for the target EJB

              and

               <?xml version="1.0" encoding="UTF-8" ?>
              <jboss-app>
              <loader-repository>eventgateway.ata.com:loader=eventgateway.ear</loader-repository>
              </jboss-app>
              


              for the caller. Any ideas? We're using Jboss 3.2.6

              • 5. Re: Invalid invocation, check your deployment packaging
                tnine

                Just as a follow up, I may be misunderstanding the classloader issue. My understanding is that you receive this error when the same class has been loaded twice by the same classloader. Since we configure each ear to have its own classloader, then each application should have a contained class of the EJB client classes. Therefore, when loading of the class is finally delegated to a common parent classloader of both ears, the class file should not reside in the common parent only in the ear level classloader. Is this correct?

                • 6. Re: Invalid invocation, check your deployment packaging
                  starksm64

                  Not if a war is configured to use child first class loading and it redundantly (unnecessarily) includes the ejb jars.

                  • 7. Re: Invalid invocation, check your deployment packaging
                    gugrim

                     

                    "scott.stark@jboss.org" wrote:
                    Because classes used by the ejbs are duplicately deployed in the war.


                    Yepp, that was it. Two libraries that were included in the EAR, on the same level as the WAR, were also in the WEB-INF/lib inside the WAR. A relic from the time when the application was just a WAR file. None of the other app servers had any problem with this, which is why I hadn't discovered it before.

                    Thanks,
                    Gunnar


                    • 8. Re: Invalid invocation, check your deployment packaging

                      I have the same problem with my application. I have deployed a war file containing the app and jar file containing the EJBs, im not using ear. both web and EJB include the classes of EJB Client (Interfaces and DTO classes), im trying deleting the classes from web app file and then get other error related with the DTO Linkage Error, the delegate is in the same package of the DTO, and interfaces so that not import the DTO class, i'm think that the linkage error is caused by this issue

                      i'm trying change the Isolate the loader too and in my cases those not correct the error "Invalid Invocatio Packaging"

                      Thanks.

                      • 9. Re: Invalid invocation, check your deployment packaging
                        ciccio1476

                        I think your Ear archive is built with 2 modules: yourWebApp.war + yourEjbClient.jar and the last one is out of your war archive.

                        So, make sure your application.xml (in the META_INF folder of ear archive) is as follows:

                         

                        <application ...>

                        ...
                          <module>
                            <web>
                              <web-uri>yourWebApp.war</web-uri>
                              <context-root>...</context-root>
                            </web>
                          </module>
                          <module>
                              <java>yourEjbClient.jar</java>
                          </module>

                        ...
                        </application>

                         

                        ...and try again...

                         

                        bye, Alessandro