1 2 Previous Next 19 Replies Latest reply on May 18, 2010 6:43 AM by jaikiran pai

    EJB 3.1 @Singleton remote access

    Christian Treptow Newbie

      Hello!

       

      While testing the new @Singleton-Annotation almost completely implemented in JBoss AS 6 M3 i encountered several problems during deploying or getting the right Interface.

       

      My Remote Interface:

       

      @Remote
      @RemoteBinding(jndiBinding=ParameterHolder.JNDI_BINDING)
      public interface ParameterHolder {
      
          public static final String JNDI_BINDING = JNDI_PREFIX + "core/ParameterHolder";
      
          public abstract void reloadAll();
      
          /**
           * Methode für Interceptoren, um bestimmte Parameter
           * nach einem Create / Update / Delete neu zu laden
           * @param oid
           */
          public abstract void reload(Parameter param);
      
          public abstract void unload(Parameter param);
      
          public abstract Parameter get(String name, Company company);
      }

       

      my Local Interface:

       

      @Local
      @LocalBinding(jndiBinding=ParameterHolderLocal.JNDI_BINDING)
      public interface ParameterHolderLocal {
      
          public static final String JNDI_BINDING = ParameterHolder.JNDI_BINDING + JNDI_SUFFIX_LOCAL;
          
          public abstract void reloadAll();
      
          /**
           * Methode für Interceptoren, um bestimmte Parameter
           * nach einem Create / Update / Delete neu zu laden
           * @param oid
           */
          public abstract void reload(Parameter param);
      
          public abstract void unload(Parameter param);
      
          public abstract Parameter get(String name, Company company);
      }
      

       

      my BeanImplementation:

       

      @Singleton
      @Startup
      @DependsOn(ParameterServiceLocal.JNDI_BINDING)
      public class ParameterHolderImpl implements ParameterHolder, ParameterHolderLocal {
          private static Set<Parameter> params = new HashSet<Parameter>();
          
          private Log LOG = LogFactory.getLog(this.getClass());
          
          @EJB(mappedName=ParameterServiceLocal.JNDI_BINDING)
          private ParameterServiceLocal parameterservice;
          
          @PostConstruct
          private void init() {
              params.clear();
              params.addAll(parameterservice.findAll());
          }
          
          @SuppressWarnings("unused")
          @PreDestroy
          private void destroy() {
              params.clear();
          }
          
          @Lock(LockType.WRITE)
          public void reloadAll() {
              init();
          }
          
          /**
           * Methode für Interceptoren, um bestimmte Parameter
           * nach einem Create / Update / Delete neu zu laden
           * @param oid
           */
          @Lock(LockType.WRITE)
          public void reload(Parameter param) {
              if (param == null) {
                  return;
              }
              if (LOG.isTraceEnabled()) {
                  LOG.trace("reload \"" + param.getName() + "\" from Company " + param.getCompany());
              }
              // da es sein kann, dass der Parameter neu erstellt wurde, muss er nochmal nachgeladen werden
              param = parameterservice.findByName(param.getName(), param.getCompany());
              // wenn der param nicht null ist und entweder nicht in der Liste ist (also neu angelegt)
              // oder in der Liste ist und gelöscht werden konnte
              if (param != null && (!params.contains(param) || params.remove(param))) {
                  params.add(param);
              } else {
                  if (LOG.isWarnEnabled()) {
                      LOG.warn("cannot reload Parameter: " + param);
                  }
              }
          }
          
          @Lock(LockType.WRITE)
          public void unload(Parameter param) {
              if (param == null) {
                  return;
              }
              if (LOG.isTraceEnabled()) {
                  LOG.trace("unload \"" + param.getName() + "\" from Company " + param.getCompany());
              }
              params.remove(param);
          }
          
          @Lock(LockType.READ)
          public Parameter get(String name, Company company) {
              Iterator<Parameter> iter = params.iterator();
              while (iter.hasNext()) {
                  Parameter p = iter.next();
                  if (p.getCompany().equals(company) && p.getName().equals(name)) {
                      return p;
                  }
              }
              return null;
          }
      }
      

       

      At my ParameterServiceImpl i added Interceptors to the write / update / delete-Methods to renew these one Parameter in the global Cache (this Singleton)

       

      in my serverlog this line appeared on deploying my app:

       

      2010-05-12 13:12:08,040 WARN  [org.jboss.ejb3.session.SessionContainer] (HDScanner) No JndiSessionRegistrarBase was found; byassing binding of Proxies to jboss.j2ee:service=EJB3,name=ParameterHolderImpl in Global JNDI.
      

      (yes, its byassing instead of bypassing )

       

      in my junittest

       

      public class CoreServicesRemoteTest extends TestCase {
      
          private Context ctx;
          private CompanyService cs;
          private ParameterService ps;
          private ParameterHolder ph;
          
          protected void setUp() throws Exception {
              super.setUp();
              ctx = new JndiConnection().getInitialContext();
              assertNotNull(ctx);
              cs = (CompanyService) ctx.lookup(CompanyService.JNDI_BINDING);
              assertNotNull(cs);
              ps = (ParameterService) ctx.lookup(ParameterService.JNDI_BINDING);
              assertNotNull(ps);
              ph = (ParameterHolder) ctx.lookup(ParameterHolder.JNDI_BINDING);
              assertNotNull(ph);
          }
      
          public void testCompanyCreate() throws Exception {
              Company c = cs.create(1, "my Company");
              assertNotNull(c);
              Parameter p = ps.create("mein Param","Wert", c);
              assertNotNull(ps.find(p.getOid()));
              assertNotNull(ph.get("mein Param", c));
              assertTrue(ps.delete(p));
              assertNull(ph.get("mein param", c));
              assertTrue(cs.delete(c));
          }
      }
      

       

      i get an Communication-Exception at the lookup for Parameterholder:

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb3.singleton.proxy.impl.invocationhandler.SingletonBeanRemoteInvocationHandler (no security manager: RMI class loader disabled)]
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:847)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
          at javax.naming.InitialContext.lookup(Unknown Source)
          at de.neutrasoft.portal.test.CoreServicesRemoteTest.setUp(CoreServicesRemoteTest.java:28)
          at junit.framework.TestCase.runBare(TestCase.java:128)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:120)
          at junit.framework.TestSuite.runTest(TestSuite.java:230)
          at junit.framework.TestSuite.run(TestSuite.java:225)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.singleton.proxy.impl.invocationhandler.SingletonBeanRemoteInvocationHandler (no security manager: RMI class loader disabled)
          at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
          at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
          at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
          at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
          at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
          at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
          at java.io.ObjectInputStream.readClassDesc(Unknown Source)
          at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
          at java.io.ObjectInputStream.readObject0(Unknown Source)
          at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
          at java.io.ObjectInputStream.readSerialData(Unknown Source)
          at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
          at java.io.ObjectInputStream.readObject0(Unknown Source)
          at java.io.ObjectInputStream.readObject(Unknown Source)
          at java.rmi.MarshalledObject.get(Unknown Source)
          at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:771)
          ... 16 more
      

       

      my second try: make ParameterHolder stateless and with static HashMap, but that fails too, i guess because the Bean is destroyed between 1st Instance + Parameter stuffed and first get-Call on the Map.

       

      Whats the Problem here? Any Classes still missing in M3?

       

      regards, Chris

        • 1. Re: EJB 3.1 @Singleton remote access
          jaikiran pai Master
          Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.singleton.proxy.impl.invocationhandler.SingletonBeanRemoteInvocationHandler (no security manager: RMI class loader disabled)

           

          You'll require the jbossall-client.jar (and all the other jars referenced in its META-INF/MANIFEST.MF file) in the client's classpath. These jars should be the same as the ones that are there in the JBOSS_HOME/client folder of JBoss AS 6.0.0.M3

          1 of 1 people found this helpful
          • 2. Re: EJB 3.1 @Singleton remote access
            jaikiran pai Master

            Christian Tre wrote:

             


             

            in my serverlog this line appeared on deploying my app:

             

            2010-05-12 13:12:08,040 WARN  [org.jboss.ejb3.session.SessionContainer] (HDScanner) No JndiSessionRegistrarBase was found; byassing binding of Proxies to jboss.j2ee:service=EJB3,name=ParameterHolderImpl in Global JNDI.
            

            (yes, its byassing instead of bypassing )

            Thanks for reporting that Will be fixed now.

            • 3. Re: EJB 3.1 @Singleton remote access
              Christian Treptow Newbie

              okay, i included all client jars into CP of my junittest, but now i get an error when it tries to get back the Parameter from the singleton

               

              java.lang.RuntimeException: java.lang.ClassNotFoundException: de.xxx.persistence.entity.core.Company (no security manager: RMI class loader disabled)
                  at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:318)
                  at org.jboss.ejb3.singleton.aop.impl.AOPBasedSingletonContainer.dynamicInvoke(AOPBasedSingletonContainer.java:331)
                  at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
                  at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
                  at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
                  at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
                  at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
                  at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
                  at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
                  at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
              Caused by: java.lang.ClassNotFoundException: de.xxx.persistence.entity.core.Company (no security manager: RMI class loader disabled)
                  at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
              

               

              After searching for some Tricks to get it work i tried it with a local policy, but then i get access denied. This Class is in CP of the test (using it in Eclipse). Any Ideas?

              • 4. Re: EJB 3.1 @Singleton remote access
                jaikiran pai Master
                de.xxx.persistence.entity.core.Company

                Which jar contains that class file and how do you add that jar to the classpath of JUnit?

                • 5. Re: EJB 3.1 @Singleton remote access
                  Christian Treptow Newbie

                  the whole project is in default-classpath and i added an external jar (the subpackage from the ear-file containing the entities) explicitly to the cp, both has no influence to the result.

                  • 6. Re: EJB 3.1 @Singleton remote access
                    jaikiran pai Master

                    Someone with IDE experience will have to help you here. Looking at that stacktrace, it appears that the classpath you set isn't containing that class/jar.

                    1 of 1 people found this helpful
                    • 7. Re: EJB 3.1 @Singleton remote access
                      Christian Treptow Newbie

                      okay, i try some other ways

                      the strange thing ist, that this exception appears on the call to the Parameterholder (so the client knows these classes, because the servicecalls before returned these entities.

                       

                      anyway, you said the right answer before, thank you!

                      • 8. Re: EJB 3.1 @Singleton remote access
                        jaikiran pai Master

                        Just to be clear, you solved the issue right? Want to make sure that this is not a genuine bug in EJB3.1 implementation.

                        • 9. Re: EJB 3.1 @Singleton remote access
                          Christian Treptow Newbie

                          the root problem described in the 1st post is solved, it was the import of the client-jars from JBoss.

                          but i dont have a clue about the 2nd problem.

                          imho the situation is the following (i assume):

                          Client knows his Classes (also Entities, because would have crashed earlier).

                          Server knows his classes too (same as above).

                           

                          at the call with the company as argument client tries to marshal company c with classes of JBoss but did not get access via RMI (i dont know WHY the JBoss tries to return a class to the client, because the client have these class and my entity implements Serializable).

                           

                          Full Stacktrace:

                           

                          java.lang.RuntimeException: java.lang.ClassNotFoundException: de.xxx.persistence.entity.core.Company (no security manager: RMI class loader disabled)
                              at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:318)
                              at org.jboss.ejb3.singleton.aop.impl.AOPBasedSingletonContainer.dynamicInvoke(AOPBasedSingletonContainer.java:331)
                              at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
                              at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
                              at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
                              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
                              at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
                              at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
                              at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
                              at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
                          Caused by: java.lang.ClassNotFoundException: de.xxx.persistence.entity.core.Company (no security manager: RMI class loader disabled)
                              at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
                              at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
                              at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
                              at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
                              at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
                              at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
                              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
                              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
                              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
                              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
                              at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
                              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
                              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
                              at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
                              at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:309)
                              at org.jboss.ejb3.singleton.aop.impl.AOPBasedSingletonContainer.dynamicInvoke(AOPBasedSingletonContainer.java:331)
                              at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
                              at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
                              at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
                              at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897)
                              at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768)
                              at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721)
                              at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
                              at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
                              at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:213)
                              at org.jboss.remoting.Client.invoke(Client.java:1927)
                              at org.jboss.remoting.Client.invoke(Client.java:770)
                              at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
                              at $Proxy6.invoke(Unknown Source)
                              at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:188)
                              at $Proxy5.get(Unknown Source)
                              at de.xxx.test.CoreServicesRemoteTest.testCompanyCreate(CoreServicesRemoteTest.java:39)
                              at de.xxx.test.CoreServicesRemoteTest.main(CoreServicesRemoteTest.java:50)
                              at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
                              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
                              at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
                              at $Proxy6.invoke(Unknown Source)
                              at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:188)
                              at $Proxy5.get(Unknown Source)
                              at de.xxx.test.CoreServicesRemoteTest.testCompanyCreate(CoreServicesRemoteTest.java:39)
                              at de.xxx.test.CoreServicesRemoteTest.main(CoreServicesRemoteTest.java:50)
                          
                          • 10. Re: EJB 3.1 @Singleton remote access
                            jaikiran pai Master
                            java.lang.RuntimeException: java.lang.ClassNotFoundException: de.xxx.persistence.entity.core.Company (no security manager: RMI class loader disabled)     at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:318)     at org.jboss.ejb3.singleton.aop.impl.AOPBasedSingletonContainer.dynamicInvoke(AOPBasedSingletonContainer.java:331)     at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)     at

                             

                            Looking at this stacktrace, the ClassNotFoundException is on the server side. So where exactly is the de.xxx.persistence.entity.core.Company class (the jar containing that class) placed on the server? How is your application packaged and deployed on the server (jar/ear)?

                            • 11. Re: EJB 3.1 @Singleton remote access
                              Christian Treptow Newbie

                              The ear is packed as following

                               

                              + META-INF
                              | | ejb-jar.xml
                              | | MANIFEST.MF
                              | log4j.properties
                              | ejb3.jar
                              | + META-INF
                              |   | MANIFEST.MF
                              |   | persistence.xml
                              | + de
                              |   + xxx
                              |   | + business
                              |   |   + service
                              |   |     | BaseEntityService.class
                              |   |     | BaseEntityServiceImpl.class
                              |   |     + core
                              |   |       | CompanyServiceImpl.class
                              |   |       | ParameterHolderImpl.class
                              |   |       | ParameterServiceImpl.class
                              |   |       + interceptor
                              |   |       | | ParameterReloader.class
                              |   |       + interfaces
                              |   |         | CompanyService.class
                              |   |         | CompanyServiceLocal.class
                              |   |         | ParameterHolder.class
                              |   |         | ParameterHolderLocal.class
                              |   |         | ParameterService.class
                              |   |         | ParameterServiceLocal.class
                              |   | + persistence
                              |   |   + entity
                              |   |     | BaseEntity.class
                              |   |     | Entity.class (Interface)
                              |   |     + core
                              |   |       | Company.class
                              |   |       | Parameter.class
                              |   | + utils
                              |   |   | .... unimportant

                               

                              its deployed by just put the ear into deploy-directory

                              • 12. Re: EJB 3.1 @Singleton remote access
                                jaikiran pai Master

                                So you have:

                                 

                                Christian Tre wrote:

                                 

                                The ear is packed as following

                                 

                                + META-INF
                                | | ejb-jar.xml
                                | | MANIFEST.MF

                                .ear/META-INF/ejb-jar.xml? That's not how .ear are packaged. The ejb-jar.xml should reside in the .jar/META-INF folder of the EJB jar (I guess your ejb3.jar). And then the .ear may (optionally) contain a META-INF/application.xml. So the .ear would look something like:

                                 

                                .ear
                                 |
                                 |--- META-INF
                                 |          |
                                 |          |--- application.xml
                                 |     
                                 |--- ejb3.jar
                                 |     |
                                 |     |--- META-INF
                                 |     |          |
                                 |     |          |--- ejb-jar.xml
                                 |     |          |--- persistence.xml
                                 |     |
                                 |     |--- [the classes go here]
                                
                                • 13. Re: EJB 3.1 @Singleton remote access
                                  Christian Treptow Newbie

                                  ouch maybe im too new to this stuff and should read the basics again ^^ thx

                                   

                                  i repacked the ejb-jar.xml (which only contains the display-name)

                                   

                                  and now get Exception when deploying:

                                   

                                  DEPLOYMENTS MISSING DEPENDENCIES:
                                    Deployment "jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3_endpoint" is missing the following dependencies:
                                      Dependency "jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3' **")
                                  
                                  DEPLOYMENTS IN ERROR:
                                    Deployment "jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3' **
                                  

                                   

                                  EDIT: add some more logentries

                                   

                                  2010-05-14 10:54:07,186 DEBUG [org.jboss.ejb3.endpoint.deployers.EJB3EndpointDeployer] (HDScanner) found bean org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData@1bad8655{ParameterHolderImpl}
                                  2010-05-14 10:54:12,780 DEBUG [org.jboss.metadata.validation.validator.ejb.JBossEjb3SessionBeanValidatorBase] (HDScanner) Performing validation on Session EJB:  + ParameterHolderImpl
                                  2010-05-14 10:54:12,780 DEBUG [org.jboss.metadata.ejb.jboss.jndi.resolver.impl.JNDIPolicyBasedSessionBeanJNDINameResolver] (HDScanner) Resolved JNDI Name for Interface de.xxx.business.service.core.interfaces.ParameterHolderLocal of type BUSINESS_LOCAL is portal/ParameterHolderImpl/local-de.xxx.business.service.core.interfaces.ParameterHolderLocal
                                  2010-05-14 10:54:12,780 DEBUG [org.jboss.metadata.ejb.jboss.jndi.resolver.impl.JNDIPolicyBasedSessionBeanJNDINameResolver] (HDScanner) Resolved JNDI Name for Interface de.xxx.business.service.core.interfaces.ParameterHolder of type BUSINESS_REMOTE is portal/ParameterHolderImpl/remote-de.xxx.business.service.core.interfaces.ParameterHolder
                                  2010-05-14 10:54:12,780 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) vfs:///D:/Dev/EDAP/jboss-6.0.0.M3/server/default/deploy/portal.ear endpoint mappings:
                                  + ejb/ejb3.jar#ParameterHolderImpl -> ContainerDependencyMetaData(deploymentPath=ejb3.jar,componentName=ParameterHolderImpl,containerName=portal/core/ParameterHolder,jndiNames=[portal/ParameterHolderImpl/local-de.xxx.business.service.core.interfaces.ParameterHolderLocal, portal/core/ParameterHolderLocal, portal/ParameterHolderImpl/remote-de.xxx.business.service.core.interfaces.ParameterHolder, portal/core/ParameterHolder],jndiAliasDepends=[],targets=[],jndiDepends=[])
                                  2010-05-14 10:54:12,780 DEBUG [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) Processing unit=ejb3.jar, structure:
                                  portal.ear
                                  +ejb3.jar
                                  ++EjbEndpoint:ejbName=CompanyServiceImpl,ejbClass=de.xxx.business.service.core.CompanyServiceImpl,BusinessLocals: [de.xxx.business.service.core.interfaces.CompanyServiceLocal],BusinessRemotes: [de.xxx.business.service.core.interfaces.CompanyService]
                                  ++EjbEndpoint:ejbName=ParameterServiceImpl,ejbClass=de.xxx.business.service.core.ParameterServiceImpl,BusinessLocals: [de.xxx.business.service.core.interfaces.ParameterServiceLocal],BusinessRemotes: [de.xxx.business.service.core.interfaces.ParameterService]
                                  ++EjbEndpoint:ejbName=ParameterHolderImpl,ejbClass=de.xxx.business.service.core.ParameterHolderImpl,BusinessLocals: [de.xxx.business.service.core.interfaces.ParameterHolderLocal],BusinessRemotes: [de.xxx.business.service.core.interfaces.ParameterHolder]+++@EJB(de.xxx.business.service.core.ParameterHolderImpl/parameterservice) -> mappedName=portal/core/ParameterServiceLocal| resolvedJndiName=portal/ParameterServiceImpl/local-de.xxx.business.service.core.interfaces.ParameterServiceLocal
                                  2010-05-14 10:54:12,827 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] (HDScanner) found EJB3: ejbName=ParameterHolderImpl,.xxx.business.service.core.ParameterHolderImpl, type=UNKNOWN (@this is because its a Singleton?)
                                  2010-05-14 10:54:13,030 DEBUG [org.jboss.ejb3.endpoint.deployers.EJB3EndpointDeployer] (HDScanner) found bean org.jboss.metadata.ejb.jboss.JBossSessionBean31MetaData@1bad8655{ParameterHolderImpl}
                                  2010-05-14 10:54:13,030 DEBUG [org.jboss.ejb3.endpoint.deployers.DefaultEJBIdentifier] (HDScanner) Container name generated for ejb = ParameterHolderImpl in unit AbstractVFSDeploymentContext@19086812{vfs:///D:/Dev/EDAP/jboss-6.0.0.M3/server/default/deploy/portal.ear/ejb3.jar/} is jboss.j2ee:service=EJB3,ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl
                                  2010-05-14 10:54:13,030 DEBUG [org.jboss.ejb3.endpoint.deployers.DefaultEJBIdentifier] (HDScanner) Container name generated for ejb = ParameterHolderImpl in unit AbstractVFSDeploymentContext@19086812{vfs:///D:/Dev/EDAP/jboss-6.0.0.M3/server/default/deploy/portal.ear/ejb3.jar/} is jboss.j2ee:service=EJB3,ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl
                                  2010-05-14 10:54:13,030 DEBUG [org.jboss.ejb3.endpoint.deployers.EJB3EndpointDeployer] (HDScanner) Deploy AbstractBeanMetaData@70aaa3{name=jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
                                  2010-05-14 10:54:13,045 DEBUG [org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer] (HDScanner) Creating webservice EJB adapter for: jboss.j2ee:ear=portal.ear,jar=ejb3.jar,name=ParameterHolderImpl,service=EJB3
                                  2010-05-14 10:54:13,733 DEBUG [org.jboss.reloaded.naming.deployers.mc.MCJavaEEComponent] (HDScanner) Installed context org.jnp.interfaces.NamingContext@3b0c37 for JavaEE component ParameterHolderImpl in module ejb3

                                   

                                  EDIT 2: guess its because tje ejb-jar.xml only contains the display-name. If i remove it completely it deploys fine (this xml is optional since EJB 3.0)

                                  But still get the class not found Exception

                                   

                                  EDIT 3:

                                  the Error above is due to not yet implemented @DependsOn-Annotation!

                                  it works with the local Interfaces, tested via MBean, but still get ClassNotFound on remote call.

                                   

                                  btw: if i have a Method annotated with @Interceptors and i call another @Interceptors-annotated Method, the 2nd Interceptor is not invoked - this is designed for avoiding infinite Interceptor-loops or a bug?

                                  • 14. Re: EJB 3.1 @Singleton remote access
                                    jaikiran pai Master

                                    For the ClassNotFoundException, please post the output of:

                                     

                                    jar -tf ejb3.jar
                                    

                                     

                                     

                                    and also

                                     

                                    jar -tf portal.ear
                                    
                                    1 2 Previous Next