10 Replies Latest reply on Jan 29, 2009 6:46 PM by rudreshtcs

    Ejb3 - MDB

      Hi,

      I was trying one of the Interceptors example given below
      http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/interceptor/

      I had deployed the application on - jboss-5.0.0.GA

      I am getting below errors and application is not getting deployed, i had even tried with simple MDB, even that is not working

      Added bean(jboss.j2ee:jar=InterceptorTest.jar,name=EmailSystemBean,service=EJB3) to KernelDeployment of: InterceptorTest.jar
      17:50:29,983 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.interceptor.bean.AccountsMDB ejbName: AccountsMDB
      17:50:29,999 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@5bce28(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@e8d651 destination=queue/tutorial/accounts destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
      javax.naming.NameNotFoundException: queue not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:396)

      Kindly Help me on solving the above error

      Thanks

        • 1. Re: Ejb3 - MDB
          jaikiran

           

          I was trying one of the Interceptors example given below
          http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/interceptor/


          Good to know someone has already started using the tutorials which we are going to publish soon.

          Added bean(jboss.j2ee:jar=InterceptorTest.jar,name=EmailSystemBean,service=EJB3) to KernelDeployment of: InterceptorTest.jar


          How are you building and deploying it? The build process of the tutorial does not create a jar named InterceptorTest.jar, so i guess you have your own build scripts doing this? For building and running those tutorials, we are going to publish a guide, but in the meantime you can follow this wiki http://jboss.org/community/docs/DOC-13215



          • 2. Re: Ejb3 - MDB

            Hi,

            I had build it using the Eclipse IDE, usually i do it with that (export as EJB project)

            This time i used the build scripts as given in the tutor. the errors are same

            Class:org.jboss.tutorial.interceptor.bean.EmailSystem
            17:53:08,784 INFO [JBossASKernel] jndi:EmailSystemBean/remote-org.jboss.tutorial.interceptor.bean.EmailSystem
            17:53:08,784 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailSystemBean,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-interceptor.jar
            17:53:08,941 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.interceptor.bean.AccountsMDB ejbName: AccountsMDB
            17:53:09,050 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@35025a(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@d7244e destination=queue/tutorial/accounts destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
            javax.naming.NameNotFoundException: queue not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

            STARTED EJB: org.jboss.tutorial.interceptor.bean.EmailMDB ejbName: EmailMDB
            17:53:09,316 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1e1401(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@d7244e destination=queue/tutorial/email destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
            javax.naming.NameNotFoundException: queue not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

            Thanks

            • 3. Re: Ejb3 - MDB
              wolfgangknauf

              Hi,

              does your EJB jar contain the file "queue-example-service.xml" (or similar) from the linked sample (in the "top level" of the JAR file)?
              This file declares the queue, and I think that on deploy the MDB cannot be bound to this queue, because it was not created by the server.

              Hope this helps

              Wolfgang

              • 4. Re: Ejb3 - MDB
                jaikiran

                Rudresh,

                Wolfgang is correct. You seem to be missing the queue-example-service.xml. Here's a part of the build script which does the deployment:

                <target name="ejbjar" depends="compile">
                ...
                 <copy file="${basedir}/queue-example-service.xml" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
                ...
                 </target>


                Are you sure you are using the correct build script (and you followed the instructions on the wiki)?

                By the way, i just ran the tutorial succesfully, with this output on server console:
                16:28:16,221 INFO [QueueService] Queue[queue/tutorial/email] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                16:28:16,236 INFO [QueueService] Queue[queue/tutorial/accounts, name=trace] started, fullSize=200000, pageSize=2000, downCacheSize=2000
                16:28:21,932 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@27245763{vfszip:/opt/jpai/jboss-5.0.0.GA/server/default/deploy/jboss-ejb3-tutorial-interceptor.jar}
                16:28:21,932 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@27245763{vfszip:/opt/jpai/jboss-5.0.0.GA/server/default/deploy/jboss-ejb3-tutorial-interceptor.jar}
                16:28:21,933 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@27245763{vfszip:/opt/jpai/jboss-5.0.0.GA/server/default/deploy/jboss-ejb3-tutorial-interceptor.jar}
                16:28:21,933 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@27245763{vfszip:/opt/jpai/jboss-5.0.0.GA/server/default/deploy/jboss-ejb3-tutorial-interceptor.jar}
                16:28:22,522 INFO [JBossASKernel] Created KernelDeployment for: jboss-ejb3-tutorial-interceptor.jar
                16:28:22,526 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=AccountsMDB,service=EJB3
                16:28:22,526 INFO [JBossASKernel] with dependencies:
                16:28:22,526 INFO [JBossASKernel] and demands:
                16:28:22,526 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
                16:28:22,526 INFO [JBossASKernel] and supplies:
                16:28:22,526 INFO [JBossASKernel] Class:javax.jms.MessageListener
                16:28:22,526 INFO [JBossASKernel] jndi:null
                16:28:22,527 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=AccountsMDB,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-interceptor.jar
                16:28:22,527 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailMDB,service=EJB3
                16:28:22,528 INFO [JBossASKernel] with dependencies:
                16:28:22,528 INFO [JBossASKernel] and demands:
                16:28:22,528 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
                16:28:22,528 INFO [JBossASKernel] and supplies:
                16:28:22,528 INFO [JBossASKernel] Class:javax.jms.MessageListener
                16:28:22,528 INFO [JBossASKernel] jndi:null
                16:28:22,528 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailMDB,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-interceptor.jar
                16:28:22,528 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailSystemBean,service=EJB3
                16:28:22,528 INFO [JBossASKernel] with dependencies:
                16:28:22,529 INFO [JBossASKernel] and demands:
                16:28:22,529 INFO [JBossASKernel] persistence.unit:unitName=#tempdb
                16:28:22,529 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
                16:28:22,529 INFO [JBossASKernel] and supplies:
                16:28:22,529 INFO [JBossASKernel] jndi:EmailSystemBean/remote
                16:28:22,529 INFO [JBossASKernel] Class:org.jboss.tutorial.interceptor.bean.EmailSystem
                16:28:22,529 INFO [JBossASKernel] jndi:EmailSystemBean/remote-org.jboss.tutorial.interceptor.bean.EmailSystem
                16:28:22,529 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailSystemBean,service=EJB3) to KernelDeployment of: jboss-ejb3-tutorial-interceptor.jar
                16:28:22,660 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.interceptor.bean.AccountsMDB ejbName: AccountsMDB
                16:28:22,813 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.interceptor.bean.EmailMDB ejbName: EmailMDB
                16:28:22,973 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#tempdb
                16:28:23,068 INFO [Version] Hibernate Annotations 3.4.0.GA
                16:28:23,212 INFO [Environment] Hibernate 3.3.1.GA
                16:28:23,220 INFO [Environment] hibernate.properties not found
                16:28:23,226 INFO [Environment] Bytecode provider name : javassist
                16:28:23,255 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
                16:28:23,599 INFO [Version] Hibernate Commons Annotations 3.1.0.GA
                16:28:23,606 INFO [Version] Hibernate EntityManager 3.4.0.GA
                16:28:23,700 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                16:28:23,833 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.tutorial.interceptor.bean.Confirmation
                16:28:23,982 INFO [EntityBinder] Bind entity org.jboss.tutorial.interceptor.bean.Confirmation on table Confirmation
                16:28:24,194 INFO [Version] Hibernate Validator 3.1.0.GA
                16:28:24,309 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
                16:28:24,456 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
                16:28:24,466 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
                16:28:24,474 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
                16:28:24,474 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
                16:28:24,545 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
                16:28:24,563 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
                16:28:24,568 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
                16:28:24,571 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
                16:28:24,571 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
                16:28:24,571 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
                16:28:24,571 INFO [SettingsFactory] JDBC batch size: 15
                16:28:24,572 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
                16:28:24,573 INFO [SettingsFactory] Scrollable result sets: enabled
                16:28:24,573 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
                16:28:24,573 INFO [SettingsFactory] Connection release mode: auto
                16:28:24,574 INFO [SettingsFactory] Default batch fetch size: 1
                16:28:24,574 INFO [SettingsFactory] Generate SQL with comments: disabled
                16:28:24,574 INFO [SettingsFactory] Order SQL updates by primary key: disabled
                16:28:24,574 INFO [SettingsFactory] Order SQL inserts for batching: disabled
                16:28:24,574 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
                16:28:24,578 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
                16:28:24,578 INFO [SettingsFactory] Query language substitutions: {}
                16:28:24,579 INFO [SettingsFactory] JPA-QL strict compliance: enabled
                16:28:24,579 INFO [SettingsFactory] Second-level cache: enabled
                16:28:24,579 INFO [SettingsFactory] Query cache: disabled
                16:28:24,592 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
                16:28:24,592 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
                16:28:24,594 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
                16:28:24,594 INFO [SettingsFactory] Cache region prefix: persistence.unit:unitName=#tempdb
                16:28:24,594 INFO [SettingsFactory] Structured second-level cache entries: disabled
                16:28:24,603 INFO [SettingsFactory] Statistics: disabled
                16:28:24,603 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
                16:28:24,605 INFO [SettingsFactory] Default entity-mode: pojo
                16:28:24,605 INFO [SettingsFactory] Named query checking : enabled
                16:28:24,783 INFO [SessionFactoryImpl] building session factory
                16:28:25,100 INFO [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=#tempdb
                16:28:25,102 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                16:28:25,107 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=#tempdb
                16:28:25,107 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
                16:28:25,121 INFO [SchemaExport] Running hbm2ddl schema export
                16:28:25,122 INFO [SchemaExport] exporting generated schema to database
                16:28:25,123 INFO [SchemaExport] schema export complete
                16:28:25,128 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                16:28:25,226 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=jboss-ejb3-tutorial-interceptor.jar,name=EmailSystemBean,service=EJB3
                16:28:25,241 INFO [EJBContainer] STARTED EJB: org.jboss.tutorial.interceptor.bean.EmailSystemBean ejbName: EmailSystemBean
                16:28:25,312 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
                
                 EmailSystemBean/remote - EJB3.x Default Remote Business Interface
                 EmailSystemBean/remote-org.jboss.tutorial.interceptor.bean.EmailSystem - EJB3.x Remote Business Interface
                
                
                
                


                • 5. Re: Ejb3 - MDB

                  Hi,

                  I have checked it is not part of the EJB jar but was present in the server/all/deploy (i have configured for "all')

                  I have tried adding it to the jar also, but the errors are same.

                  Thanks

                  Following the build file that i am using

                  *******************************************************










                  <!-- Build classpath -->

                  <!-- So that we can get jndi.properties for InitialContext -->

                  <!-- Only the jbossall-client.jar should ideally be sufficient -->








                  <!-- =================================================================== -->
                  <!-- Prepares the build directory -->
                  <!-- =================================================================== -->





                  <!-- =================================================================== -->
                  <!-- Compiles the source code -->
                  <!-- =================================================================== -->



























                  <!-- =================================================================== -->
                  <!-- Cleans up generated stuff -->
                  <!-- =================================================================== -->












                  *******************************************

                  • 6. Re: Ejb3 - MDB

                    Hi,

                    Seems like i cannot paste the xml.

                    I have copied the build.xml from the below location

                    http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/docs/tutorial/interceptor/build.xml

                    Changed the jboss home and deploy folder to "all"

                    Thanks

                    • 7. Re: Ejb3 - MDB
                      peterj

                      Yes, you can paste the XML. That is what the Code button (above the editor window) is for - select the text, click Code, then click Preview to ascertain the formatting is correct before clicking Submit.

                      • 8. Re: Ejb3 - MDB

                        Hi,

                        Thanks for the Input

                        ***********************

                        <?xml version="1.0"?>
                        
                        <!-- ======================================================================= -->
                        <!-- JBoss build file -->
                        <!-- ======================================================================= -->
                        
                        <project name="JBoss" default="ejbjar" basedir=".">
                        
                         <property environment="env"/>
                         <property name="src.dir" value="${basedir}/ejbModule"/>
                         <property name="jboss.home" value="C:/jboss-5.0.0.GA"/>
                         <property name="jboss.server.config" value="all"/>
                         <property name="build.dir" value="${basedir}/build"/>
                         <property name="build.classes.dir" value="${build.dir}/classes"/>
                         <property name="build.artifact" value="jboss-ejb3-tutorial-interceptor.jar"/>
                        
                         <!-- Build classpath -->
                         <path id="classpath">
                         <!-- So that we can get jndi.properties for InitialContext -->
                         <pathelement location="${basedir}"/>
                         <!-- Only the jbossall-client.jar should ideally be sufficient -->
                         <fileset dir="${jboss.home}/client">
                         <include name="**/jbossall-client.jar"/>
                         </fileset>
                         <!-- javax.persistence.* -->
                         <fileset dir="${jboss.home}/common/lib">
                         <include name="ejb3-persistence.jar"/>
                         </fileset>
                        
                         <pathelement location="${build.classes.dir}"/>
                         </path>
                        
                         <property name="build.classpath" refid="classpath"/>
                        
                         <!-- =================================================================== -->
                         <!-- Prepares the build directory -->
                         <!-- =================================================================== -->
                         <target name="prepare">
                         <mkdir dir="${build.dir}"/>
                         <mkdir dir="${build.classes.dir}"/>
                         </target>
                        
                         <!-- =================================================================== -->
                         <!-- Compiles the source code -->
                         <!-- =================================================================== -->
                         <target name="compile" depends="prepare">
                         <javac srcdir="${src.dir}"
                         destdir="${build.classes.dir}"
                         debug="on"
                         deprecation="on"
                         optimize="off"
                         includes="**">
                         <classpath refid="classpath"/>
                         </javac>
                         </target>
                        
                         <target name="ejbjar" depends="compile">
                         <jar jarfile="build/${build.artifact}">
                         <fileset dir="${build.classes.dir}">
                         <include name="**/*.class"/>
                         </fileset>
                         <fileset dir=".">
                         <include name="META-INF/*.xml"/>
                         </fileset>
                         </jar>
                         <copy file="${basedir}/queue-example-service.xml" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
                         <sleep seconds="8"/>
                         <copy file="build/${build.artifact}" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
                         </target>
                        
                         <target name="run" depends="ejbjar">
                         <java classname="org.jboss.tutorial.interceptor.client.Client" fork="yes" dir=".">
                         <classpath refid="classpath"/>
                         </java>
                         </target>
                        
                         <!-- =================================================================== -->
                         <!-- Cleans up generated stuff -->
                         <!-- =================================================================== -->
                         <target name="clean.db">
                         <delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
                         </target>
                        
                         <target name="clean">
                         <delete dir="${build.dir}"/>
                         <delete file="${jboss.home}/server/${jboss.server.config}/deploy/${build.artifact}"/>
                         <delete file="${jboss.home}/server/${jboss.server.config}/deploy/queue-example-service.xml"/>
                         </target>
                        
                        
                        </project>
                        ***********


                        • 9. Re: Ejb3 - MDB
                          jaikiran

                          I see that you have made some changes to the build script (for ex: the src.dir). Can you post the entire console logs on the server?

                          While posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

                          • 10. Re: Ejb3 - MDB

                            Hi,

                            I did the following after which it started working

                            a)no change in build.xml
                            b) i was having two datasources, oracle-ds and derby-ds. I deleted the oracle-ds, and put the hsqldb-ds.xml(provided by jboss by default).
                            c)deleted all ejb jar in deploy folder
                            d)deleted tmp and work folder
                            and restart the server

                            made it as though it is new jboss server

                            after that ran the same build, it started working..i am not sure which of the one above solved the problem

                            Thanks