3 Replies Latest reply on Mar 19, 2011 6:09 PM by Peter Johnson

    configuring JMS in JBoss 5 to use oracle db.

    martin mucha Newbie

      Hi, I'm trying to configure JMS without much success.

      My simple example works fine with hsqldb. Next I replaced content of hsqldb-persistence-service.xml with configuration for oracle from doc/examples. Next I defined new datasource for oracle db, and replaced all occurences of "DefaultDS" with jndi name of new datasource.


      In my datasource is this:





      so in my hsqldb-persistence-service.xml went  this



      <attribute name="DataSource">java:/testingDS</attribute>



      sounded reasonable to me, but server startup started complaining about missing DQL in jndi (see lower). I've got no idea why is this occuring, since I consider made changes irelevant to this. When hsqldb was used, there was no misconfiguration with dlq. That's for started, and secondly, I do not understand, why DLQ is being looked up, when there is <attribute name="DefaultQueueJNDIContext">/queue</attribute>


      Do you have any ideas what's wrong?



      20:25:30,720 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@64e3f9(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@c99007 destination=java:/jms/queues/EiraNotificationQueue 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: DLQ 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:443)

              at org.jnp.server.NamingServer.lookup(NamingServer.java:399)

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

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

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

              at org.jboss.util.naming.Util.lookup(Util.java:222)

              at org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler.setupDLQDestination(AbstractDLQHandler.java:106)

              at org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler.setup(AbstractDLQHandler.java:82)

              at org.jboss.resource.adapter.jms.inflow.dlq.JBossMQDLQHandler.setup(JBossMQDLQHandler.java:48)

              at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDLQ(JmsActivation.java:413)

              at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:351)

              at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)

              at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)

              at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

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

        • 1. configuring JMS in JBoss 5 to use oracle db.
          Peter Johnson Master

          You cannot just edit hsqldb-persistence-service.xml. Instead, look in docs/example/jms and grab the oracle-persistence-service.xml file and use that instead (don't forget to delete hsqldb-persistence-service-xml!). The *-persistence-srvice.xml file contains SQL statements specific to their respective databases.

          • 2. Re: configuring JMS in JBoss 5 to use oracle db.
            martin mucha Newbie

            I did that. I copied





            i.e. I overwrite former content of hsqldb... with oracle-persistence.service.xml content. Why? Some documentation on JBoss Messaging instruct me to do so.

            After that I just replaced datasource references as described.



            So to describe changes more precisely. I'm starting at "it works fine with hsqldb" state.

            Next I do this:


            cp docs/example/jms/oracle-persistence-service.xml /server/default/deploy/messaging/hsqldb-persistence-service.xml

            cd /server/default/deploy/messaging/

            cat hsqldb-persistence-service.xml | sed "s/DefaultDS/MyDS/" > 2

            mv 2 hsqldb-persistence-service.xml


            and it result in exception I mentioned. Datasource is existing, loaded, properly configured. What can be the problem?





            First of all: I wrote this answer from my home, typing filenames just as I remembered them (since I do not have JBoss here).


            More INFO: In oracle-persistence-service.xml there is that attribute, which controls automatic creation of JMS tables if they do not exist. I left it set on true, AND after JBoss startup, they were actually created in db. So, reference to oracle db probably does not pose a problem. My quess is, that hsqldb is misconfigured (by default, I did not change it) OR it does not use DLQ at all, thus no search for it is made, thus no error. In configuration there IS queue named DLQ, without specified jndi and default jndi path for queues is /queue, SO if anything there should be search for /queue/DLQ not just DLQ.


            If you need to see some file to be able to tell me where the problem potentially is, just ask for it. I will help you (ehm in you effort in helping me) as much as I can.