1 Reply Latest reply on Jul 27, 2012 4:19 AM by maksrma

    Esb service and EJB3 Action or JBESB-2134 continuation...

    maksrma Newbie

      Hi all

       

      I have big project on ESB, that started sinse ESB 4.2

      Now I migrate project to use ESB 4.10

       

      So, my environment is:

      JBoss 6.1 and ESB 4.10

       

      All works file, but not EJBProcessor EJB3 actions.

       

      My service file structure:

       

      myservice.esb

      -- META-INF

           -- jboss-esb.xml

           -- deployment.xml -- I am trying with dependency <depends>jboss.j2ee:module=upbsservice.jar,name=UpbsServiceBean,service=EJB3</depends> and without it (result same...)

      -- ejb3-files.jar --- contains EJB3 Stateless Bean for action

       

      I found JIRA

      With last comment in 2008: Mea culpa. I was not aware of the possibility of such a dependency specification.  And task was closed. (I think it's wonderfull reaction on highest bug, as for me )

       

      My  jboss-esb.xml has action:

      ....

      <action name="ejb-action" class="org.jboss.soa.esb.actions.EJBProcessor">

      .... ejb3 = true, method, jndi-name.... same as in documentation.

       

      And exception with dependency:

      DEPLOYMENTS IN ERROR:
        Deployment "<UNKNOWN jboss.esb.vfs:///D:/jboss-6.1.0.Final/server/my-conf
      /deploy/myproject/myservice.esb>" is in error due to the following reason(s): ** UNRESOL
      VED Demands 'jboss.j2ee:module=ejb3-files.jar,name=MyEJBBean,service=EJB3
      ' **

      And exception without dependency in deployment.xml:

       

      ...

      Caused by: org.jboss.soa.esb.actions.ActionLifecycleException: Could not lookup MyEJBBean/remote...

      After jndi tree after server start I can see my been. It was initialized after EJBProcessor asking for it.

      Have anybody ideas how to possible use .esb service with EJB3 action inside esb file?

        • 1. Re: Esb service and EJB3 Action or JBESB-2134 continuation...
          maksrma Newbie

          I fix it with creating custom EJBProcessor.

          ESB action in jboss-esb.xml looks like:

           

          <action name="ejb-action" class="com.mypackage.CustomEJBProcessor">

           

          CustomEJBProcessor is:

           

          package com.mypackage;

           

          import org.jboss.soa.esb.ConfigurationException;
          import org.jboss.soa.esb.actions.ActionLifecycleException;
          import org.jboss.soa.esb.actions.ActionProcessingException;
          import org.jboss.soa.esb.helpers.ConfigTree;
          import org.jboss.soa.esb.message.Message;


          public class CustomEJBProcessor extends org.jboss.soa.esb.actions.EJBProcessor{

          private boolean isInited = false;

          public CustomEJBProcessor(ConfigTree config) {
            super(config);
          }

           

           

          @Override
          public void destroy() {
            super.destroy();
          }

          @Override
          public void initialise() throws ActionLifecycleException {
            //super.initialise(); --- IT'S  PROBLEM METHOD! It called when esb resvice deployes by HDScaner BUT EJB3 Bean haven't deployed yet.
            System.out.println("watsuppppp fuck!!!");
          }

          @Override
          public Message process(Message arg0) throws ActionProcessingException, ConfigurationException {
            if(!isInited){
             try {
              super.initialise(); //Call once in first call of service! EJB is alreary deployed!
              isInited = true;
             } catch (ActionLifecycleException e) {

               //Probably need add some processing... but in practice I didn't catch any error here
              e.printStackTrace();
             }
            }
            return super.process(arg0);
          }
          }

           

          AND don't forget include:

          <jboss-6.1_home>/server/<your_conf>/deploy/slsb.esb/jbossesb-slsb.jar to your application classpath.

           

          Good luck!

          1 of 1 people found this helpful