0 Replies Latest reply on Apr 25, 2003 10:11 PM by chris humphrey

    ear's and ejb's

    chris humphrey Newbie

      Hi,

      I have been working on porting our infrastructure for our applications from Weblogic over to Jboss and have run into a wall.

      Here is the problem.

      We are deploying several ear files into the same application server, the ear files can contain 0 or more ejb's. The ejb's that are deployed can talk to ejbs' from other ear files. When I deployed the first one of these, I got a ClassCastException from the 'PortableRemoteObject.narrow'.

      When I looked a little closer at the objects, the object returned from the jndi.lookup was loaded from a classloader in the first ear file, but I was running from the ear file in the second ear file.

      One note: We rely heavily on the classloader architecture from Weblogic, where, basically each ear file gets its own classloader. I created the jboss-app.xml file and put that in the ear file to ensure each ear deployed gets their own classloader. I think this is where my problems are.

      I am seeing this behavior on both jboss 3.0.6, and 3.2.0 versions.

      I would like to verify that what I think is going on is in fact the problem, and I am not running into jboss-newbie issues.

      Next, if the problem is as I have explained, is there another way I can ear files to deploy ejb's and talk to each of them and have their own classloaders?

      Some other things I have tried with no success was to attach to the app server from the jnp port (1099), In the above examples I was getting the default context. When I go to 1099 I do get back a class that is valid in the current classloader, but, in 3.0.6 I got the following exception:
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:597)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:206)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:57)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:201)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:62)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      at org.jboss.ejb.plugins.CleanShutdownInterceptor.invokeHome(CleanShutdownInterceptor.java:126)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      at org.jboss.ejb.StatelessSessionContainer.invokeHome(StatelessSessionContainer.java:300)
      at org.jboss.ejb.Container.invoke(Container.java:730)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy35.create(Unknown Source)

      and when I deployed into 3.2 I got this exception:
      java.lang.NullPointerException
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:592)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:206)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:51)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:216)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.CleanShutdownInterceptor.invokeHome(CleanShutdownInterceptor.java:198)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessSessionContainer.java:310)
      at org.jboss.ejb.Container.invoke(Container.java:694)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:88)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:175)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
      at $Proxy48.create(Unknown Source)

      sorry for the long post but I wanted to get all the info in here.

      -chris