Troubles running the MOM4J

Help
2004-04-27
2004-04-27
  • Jonas Beskow

    Jonas Beskow - 2004-04-27

    Hi

    I downloaded the src package and also downloaded all the needed .jar files. The ant script runs fine, but when i try to run anything I get alot of errors, even when I try to run your junit test. One item i think could be the reaosn for the errorrs is that I use xerces 2.6.x, cant locate the 2.4 version any where.

    Is there any solution to this problem or should i leave MOM4J, even if it seems to be a great product for our needs.

    This is parts of the tail i get when I run your junit test...
    --------------------------------
    C:\java\mom4j>java -version
    java version "1.4.2_04"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
    Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
    ---------------------------------
    C:\java\mom4j>ant -version
    Apache Ant version 1.5.1 compiled on January 10 2003
    ---------------------------------
    C:\java\mom4j>ant dist
    Buildfile: build.xml

    clean:
       [delete] Deleting directory C:\java\mom4j\classes
        [mkdir] Created dir: C:\java\mom4j\classes
       [delete] Deleting directory C:\java\mom4j\store
        [mkdir] Created dir: C:\java\mom4j\store

    compile-src:
        [javac] Compiling 110 source files to C:\java\mom4j\classes

    makelib:
       [delete] Deleting: C:\java\mom4j\lib\mom4j.jar
          [jar] Building jar: C:\java\mom4j\lib\mom4j.jar
       [delete] Deleting: C:\java\mom4j\lib\mom4j-client.jar
          [jar] Building jar: C:\java\mom4j\lib\mom4j-client.jar

    dist:
       [delete] Deleting: C:\java\mom4j\mom4j-src-dist.tar
        [touch] Creating C:\java\mom4j\lib\.empty
        [touch] Creating C:\java\mom4j\store\.empty
          [tar] Building tar: C:\java\mom4j\mom4j-src-dist.tar
       [delete] Deleting: C:\java\mom4j\lib\.empty
       [delete] Deleting: C:\java\mom4j\store\.empty

    BUILD SUCCESSFUL
    Total time: 4 seconds
    --------------------------------
    C:\java\mom4j>ant runtests
    Buildfile: build.xml

    compile-test:
        [javac] Compiling 23 source files to C:\java\mom4j\classes

    runtests:
         [java] java.io.IOException: Failed reading content-length: 'null'
         [java]     at org.mom4j.xcp.impl.XcpWorker.getContentLength(XcpWorker.java:121)
         [java]     at org.mom4j.xcp.impl.XcpWorker.work(XcpWorker.java:81)
         [java]     at org.mom4j.xcp.impl.XcpWorker.run(XcpWorker.java:63)
         [java] java.io.IOException: Failed reading content-length: 'null'
         [java]     at org.mom4j.xcp.XcpSender.recieveData(XcpSender.java:137)
         [java]     at org.mom4j.xcp.XcpSender.send(XcpSender.java:84)
         [java]     at org.mom4j.xcp.XcpSender.send(XcpSender.java:62)
         [java]     at org.mom4j.jndi.ContextImpl.bind(ContextImpl.java:95)
         [java]     at org.mom4j.jndi.ContextImpl.bind(ContextImpl.java:82)
         [java]     at javax.naming.InitialContext.bind(InitialContext.java:355)
         [java]     at org.mom4j.jndi.TestJNDI.testSuccess(TestJNDI.java:49)
         [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         [java]     at java.lang.reflect.Method.invoke(Method.java:324)
         [java]     at junit.framework.TestCase.runTest(TestCase.java:154)
         [java]     at junit.framework.TestCase.runBare(TestCase.java:127)
         [java]     at junit.framework.TestResult$1.protect(TestResult.java:106)
         [java]     at junit.framework.TestResult.runProtected(TestResult.java:124)
         [java]     at junit.framework.TestResult.run(TestResult.java:109)
         [java]     at junit.framework.TestCase.run(TestCase.java:118)
         [java]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
         [java]     at junit.framework.TestSuite.run(TestSuite.java:203)
         [java]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
         [java]     at junit.framework.TestSuite.run(TestSuite.java:203)
         [java]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
         [java]     at junit.framework.TestSuite.run(TestSuite.java:203)
         [java]     at junit.textui.TestRunner.doRun(TestRunner.java:116)
         [java]     at junit.textui.TestRunner.start(TestRunner.java:172)
         [java]     at junit.textui.TestRunner.main(TestRunner.java:138)

     
    • Jonas Beskow

      Jonas Beskow - 2004-04-27

      The issue is now solved (thanks Olle!), there where a spell error in org.mom4j.xcp.impl.XcpWorker, row 31.

      It said "Content-length" but should have been "Content-Length". After this fix the MOM works better.

      There is only one other minor thing you should fix and thats in the Build.xml file. You should add a hint and a variable for it regarding the -Dorg.mom4j.store  setting.

      / Jonas Beskow

       

Log in to post a comment.