5 Replies Latest reply on Sep 12, 2009 7:26 PM by Ron Sigal

    Problem running with Maven

    Eric Rotick Newbie

      I've been playing around with remoting and developed some tests. These all run fine in the same environment as delivered by the 2.5.1 download.

      I now need to integrate this work into the main project which uses Maven but I cannot get this to run. I've also ported the simple tests over to Maven and this also does not run.

      It seems to me that the Maven dependencies are at fault but I cannot find anything that documents this. By the way, the search facility in this forum results in an exception.

      I'm using the repository at http://repository.jboss.org/maven2 and jdk 1.6.

      The symptoms are that the client server connection is made, as determined via netstat but nothing get invoked. The client is bocked forever. If I kill the server the client also fails.

      When I started the Mavenizing process I read in Ch4 of the Remoting Guide that jboss-remoting.jar was the only jar required so that is all I added. Everything compiles but when I run it I get an error that org.jboss.logging.Logger is missing.

      I realize with so many logging implementations I have to make a choice at runtime so I added jboss-logging-log4j as I'm also using log4j.

      This solves the logging problem but now at runtime I get an error that org.jboss.util.threadpool.ThreadPool is missing. I fgrep'ed in the download and found it in jboss-common.jar. Now I tried to find this in the jboss maven repository and this is where, I think, it started to go wrong!

      I could not find jboss-common in the groupId of org.jboss but I did find it in the groupId of jboss. I added this and now I get an error that EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap is missing. I found

      <groupId>oswego-concurrent</groupId>
      <artifactId>concurrent</artifactId>
      <version>1.3.4-jboss-update1</version>


      on the jboss repository.

      I added this dependency and everything runs without an error but it doesn't work. When I killed the server I noticed that the client reported that org.jboss.mx.util.ObjectNameFactory was missing.

      I thought I must be doing something wrong so I re-read the section in the Remoting Guide on dependencies and decided that Ch4.1 regarding the third party libraries really does mean to supplement jboss-remoting.jar despite the statement to the contrary in Ch4. This also documented the additional dependencies I had added so now we're getting somewhere.

      The guide says jboss-jmx is not needed since I'm using JDK 1.6 but I still get the exception and the test fails. I added

      <groupId>jboss</groupId>
       <artifactId>jboss-jmx</artifactId>
       <version>4.2.3.GA</version>


      from the jboss repository.

      Now if I run the test it just blocks as before but when I kill the server the client fails with

      org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socke
      t://localhost:2468/]
       at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:776)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
       at org.jboss.remoting.Client.invoke(Client.java:1724)
       at org.jboss.remoting.Client.invoke(Client.java:629)
       at org.jboss.remoting.Client.invoke(Client.java:617)
       at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterClient.java:321)
       at $Proxy0.getOne(Unknown Source)
       <snip>
      


      which is called from my call to the TransporterClient proxy.

      Now I do not have any more ideas what to do. Can anyone shed some light on this as I must be down to the Maven dependencies.

      Thanks,

      Eric.


        • 1. Re: Problem running with Maven
          Eric Rotick Newbie

          Further to this problem I decided to clear out all jboss related files in my local maven repository to force a download.

          When the jboss-remoting files were being downloaded by maven there was a checksum error in the jar which maven ignored.

          I then did a binary diff on the maven jar and the download jar from the distribution tarball and they are different.

          I then copied the jar from the distribution tarball into the maven repository but the application still locks up.

          Just out of curiosity I changed to 2.5.0.GA and there was again a checksum error but still the application blocks.

          One further thing, I've noticed that all files in the jboss repository are 8th July 2009. I'm not suggesting anything is wrong with this, just an observation.

          • 2. Re: Problem running with Maven
            Eric Rotick Newbie

            I've been doing some more digging around and I've discovered that the stack trace for the situation when the server is started, then the client is run up and then the server is killed is exactly the same as when the server is not running but the client is started.

            In both case the error is connection refused. However, if I run the server up then the client and wait a second or two, then run netstat I get

            tcp 0 0 ::ffff:192.168.254.19:2468 :::* LISTEN
            tcp 0 0 ::ffff:192.168.254.19:39607 ::ffff:192.168.254.19:2468 ESTABLISHED
            tcp 575 0 ::ffff:192.168.254.19:2468 ::ffff:192.168.254.19:39607 ESTABLISHED
            


            which shows that the connection has been made and there is also data in the receive queue for the server process.

            My conclusion is there is either something totally screwed or, and more likely, there is an additional connection which is being refused and not the link I expect to see.

            The stack trace is

            org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://192.168.254.19:2468/]
             at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:776)
             at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
             at org.jboss.remoting.Client.invoke(Client.java:1724)
             at org.jboss.remoting.Client.invoke(Client.java:629)
             at org.jboss.remoting.Client.invoke(Client.java:617)
             at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterClient.java:321)
             at $Proxy0.getOne(Unknown Source)
             at example.SimpleClient.go(SimpleClient.java:21)
             at example.SimpleClient.main(SimpleClient.java:12)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:283)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: java.net.ConnectException: Connection refused
             at java.net.PlainSocketImpl.socketConnect(Native Method)
             at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
             at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
             at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
             at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
             at java.net.Socket.connect(Socket.java:519)
             at org.jboss.remoting.transport.socket.SocketClientInvoker.connect(SocketClientInvoker.java:289)
             at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java:206)
             at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1089)
             at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:762)
             ... 14 more
            


            I then saved the output from netstat before running the test and again while the test was running and the client was blocked and there are no additional listeners running so it could be that I'm not starting a listener which is expected.



            • 3. [Solved] Re: Problem running with Maven
              Eric Rotick Newbie

              First thing is that jmx is not as independent as the remoting guide would have you believe and the jboss-jmx jar is certainly needed. There is already a JIRA to this effect at https://jira.jboss.org/jira/browse/JBREM-808.

              Now that jboss-jmx is required, dom4j is also required according to the remoting guide. However, the real killer was that jboss-serialization is needed although I am not using jboss serialization. Add that dependency and everything works.

              In conclusion, it seems to me that the maven support for jboss, at least the remoting project, is broken. Many of the poms have no dependencies so it looks like the jars have simply been 'installed' in the repository. There are several version of standard packages in the jboss repositories, e.g. dom4j and concurrent which have jboss versions but no way to know if they should be used. The repositories seem inconsistent, some have the remoting jar but not the subsets etc.

              I've read, although I cannot currently find, that with remoting 3 there will be a move to maven builds which, hopefully, will sort this out.

              Shame really as remoting seems very good.

              • 4. Re: Problem running with Maven
                Ron Sigal Master

                Hi Eric,

                I'm sorry you had a bad experience. I've created JBREM-1151 "Correct dependency discussion in Chapter 4 of Remoting Guide" to remind me to clarify this stuff.

                As for maven, Remoting 2 is not mavenized and will never be. Remoting 3 will be mavenized. You're right that I just manually put some jars in the maven repository, which I do for the use of the Application Server. I continue to put all of the jars in the "old" repository at http://repository.jboss.com/jboss/remoting/ .

                -Ron

                • 5. Re: Problem running with Maven
                  Ron Sigal Master

                  I've closed JBREM-1151, having updated the Remoting Guide. The tool Tattletale was extremely useful. It's available from http://www.jboss.org/tattletale.