0 Replies Latest reply on Nov 25, 2012 3:32 PM by Hai Nguyen

    config file *-service.xml  in jms message driven bean ejb 3.0

    Hai Nguyen Newbie

      Hi  everyboy!

      Im a new bie in ejb3.0 i get difficult with  config file *-service.xml  in jms message driven bean ejb 3.0

      how to config  To lookup JNDI in *-service.xml  for QueueConnectionFactory in EJB3.0.

      I need a  clearly example to understand it!  it is truly to thank you for any help!

      ---

      This is error , What reasons jndi is null> can you give a reason . thank you much!

      Status when deploy message driven bean


      01:21:28,396 INFO  [EJBContainer] STOPPED EJB: mdb.SendMailMDB ejbName: SendMailMDB

      01:21:28,485 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1604576652{vfszip:/D:/devtool/jboss-5.0.1.GA/server/default/deploy/g3_DVDShop_MDB_Module.jar/}

      01:21:28,485 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1604576652{vfszip:/D:/devtool/jboss-5.0.1.GA/server/default/deploy/g3_DVDShop_MDB_Module.jar/}

      01:21:28,485 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1604576652{vfszip:/D:/devtool/jboss-5.0.1.GA/server/default/deploy/g3_DVDShop_MDB_Module.jar/}

      01:21:28,485 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1604576652{vfszip:/D:/devtool/jboss-5.0.1.GA/server/default/deploy/g3_DVDShop_MDB_Module.jar/}

      01:21:28,510 INFO  [JBossASKernel] Created KernelDeployment for: g3_DVDShop_MDB_Module.jar

      01:21:28,510 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=g3_DVDShop_MDB_Module.jar,name=SendMailMDB,service=EJB3

      01:21:28,510 INFO  [JBossASKernel]   with dependencies:

      01:21:28,510 INFO  [JBossASKernel]   and demands:

      01:21:28,510 INFO  [JBossASKernel]         jboss.ejb:service=EJBTimerService

      01:21:28,510 INFO  [JBossASKernel]   and supplies:

      01:21:28,510 INFO  [JBossASKernel]         jndi:null

      01:21:28,510 INFO  [JBossASKernel]         Class:javax.jms.MessageListener

      01:21:28,510 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=g3_DVDShop_MDB_Module.jar,name=SendMailMDB,service=EJB3) to KernelDeployment of: g3_DVDShop_MDB_Module.jar

      01:21:28,533 INFO  [EJBContainer] STARTED EJB: mdb.SendMailMDB ejbName: SendMailMDB

       

      ----

      when i deloy and run Web application

      jboss raise error at line code

         factory = (QueueConnectionFactory) jndiContext.lookup("dvdshop_jms_conectionfactory");

       

      Contetn of error

      at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:68)

              at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:58)

              at org.jboss.aop.classpool.AOPClassPoolFactory.create(AOPClassPoolFactory.java:40)

              at javassist.scopedpool.ScopedClassPoolRepositoryImpl.createScopedClassPool(ScopedClassPoolRepositoryImpl.java:99)

              at javassist.scopedpool.ScopedClassPoolRepositoryImpl.registerClassLoader(ScopedClassPoolRepositoryImpl.java:125)

              at org.jboss.aop.classpool.AOPClassPoolRepository.registerClassLoader(AOPClassPoolRepository.java:157)

              at org.jboss.aop.AspectManager.registerClassLoader(AspectManager.java:845)

              at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:273)

              at org.jboss.aop.AspectManager.initialiseClassAdvisor(AspectManager.java:751)

              at org.jboss.aop.AspectManager.getAdvisor(AspectManager.java:732)

              at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.<clinit>(ClientConnectionFactoryDelegate.java)

              at sun.misc.Unsafe.ensureClassInitialized(Native Method)

              at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)

              at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140)

              at java.lang.reflect.Field.acquireFieldAccessor(Field.java:949)

              at java.lang.reflect.Field.getFieldAccessor(Field.java:930)

              at java.lang.reflect.Field.getLong(Field.java:548)

              at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1643)

              at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:69)

              at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:467)

              at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:455)

              at java.security.AccessController.doPrivileged(Native Method)

              at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:455)

              at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:352)

              at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:589)

              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)

              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)

              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)

              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)

              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1964)

              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1888)

              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)

              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)

              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)

              at java.rmi.MarshalledObject.get(MarshalledObject.java:159)

              at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:765)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)

              at javax.naming.InitialContext.lookup(InitialContext.java:411)

              at utility.SendMailUility.SenMail(SendMailUility.java:60)

              at action.RegisterProccessAction.execute(RegisterProccessAction.java:89)

              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)

              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)

              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

              at java.lang.Thread.run(Thread.java:722)

       

      ==========

      I think  i dont  config correctly file *-service.xml in  default/deploy

      dvdshop-jms-connection-factories-service.xml

      <?xml version="1.0" encoding="UTF-8"?>

       

       

      <server>

                <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"

            name="jboss.messaging.connectionfactory:service=dvdshop_jms_conectionfactory"

            xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">

                          <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

                          <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>

                          <depends>jboss.messaging:service=PostOffice</depends>

                          <attribute name="SupportsFailover">false</attribute>

                          <attribute name="SupportsLoadBalancing">false</attribute>

                          <attribute name="JNDIBindings">

                                    <bindings>

                                              <binding>dvdshop_jms_conectionfactory</binding>

                                    </bindings>

                          </attribute>

                </mbean>

      </server>

       

       

       

       

      i am headaching  about this error , please help me , thank you much!