1 2 Previous Next 19 Replies Latest reply on Jun 9, 2004 11:50 AM by Marat Bedretdinov

    MDB Access over HTTP

    jula Newbie

      Hello:
      I have few MDBs set up in the LAN and it works fine. However when I tunnel through HTTP things aren't the same :-(. Connection is from outside and through a firewall as well.

      When I try to create a QueueConnection using the QueueConnectionFactory it gives me the "Cannot Authenticate User" error. HELP !! HELP!! I haven't configured JAAS, if I have to: what am I to do to configure JAAS?

      To try things out, I created another user instead of GUEST, and things are worse. Then I can't even deploy the MDB. It gives me "Connection not authorised to subscribe to destination". I have put necessary entries in jbossmq-destinations-service.xml and tried addding user and role in jbossmq-state.xml. No luck:-((. HELP!!

      Thanks in advance,
      /Jula

        • 1. Re: MDB Access over HTTP
          Adrian Brock Master

          Post the full stacktrace and configuration.

          Your question just says "It does not work" without any context.

          Regards,
          Adrian

          • 2. Re: MDB Access over HTTP
            jula Newbie

            Client Code:

            Properties props = new Properties();

            props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
            //LOCAL IP->props.put(Context.PROVIDER_URL, "http://192.168.1.11:8080/invoker/JNDIFactory");
            props.put(Context.PROVIDER_URL, "http://203.94.78.157:8080/invoker/JNDIFactory");
            props.put("java.naming.rmi.security.manager","no");
            props.put("jnp.disableDiscovery","true");


            ctx = new InitialContext(props);
            QueueConnectionFactory conFactory =
            (QueueConnectionFactory) ctx.lookup("HTTPConnectionFactory");

            /*ERROR---->*/ connection = conFactory.createQueueConnection("phuser","phpass");

            EXCEPTION on Client:

            org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.net.ConnectException: Connection timed out: connect)

            at org.jboss.mq.Connection.authenticate(Connection.java:883)

            BUT:

            Identical code works in LAN with IP address changed and using ConnectionFactory.

            • 3. Re: MDB Access over HTTP
              jula Newbie

              Full stack trace.

              org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.net.ConnectException: Connection timed out: connect)
              at org.jboss.mq.Connection.authenticate(Connection.java:883)
              at org.jboss.mq.Connection.(Connection.java:238)
              at org.jboss.mq.SpyConnection.(SpyConnection.java:49)
              at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)
              at jbosstest.Test.(Test.java:51)
              at jbosstest.Test.main(Test.java:104)
              Caused by: java.net.ConnectException: Connection timed out: connect
              at java.net.PlainSocketImpl.socketConnect(Native Method)
              at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
              at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
              at java.net.Socket.connect(Socket.java:426)
              at java.net.Socket.connect(Socket.java:376)
              at java.net.Socket.(Socket.java:291)
              at java.net.Socket.(Socket.java:147)
              at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
              at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563)
              at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)
              at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
              at org.jboss.mq.Connection.authenticate(Connection.java:876)
              ... 5 more


              However I can access the jmx-console over the Internet.

              TIA
              /Jula

              • 4. Re: MDB Access over HTTP
                Adrian Brock Master

                1) OIL does not work through a firewall, use UIL2
                2) Discovery doesn't work through a firewall either

                Most likely your connection factories are bound to 192.168.1.11
                making them inaccessible on the internet. Check your host configuration.

                Regards,
                Adrian

                • 5. Re: MDB Access over HTTP
                  jula Newbie

                  Many Thanks Adrian;

                  Now I am using UIL2ConnectionFactory and removed "props.put("jnp.disableDiscovery","true");", if that is what you meant by Discovery is not supported through a firewall. However I still get the same exception.

                  In addition I changed the bind ip address of the UIL2-service.xml and http-invoker\\META-INF\\jboss.xml to the ip address which is exposed out. We have NAT and thoght this is needed.

                  What else have I missed?

                  Appreciate any hints :-)

                  Regards
                  /Jula

                  • 6. Re: MDB Access over HTTP
                    Adrian Brock Master

                    The default is discovery, but that is irrevelent, you already got past that stage.

                    I posted instructions on enabling trace logging on the client here:
                    http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3816091

                    This should show you where it is trying to connect to.

                    Regards,
                    Adrian

                    • 7. Re: MDB Access over HTTP
                      jula Newbie

                      Thanks Adrian:

                      My client doesn't have log4j configured. I tried adding the log4j.properties in my classpath. But it didn't create any log file. Do I have to code my client to support log4j to support this or have I missed any thing.

                      On the server: I get the following but the client connection could not be seen.

                      18:01:05,477 DEBUG [DefaultPartition] [Mon Mar 15 18:01:05 GMT+06:00 2004] [ERROR] NAKACK.handleXmitReq(): (requester=phslt01:1872 (additional data: 17 bytes))
                      message with seqno=5 not found in sent_msgs ! sent_msgs=19 18 17 16 15 14 13 12 11 10 9 8 7 6

                      Hope to hear from you soon.
                      Regs
                      /Jula

                      • 8. Re: MDB Access over HTTP
                        Adrian Brock Master

                         

                        "jula" wrote:
                        Thanks Adrian:

                        My client doesn't have log4j configured. I tried adding the log4j.properties in my classpath. But it didn't create any log file. Do I have to code my client to support log4j to support this or have I missed any thing.

                        On the server: I get the following but the client connection could not be seen.


                        You did it wrong. *Please* think about it for yourself.
                        Did you
                        java -classpath log4j.properties (which is wrong)
                        or
                        java -classpath somedirectoryorjarcontainingthelog4j.properties

                        If you can't configure a classpath, I'd be surprised if you've configured
                        your network correctly. :-)

                        "jula" wrote:

                        18:01:05,477 DEBUG [DefaultPartition] [Mon Mar 15 18:01:05 GMT+06:00 2004] [ERROR] NAKACK.handleXmitReq(): (requester=phslt01:1872 (additional data: 17 bytes))
                        message with seqno=5 not found in sent_msgs ! sent_msgs=19 18 17 16 15 14 13 12 11 10 9 8 7 6


                        Completely different issue, but it does suggest there is something screwy on
                        your network/firewall. Please keep topics to one question. But feel free
                        to repost it in the clustering forum.

                        Regards,
                        Adrian

                        • 9. Re: MDB Access over HTTP
                          jula Newbie

                          Sorry if my wording gave the wrong impression. But I didn't add log4j.properties to my classpath, instead added a folder name and had the file in it. As u said: it's basic stuff.

                          Infact I removed the ORIGINAL log4j.properties file from the jbossall-client.jar, thinking it could do any harm.

                          Thanks
                          /Jula


                          • 10. Re: MDB Access over HTTP
                            jula Newbie

                            log4j Output:

                            2004-03-16 11:58:17,487 TRACE [org.jboss.mq.Connection(1)] {main} Authenticating user phuser
                            2004-03-16 11:58:17,487 TRACE [org.jboss.mq.il.uil2.UILServerIL(1)] {main} Connecting to : /203.94.78.157:8093
                            2004-03-16 11:58:17,487 TRACE [org.jboss.mq.il.uil2.UILServerIL(1)] {main} Connecting with addr=/203.94.78.157, port=8093, localAddr=null, localPort=0, socketFactory=javax.net.DefaultSocketFactory@1198891, enableTcpNoDelay=true, bufferSize=2048, chunkSize=1000000
                            2004-03-16 12:02:09,160 TRACE [org.jboss.mq.il.uil2.UILServerIL(1)] {main} Connecting to : /203.94.78.157:8093
                            2004-03-16 12:02:09,160 TRACE [org.jboss.mq.il.uil2.UILServerIL(1)] {main} Connecting with addr=/203.94.78.157, port=8093, localAddr=null, localPort=0, socketFactory=javax.net.DefaultSocketFactory@1198891, enableTcpNoDelay=true, bufferSize=2048, chunkSize=1000000

                            The firewall allows only port 80 communication. Isn't there an attempt to communicate on 8093?

                            Regards
                            /Jula

                            • 11. Re: MDB Access over HTTP
                              jula Newbie

                              Thanks Adrian for your support so far.

                              Further to my previous posts, I also opened the 8093 port on my firewall. But I am confused about the random ports at the client. Obviously I can't open those on my firewall.

                              Can't I configure JBoss to talk only through port 80 or atleast few fixed ports? Both on client side and server side.

                              I hope the reply is not to use JProxy :-((.

                              TIA
                              /Jula

                              • 12. Re: MDB Access over HTTP
                                Adrian Brock Master

                                If you want access JMS over http use the HTTPConnectionFactory

                                Regards,
                                Adrian

                                • 13. Re: MDB Access over HTTP
                                  jula Newbie

                                  Adrian: I am back @ square one:

                                  If you refer the very fist code post, you should see that I used HTTPConnectionFactory before and you wanted me to use UIL2 and so on. Now you want me to use HTTPConnectionFactory again.

                                  However, I suspect the issue is to do with firewall.

                                  Please tell whether HTTPConnectionFactory is supporting NAT on JBoss 3.2.3.

                                  I don't wanna use the following fix which was posted on some other thread:
                                  String hostName = addr.getHostName();
                                  addr = InetAddress.getByName(hostName);

                                  I tried assigning the external IP through JAVA_OPTS in run.bat. Then I get the "Bind Exception" so that's also out.

                                  TIA
                                  /Jula

                                  • 14. Re: MDB Access over HTTP
                                    Adrian Brock Master

                                    If you were using HTTP why does your stacktrace say OIL?

                                    at javax.net.DefaultSocketFactory.createSocket(DashoA6275)
                                    at org.jboss.mq.il.oil.OILServerIL.createConnection(OILServerIL.java:563)
                                    at org.jboss.mq.il.oil.OILServerIL.checkConnection(OILServerIL.java:507)
                                    at org.jboss.mq.il.oil.OILServerIL.authenticate(OILServerIL.java:289)
                                    at org.jboss.mq.Connection.authenticate(Connection.java:876)
                                    ... 5 more

                                    I have no idea what you are talking about in the rest of the comment.

                                    Regards,
                                    Adrian

                                    1 2 Previous Next