3 Replies Latest reply on Oct 14, 2003 1:37 AM by Bernd Zeitler

    Deploying two EARs in same JBoss instance

    vikash_sharma Newbie

      Hi,
      I have a requirement to deploy two EARs in the same JBoss environment which have some common libraries and one ear can look for ejb deployed in second one. My JBoss is Jboss 3.2.1 tomcat version. If I deploy both of them as it is, then when the lookup happens it gives DuplicateClass exceptions for common library classes because Jboss searches in all ear's libraries.
      I read that if I put a separate loader repository in jboss-app.xml then this can be resolved. I tried that by putting following snippets in my jboss-app.xml for both ears
      <jboss-app>
      <loader-repository>
      utils:service=LoaderRepository
      </loader-repository>
      </jboss-app>

      Now when the first ear's ejb remote is looked up for a home, it returns nullPointerException.

      I am not sure about the syntax for loader repository and what it expects here.

      Please help me in finding the correct way to achieve my deployment model.

      If I remove jboss-app.xml and use one ear at a time it works fine

      Thanking in advance,
      Regards,
      Vikash

      The exception I got:
      23:17:10,539 ERROR [LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHo
      me(StatelessSessionContainer.java:592)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
      keHome(CachedConnectionInterceptor.java:206)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(
      StatelessSessionInstanceInterceptor.java:51)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
      va:74)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      20)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
      actoryFinderInterceptor.java:93)
      at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessS
      essionContainer.java:310)
      at org.jboss.ejb.Container.invoke(Container.java:694)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.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.jav
      a:83)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
      java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
      5)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy46.create(Unknown Source)
      at com.abb.vm.api.HostManager.getHostRemote(HostManager.java:166)