3 Replies Latest reply on Jul 27, 2009 11:27 AM by peterj

    JBoss 5.1 j2ee client jars and classloader

      Hi, guys!

      The thing is that with my app i cannot rely on EJB3 client container because of two issues:

      1. AFAIK, the @EJB annotation fails to inject EJB proxies into dynamic context. It works only with static one(@EJB private static MyServiceBean ...).
      2. The container is too-much-clever for my app, since the app should connect to server not before but after it is started, UI is shown and user made choice which server to connect to.

      I have a j2ee standalone client, developed under JBoss 5.0.1. It was successfully used without any client containers (through SecurityClientFactory.getSecurityClient().login(), InitialContext().lookup(...), etc).

      When migrated from Jboss 5.0.1 to 5.1.0 i've discovered, that now the client, even re-compiled against v5.1.0, fails to start with the same set of jars(taken from 5.1.0, of course) with meaningless error "ClassCastException: javax.naming.Reference cannot be cast to cool.ib.service.UserService".
      But the client starts successfully when i include the whole set of server jars into it's classpath. It seems, some more jars need to be added into classpath.

      So, the question is: what are the jars i need to include into the JBoss 5.1 j2ee client classpath to start it without using the EJB3 client container?

      Or even better... as i understand, EJB3 client container loads client app and all the required classes directly from server. So, how to utilize the JBoss client classloader(which provides server classes to the client container) in my app?

      Thanks!

        • 1. Re: JBoss 5.1 j2ee client jars and classloader

          Oh, the main thing. Search says:

          "Cannot invoke the operation : the module threw an exception"

          :D

          • 2. Re: JBoss 5.1 j2ee client jars and classloader
            jaikiran

             

            "ms-suxx" wrote:
            Oh, the main thing. Search says:

            "Cannot invoke the operation : the module threw an exception"

            :D


            Yeah, that's annoying. From what i know, someone is trying to fix it.

            • 3. Re: JBoss 5.1 j2ee client jars and classloader
              peterj

              My simple client that accesses a simple EJB3 app includes client/jbossall-client.jar and client/log4j.jar. Of course, the manifest in jbossall-client.jar includes almost all of the JARs in the client directory. (If you were coming from 4.x I would point out that jbossall-client.jar doesn't include anything, and that you need the entire client directory for use with your client app, but you are coming from 5.0.1, so you should already know that. But it sure does sound as if you didn't provide the entire client directory to your app...)