11 Replies Latest reply on Oct 26, 2007 12:44 PM by Bruno Unna

    Missing method isNotNull() in AssertArgument?

    Bruno Unna Newbie

      Hello, please excuse me if this is not the proper place to make this question.

      I'm trying to compile JBossESB from the SVN trunk (updated today). At a certain point, while executing "ant dist", I get a NoSuchMethodError:


      [java] [junit] Testcase: test_no_collections took 1.212 sec
      [java] [junit] Caused an ERROR
      [java] [junit] org.jboss.internal.soa.esb.assertion.AssertArgument.isNotNull(Ljava/lang/Object;Ljava/lang/String;)V
      [java] [junit] java.lang.NoSuchMethodError: org.jboss.internal.soa.esb.assertion.AssertArgument.isNotNull(Ljava/lang/Object;Ljava/lang/String;)V
      [java] [junit] at org.jboss.soa.esb.http.HttpClientFactory.createHttpClient(HttpClientFactory.java:53)
      [java] [junit] at org.jboss.soa.esb.services.soapui.SoapUIClientService.createWsdlLoader(SoapUIClientService.java:152)
      [java] [junit] at org.jboss.soa.esb.services.soapui.SoapUIClientService.getWsdlInterfaces(SoapUIClientService.java:127)
      [java] [junit] at org.jboss.soa.esb.services.soapui.SoapUIClientService.getOperation(SoapUIClientService.java:139)
      [java] [junit] at org.jboss.soa.esb.services.soapui.SoapUIClientService.buildRequest(SoapUIClientService.java:102)
      [java] [junit] at org.jboss.soa.esb.services.soapui.SoapUIClientServiceMBeanUnitTest.test_no_collections(SoapUIClientServiceMBeanUnitTest.java:65)


      It seems to me that the method AssertArgument.isNotNull() is expected be of type void. However, in the AssertArgument class, it is of type Object.

      After changing the method to be of type void, everything compiles like a charm. What is happening here? Thanks in advance for your help.

      PS: here, the diff I've created (from directory "product"):


      --- rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java (revision 16081)
      +++ rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java (working copy)
      @@ -38,7 +38,7 @@
      * @param argName Argument name.
      * @throws IllegalArgumentException Argument is null.
      */
      - public static Object isNotNull(Object arg, String argName) throws IllegalArgumentException {
      + public static void isNotNull(Object arg, String argName) throws IllegalArgumentException {
      if (arg == null) {
      throw new IllegalArgumentException("null '" + argName
      + "' arg in method call.");

        • 1. Re: Missing method isNotNull() in AssertArgument?
          Bruno Unna Newbie

          Oops, I've attached the wrong diff in the previous post! :)


          --- rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java (revision 16081)
          +++ rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java (working copy)
          @@ -38,12 +38,12 @@
          * @param argName Argument name.
          * @throws IllegalArgumentException Argument is null.
          */
          - public static Object isNotNull(Object arg, String argName) throws IllegalArgumentException {
          + public static void isNotNull(Object arg, String argName) throws IllegalArgumentException {
          if (arg == null) {
          throw new IllegalArgumentException("null '" + argName
          + "' arg in method call.");
          }
          - return arg;
          + return;
          }

          /**

          • 2. Re: Missing method isNotNull() in AssertArgument?
            Tom Fennelly Master

            Bruno, you must have a dirty build in some way. This stuff is all compiling fine on CI etc + a change in return value shouldn't be causing a NoSuchMethodError.

            How are you running the build? What's your env etc? Do you have a classpath var set in your env?

            Try this (will take about 20 mins)... from the root of your ESB checkout (trunk)... "ant -f integration-build.xml integration"

            • 3. Re: Missing method isNotNull() in AssertArgument?
              Bruno Unna Newbie

              My environment (I prefer not having a CLASSPATH in the env):

              bruno@golden:~/jbossesb-svn/product$ env
              KDE_MULTIHEAD=false
              SSH_AGENT_PID=6151
              DM_CONTROL=/var/run/xdmctl
              TERM=xterm
              SHELL=/bin/bash
              XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic
              GTK2_RC_FILES=/home/bruno/.gtkrc-2.0
              GTK_RC_FILES=/etc/gtk/gtkrc:/home/bruno/.gtkrc:/home/bruno/.kde/share/config/gtkrc
              GS_LIB=/home/bruno/.fonts
              WINDOWID=67108871
              OLDPWD=/home/bruno/jbossesb-svn
              KDE_FULL_SESSION=true
              USER=bruno
              LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
              SSH_AUTH_SOCK=/tmp/ssh-UDSyDA6150/agent.6150
              SESSION_MANAGER=local/golden:/tmp/.ICE-unix/6180
              KONSOLE_DCOP=DCOPRef(konsole-8125,konsole)
              PATH=/home/bruno/bin:/home/bruno/glassfish/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/bruno/maven-2.0.7/bin
              DESKTOP_SESSION=kde
              KONSOLE_DCOP_SESSION=DCOPRef(konsole-8125,session-1)
              PWD=/home/bruno/jbossesb-svn/product
              LANG=en_US.UTF-8
              HISTCONTROL=ignoredups
              HOME=/home/bruno
              SHLVL=1
              XCURSOR_THEME=kubuntu
              LOGNAME=bruno
              DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-LjFp8nMTvA,guid=bf2eb6acf9682126bd2c840047219a77
              LESSOPEN=| /usr/bin/lesspipe %s
              DISPLAY=:0.0
              LESSCLOSE=/usr/bin/lesspipe %s %s
              COLORTERM=
              _=/usr/bin/env


              In order to compile, I change to dir "~/jbossesb-svn/product", edit file "install/deployment.properties" setting property "org.jboss.esb.server.home" to make it point to the JBoss AS directory, and run:


              bruno@golden:~/jbossesb-svn/product$ JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun ANT_HOME=/usr/share/ant ant dist


              I will try what you suggest and report results.

              • 4. Re: Missing method isNotNull() in AssertArgument?
                Bruno Unna Newbie

                Nope, things didn't work. In general terms, I got this error (after a large number of successful tests):


                [java] [junit] Running org.jboss.soa.esb.actions.routing.JmsRouterIntegrationTest
                [java] [junit] Tests run: 10, Failures: 0, Errors: 1, Time elapsed: 1.235 sec
                [java] [junit] Testsuite: org.jboss.soa.esb.actions.routing.JmsRouterIntegrationTest
                [java] [junit] Tests run: 10, Failures: 0, Errors: 1, Time elapsed: 1.235 sec
                [java] [junit] ------------- Standard Output ---------------
                [java] [junit] EMMA: collecting runtime coverage data ...
                [java] [junit] ------------- ---------------- ---------------

                [java] [junit] Testcase: unknown took 0.243 sec
                [java] [junit] Testcase: unknown took 0.005 sec
                [java] [junit] Testcase: unknown took 0.046 sec
                [java] [junit] Testcase: unknown took 0.393 sec
                [java] [junit] Testcase: unknown took 0.008 sec
                [java] [junit] Testcase: unknown took 0.009 sec
                [java] [junit] Testcase: unknown took 0.008 sec
                [java] [junit] Testcase: unknown took 0.009 sec
                [java] [junit] Caused an ERROR
                [java] [junit] Failed to configure JMS Queue for routing.
                [java] [junit] org.jboss.soa.esb.ConfigurationException: Failed to configure JMS Queue for routing.
                [java] [junit] at org.jboss.soa.esb.actions.routing.JMSRouter.createQueueSetup(JMSRouter.java:318)
                [java] [junit] at org.jboss.soa.esb.actions.routing.JMSRouter.(JMSRouter.java:162)
                [java] [junit] at org.jboss.soa.esb.actions.routing.JmsRouterIntegrationTest.construct_with_priority_attribute(JmsRouterIntegrationTest.java:235)
                [java] [junit] at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
                [java] [junit] at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
                [java] [junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                [java] [junit] at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
                [java] [junit] at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
                [java] [junit] at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
                [java] [junit] at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
                [java] [junit] at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
                [java] [junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                [java] [junit] at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
                [java] [junit] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
                [java] [junit] Caused by: javax.jms.JMSException: Bad priority value
                [java] [junit] at org.jboss.mq.SpyMessageProducer.setPriority(SpyMessageProducer.java:131)
                [java] [junit] at org.jboss.soa.esb.actions.routing.JMSRouter$JMSSendQueueSetup.setPriority(JMSRouter.java:375)
                [java] [junit] at org.jboss.soa.esb.actions.routing.JMSRouter.createQueueSetup(JMSRouter.java:309)
                [java] [junit] ... 20 more

                [java] [junit] Testcase: unknown took 0.006 sec
                [java] [junit] Testcase: unknown took 0.007 sec

                [java] BUILD FAILED
                [java] /home/bruno/jbossesb-svn/product/build.xml:161: The following error occurred while executing this line:
                [java] /home/bruno/jbossesb-svn/product/rosetta/build.xml:104: The following error occurred while executing this line:
                [java] /home/bruno/jbossesb-svn/product/rosetta/tests/build.xml:166: The following error occurred while executing this line:
                [java] /home/bruno/jbossesb-svn/product/rosetta/tests/build.xml:190: Test org.jboss.soa.esb.actions.routing.JmsRouterIntegrationTest failed

                [java] Total time: 1 minute 17 seconds

                esb.init-app-server:

                esb.init-esb-server:

                esb.init-ftp-server:

                esb.init:

                stop-server:
                [echo] Stopping local ESB server
                [java] Shutdown message has been posted to the server.
                [java] Server shutdown may take a while - check logfiles for completion
                [echo] Waiting for ESB server to stop...

                • 5. Re: Missing method isNotNull() in AssertArgument?
                  Daniel Bevenius Master

                  Hi Bruno,

                  this might be a bug in JBossMQ. But I should have discovered this when testing, but I only ran the integration tests against jboss messaging :(

                  I'll run this agains mq and make sure this works. Sorry about this.

                  /Daniel

                  • 6. Re: Missing method isNotNull() in AssertArgument?
                    Daniel Bevenius Master

                    Hi Bruno,

                    this was actually my fault:( I hade incorrectly assumed that the max priority was 10 which I used in the test case. Turn out the max is 9 and I've update the test case.

                    Could you do an svn update and try again? Sorry for wasting your time with this.

                    Thanks,

                    Daniel

                    • 7. Re: Missing method isNotNull() in AssertArgument?
                      Daniel Bevenius Master

                      I've just completed the integration test agains JBossAS 4.2.0.GA with JBossMQ which passes.

                      I hade a similar exception to yours this morning and the problem was like Tom said, that I had an old jbossesb-rosetta.jar in jbossesb.sar/lib.

                      I can run 'ant dist' without any error. Could you run 'ant clean dist' and see this if you are still getting this error?

                      Thanks,

                      Daniel

                      • 8. Re: Missing method isNotNull() in AssertArgument?
                        Bruno Unna Newbie

                        Guys/pals: I'm starting to feel bad about this, completely clueless as I am. Sorry if what I ask is due to my lack of knowledge...

                        I have updated my local copy (at home, this time). Effectively, the failure point occurs more much later tan before, but it occurs:


                        [java] [junit] Testcase: unknown took 0.039 sec
                        [java] [junit] Caused an ERROR
                        [java] [junit] Unable to start Remoting Listener instsance org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener
                        [java] [junit] org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unable to start Remoting Listener instsance org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.startJBRServer(JBossRemotingGatewayListener.java:256)
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.doStart(JBossRemotingGatewayListener.java:223)
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListenerUnitTest.startServer(JBossRemotingGatewayListenerUnitTest.java:199)
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListenerUnitTest.test_delivery(JBossRemotingGatewayListenerUnitTest.java:157)
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListenerUnitTest.test_socket_(JBossRemotingGatewayListenerUnitTest.java:153)
                        [java] [junit] at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
                        [java] [junit] at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
                        [java] [junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                        [java] [junit] at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
                        [java] [junit] at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
                        [java] [junit] at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
                        [java] [junit] at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
                        [java] [junit] at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
                        [java] [junit] at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
                        [java] [junit] at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
                        [java] [junit] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
                        [java] [junit] Caused by: java.net.BindException: Address already in use
                        [java] [junit] at java.net.PlainSocketImpl.socketBind(Native Method)
                        [java] [junit] at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
                        [java] [junit] at java.net.ServerSocket.bind(ServerSocket.java:319)
                        [java] [junit] at java.net.ServerSocket.(ServerSocket.java:185)
                        [java] [junit] at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
                        [java] [junit] at org.jboss.remoting.transport.socket.SocketServerInvoker.createServerSocket(SocketServerInvoker.java:264)
                        [java] [junit] at org.jboss.remoting.transport.socket.SocketServerInvoker.start(SocketServerInvoker.java:193)
                        [java] [junit] at org.jboss.remoting.transport.Connector.start(Connector.java:322)
                        [java] [junit] at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.startJBRServer(JBossRemotingGatewayListener.java:251)
                        [java] [junit] ... 22 more


                        [java] BUILD FAILED
                        [java] /home/bruno/jbossesb-svn/product/build.xml:161: The following error occurred while executing this line:
                        [java] /home/bruno/jbossesb-svn/product/rosetta/build.xml:104: The following error occurred while executing this line:
                        [java] /home/bruno/jbossesb-svn/product/rosetta/tests/build.xml:166: The following error occurred while executing this line:
                        [java] /home/bruno/jbossesb-svn/product/rosetta/tests/build.xml:190: Test org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListenerUnitTest failed

                        [java] Total time: 3 minutes 45 seconds
                        [java] Java Result: 1

                        esb.init-app-server:

                        esb.init-esb-server:

                        esb.init-ftp-server:

                        esb.init:

                        stop-server:
                        [echo] Stopping local ESB server
                        [java] Shutdown message has been posted to the server.
                        [java] Server shutdown may take a while - check logfiles for completion
                        [echo] Waiting for ESB server to stop...

                        BUILD FAILED
                        /home/bruno/jbossesb-svn/integration-build.xml:11: The following error occurred while executing this line:
                        /home/bruno/jbossesb-svn/product/build.xml:491: Product Unit Test failure

                        Total time: 4 minutes 25 seconds


                        What do I do now?

                        One last annotation: I'm using JBoss AS 4.2.2, which says in its release notes that should be fully compatible with version 4.2.1. Should I switch to 4.2.1?

                        • 9. Re: Missing method isNotNull() in AssertArgument?
                          Daniel Bevenius Master

                          Do you by any chance have another jboss server running? The integration test starts a jboss instance which I think is causing a port conflict.

                          /Daniel

                          • 10. Re: Missing method isNotNull() in AssertArgument?
                            Bruno Unna Newbie

                            Nope, Daniel. There is no other server running. I'm positive because this is the first thing I do after turning on the machine. Anyway:


                            bruno@Unamuno:~/jbossesb-svn$ ps -FeH | grep java
                            bruno 26577 14585 0 720 748 0 17:53 pts/1 00:00:00 grep java

                            • 11. Re: Missing method isNotNull() in AssertArgument?
                              Bruno Unna Newbie

                              It works, finally!

                              I've switched back to JBoss AS 4.2.1, and now the integration test works like a charm.

                              Thank you all for your time and your help.