2 Replies Latest reply on Jun 21, 2006 9:14 PM by Steve Pickering

    JMS firewall problem

    Thomas Flølo Newbie

      Hello

      I'm quite new to jboss, but I've managed to solve most problems that has occured using the wiki and this forum. One problem i still have is that when accessing my ejb appliacion from outside the local network (trough a firewall) the Jboss server replied with his local ip. I read the wiki and solved the problem.... almost.

      I'm running a local thread in my client, this thread implements messagelistener wich supscribes to a topic. I understand that JMS(topics) use port 8093 as default. When i try to connect to the topic outside the firewall it tries to connect to my linux servers local internal network ip.

      Before i added

      -Djava.rmi.server.hostname=<external_host_name>
      -Djava.rmi.server.useLocalHostname=false
      

      to my run.sh script this also happend for my jndi lookups on port 1098.

      Below is my jndi.properties.file (fictional ip)
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://193.123.123.123:1099
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces


      My local thread running a topicsubscriber
       public void run() {
       try {
      
       jndiContext = new InitialContext();
       topicConnectionFactory = (TopicConnectionFactory) jndiContext.lookup("TopicConnectionFactory");
       topic = (Topic) jndiContext.lookup(selectedTopicName);
       topicConnection = topicConnectionFactory.createTopicConnection();
       topicSession = topicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
       topicSubscriber = topicSession.createSubscriber(topic);
       topicSubscriber.setMessageListener(this);
       topicConnection.start();
      } catch (NamingException e) {
       System.out.println("ServerTopicPublisher: Error while connecting");
      
       e.printStackTrace();
       } catch (JMSException e) {
       e.printStackTrace();
       }
       }