0 Replies Latest reply on Dec 13, 2003 6:06 AM by cschlaefcke

    Basic JNDI/JMS Problems

    cschlaefcke Newbie

      Hi Folks,

      I just start using j2ee technologies more intensive, and want to improve my knowledge by getting some examples running. Onother thing I want to Improve is my knowledge about j2ee patterns like DAO, DTO. I think I found a rather good example that covers some of these techniques

      The example mentioned could be found under http://www-106.ibm.com/developerworks/java/library/j-dao/?Open&ca=daw-ja-news

      I mangaged to setup jboss 3.2.3 and the neccessary jdbc datasource so far. But I have quite big problems getting the JMS/JNDI parts running.

      I configured the jndi resources in my web.xml like this:
      <resource-env-ref>
      <resource-env-ref-name>jms/MovieTopic</resource-env-ref-name>
      <resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>
      </resource-env-ref>

      <resource-ref>
      <res-ref-name>jms/MovieTopic</res-ref-name>
      <res-type>javax.jms.Topic</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>

      The corresponding part of jms-ds.xml looks like this:
      <tx-connection-factory>
      <jndi-name>jms/MovieTCF</jndi-name>
      <xa-transaction/>
      <adapter-display-name>JMS Adapter</adapter-display-name>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
      </tx-connection-factory>

      And thats what I have in jbossmq-destinations-servic.xml:
      name="jboss.mq.destination:service=Topic,name=jms/MovieTopic"
      (The complete mbean block apears to be corrupted when I paste it here)

      When I start jboss with this setting I see the following log entries:
      11:59:46,539 INFO [jms/MovieTopic] Bound to JNDI name: topic/jms/MovieTopic
      11:59:46,539 INFO [jms/MovieTopic] Started jboss.mq.destination:service=Topic,name=jms/MovieTopic

      ==> I assume that now my javax.jms.Topic is available under JNDI name "topic/jms/MovieTopic".

      But when I activate my application I get this exception:
      12:03:30,201 ERROR [MainDeployer] could not start deployment: file:/opt/jboss-3.2.3/server/default/deploy/daoexamples.ear
      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-env-ref: topic/jms/MovieTopic has no valid JNDI binding. Check the jboss-web/resource-env-ref.)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:440)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)

      I tried several combinations of settings in the xml files with no success. I have no idea what might be wrong. Maybe something basic I didn't understand til yet? Do I have to setup/configure anything else to get JBoss runnning with this example?

      Sorry for this huge posting and thanks for any help!

      Regards,

      Chris