7 Replies Latest reply on Jul 15, 2009 11:09 AM by 807557

    JDK 1.5 Compatibility


      Until yesterday, all the applications i could execute with my JDK 1.5.0u18 were also able to execute with Java RTS 2.1. And it has always seemed logical to me.
      However, this morning i've tried to execute an application server (which is JavaEE 5 certified) with both JVMs. And surprisingly, i got an exception with Java RTS and i didn't get any with the "normal" JVM. And it didn't seem logical to me.
      What could have happened? Does Java RTS have a different Java classes' implementation?
        • 1. Re: JDK 1.5 Compatibility
          Java RTS 2.1 uses JDK 1.5.0_16 class libraries, plus some modifications needed for the RTSJ. So you may have encountered a bug fixed in 1.5.0_18.

          The Java RTS VM was based on JDK 1.5.0_04, so you might have encountered a bug in the VM that has not been backported to JRTS.

          The Java RTS VM also has different run-time dynamics that affect memory usage so you can sometimes run into differences there as well.

          But it all depends on what exception you actually encountered.

          David Holmes
          • 2. Re: JDK 1.5 Compatibility
            Thanks for answering, David.
            Reading the code of the class that was used, i found out that the error is caused by a NoClassDefFoundError. What is really weird. Do you want me to post here the message i got?
            (I mean "Isn't it a problem to mention names and etc?")
            • 3. Re: JDK 1.5 Compatibility
              NoClassDefFoundError can occur when initialization of a class failed and the class is marked as "erroneous". Subsequent attempts to load the class will throw NoClassDefFoundError.

              If you are using ITC that can also sometimes cause problems with classes loading/initialization out-f-order.

              Please post the exception info, or any class names you found - no problem there, names aren't secret :)

              • 4. Re: JDK 1.5 Compatibility
                I'm not using ITC, all that i did was changing the $JAVA_HOME variable from the path of my jdk 1.5.0_18 to the JRTS's path and executing it again.
                Why would the initialization of a class fail in Java RTS but not in a jdk 5.0?

                This is the error message i got :
                java.lang.IllegalStateException: Cannot create the Nullable object, a referenced class cannot be loaded: org/ow2/jonas/service/ServiceException
                at org.apache.felix.ipojo.handlers.dependency.Dependency.start(Dependency.java:314)
                at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.__start(DependencyHandler.java:456)
                at org.apache.felix.ipojo.handlers.dependency.DependencyHandler.start(DependencyHandler.java)
                at org.apache.felix.ipojo.HandlerManager.start(HandlerManager.java:103)
                at org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:295)
                at org.apache.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:155)
                at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:283)
                at org.apache.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:220)
                at org.apache.felix.ipojo.InstanceCreator$ManagedInstance.create(InstanceCreator.java:349)
                at org.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:84)
                at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
                at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:208)
                at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
                at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:669)
                at java.lang.Thread.run(Thread.java:713)
                • 5. Re: JDK 1.5 Compatibility
                  In 2.1 ITC sometimes changes the initialization order of classes and that can cause failures.

                  The error refers to:

                  java.lang.IllegalStateException: Cannot create the Nullable object, a referenced class cannot be loaded: org/ow2/jonas/service/ServiceException

                  which is some third-party code I have no idea about.

                  A couple of things you may be able to try to see what's going wrong:


                  this is very verbose but may allow you see if the class truly is not found, and if not, where it was looked for.

                  The other option is to run java_g and try:


                  but you have to realize that every class loaded by a non-bootstrap loader will first generate a ClassNotFoundException with the bootstrap loader and all loaders above the one that actually loads it.

                  Beyond that I don't know what to suggest.

                  David Holmes
                  • 6. Re: JDK 1.5 Compatibility
                    Ok, i'll try to execute that to see what's goin' on. A thing that i've just tried to do is to run it with JDK 1.5.0_04, but it has executed normally.
                    • 7. Re: JDK 1.5 Compatibility
                      Reading the trace i tried to find the line where the IllegalStateException is loaded and i found

                      [Loaded org.ow2.jonas.launcher.felix.util.JOnASUtils from file:/opensusehome/rodrigjc/Desktop/jonas-full-5.1.0-RC3/lib/bootstrap/felix-launcher.jar]
                      [Loaded java.lang.IllegalStateException from /home/rodrigjc/bin/jrts2.1/jre/lib/rt.jar]

                      Should I deduct that the line above contains the class that called this exception or it may not be related?

                      If the problem is the ITC, turning it off (-XX:-ITCRT) shouldn't solve it (i say "should" because i've tried it and i still have the same error)?