5 Replies Latest reply on Apr 27, 2004 12:07 PM by Eric Hansen

    rmi RemoteException from Tomcat to JBossMQ

    Eric Hansen Newbie

      Hello, I am trying to connect to a JBossMQ (JBoss 3.2.1) from within Tomcat 4.1.x or 5.0.x. The following code WORKS great from within Tomcat 4.0.6 but fails in the later versions of Tomcat...

      Properties properties = new Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.PROVIDER_URL, jnp://localhost:1099");
      properties.put(Context.URL_PKG_PREFIXES, org.jboss.naming:org.jnp.interfaces");
      properties.put(Context.SECURITY_PRINCIPAL, "jmsuser");
      properties.put(Context.SECURITY_CREDENTIALS, "jmsuserpassword");
      jmsContext = new InitialContext(properties);

      Object connFactory = jmsContext.lookup("ConnectionFactory");
      //... make jms queue and topic connection

      the exception thrown (at jmsContext.lookup...) is:
      RemoteException occurred in server thread
      javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException
      occurred in server thread; nested exception is:
      java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
      java.net.MalformedURLException: no protocol: Files/Crystal]

      The "Files/Crystal" part of the error is a bit odd... it is part of the path to both the Tomcat installation and the JBoss installation (c:\Program Files\Crystal Stuff\...)

      Any clues or leads is GREATLY appreciated!!

      p.s. If there is another way to get the JMS connection from within Tomcat, an example would be great. If investigated the <resource-env-ref> route in the web.xml and server.xml but have not found any info on how to do that with JBossMQ.