3 Replies Latest reply on May 11, 2007 4:53 AM by qjafcunuas

    Lookup SLSB from external war

    qjafcunuas

      Hi,

      I'm using Jboss 4.0.2.

      My application 's fine with default jboss configuration.

      I'm trying to put my application in the all jboss configuration for clustering environment.

      I've got an ear file with ejb and servlet, packaging into jar and war inside the ear. All is ok with this ear : servlets find ejb with local access and can work with it..

      If i tried to lookup (remote) the ejb from an external application on another computer, my application find the ejb and can work with it.

      I've got another war file deployed on the same server as the ear file, in the farm directory too. My jsp files in this war loopkup (remote) the ejb, but throw an exception when ejb create method on EJBHome interface is called : EJBException: Invalid invocation, check your deployment packaging.

      I've made this modification in my ear file for clustering in the jboss.xml :
      true
      <cluster-config>
      <partition-name>DefaultPartition</partition-name>
      <home-load-balance-policy>
      org.jboss.ha.framework.interfaces.RoundRobin
      </home-load-balance-policy>
      <bean-load-balance-policy>
      org.jboss.ha.framework.interfaces.RoundRobin
      </bean-load-balance-policy>
      </cluster-config>
      and the server is started with options : -c all -b 192.168.65.9

      I've tried too this, without success :
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,
      "org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, "localhost:1100");
      return new InitialContext(p);


      Can somebody help me to find why my external war cannot access my ear's ejb on the same farm server ?
      tia.
      Bruno

        • 1. Re: Lookup SLSB from external war
          brian.stansberry

          Post the exception stacktrace.

          • 2. Re: Lookup SLSB from external war
            qjafcunuas

            Hi,
            Here is the exception stacktrace.
            tia


            2007-03-01 18:50:15,949 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException in method: public abstract com.tvnavig.server.domain.ejb.DomainSession com.tvnavig.server.domain.ejb.DomainSessionHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException:
            javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.tvnavig.server.domain.ejb.DomainSession com.tvnavig.server.domain.ejb.DomainSessionHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:161)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:81)
            at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
            at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
            at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
            at org.jboss.ejb.plugins.CleanShutdownInterceptor.invokeHome(CleanShutdownInterceptor.java:198)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
            at org.jboss.ejb.Container.invoke(Container.java:894)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
            at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
            at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
            at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
            at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
            at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
            at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
            at $Proxy220.create(Unknown Source)
            at com.tvnavig.server.domain.DomainBusinessDelegate.create(DomainBusinessDelegate.java:148)

            • 3. Re: Lookup SLSB from external war
              qjafcunuas

              Hi,

              It seems the EJB interfaces are on the classpath twice. So for developing using the EJBs and the War file in the same container, we must remove the interfaces in the War file. This means the War file will use the interfaces from the EJB Jar instead.

              Strange because it works on non-cluster environment !

              Bruno