Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-1728

Karaf itest fail on IBM JDK due to Pax Exam annotations not found

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • karaf-1.0.0
    • karaf-1.2.0
    • Karaf
    • None

    Description

      Due to a difference in the way the IBM JDK handles annotations (it fails on annotations not on the classpath instead of ignoring them), the following tests fail:
      org.apache.felix.karaf.shell.itests.FeaturesTest.testFeatures [equinox]
      org.apache.felix.karaf.shell.itests.CoreTest.testHelp [equinox]
      org.apache.felix.karaf.shell.itests.CoreTest.testInstallCommand [equinox]

      Cfr. http://lists.ops4j.org/pipermail/general/2009q4/003296.html for background information

      the error looks like this:

      java.lang.TypeNotPresentException: Type org.ops4j.pax.exam.junit.Configuration not present
      at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
      at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
      at com.ibm.oti.reflect.Method.getDeclaredAnnotations(Method.java:31)
      at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:722)
      at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:191)
      at com.ibm.oti.reflect.Method.getAnnotation(Method.java:20)
      at java.lang.reflect.Method.getAnnotation(Method.java:711)
      at org.ops4j.pax.exam.junit.extender.impl.internal.CallableTestMethodImpl.getAnnotatedMethods(CallableTestMethodImpl.java:295)
      at org.ops4j.pax.exam.junit.extender.impl.internal.CallableTestMethodImpl.runBefores(CallableTestMethodImpl.java:162)
      at org.ops4j.pax.exam.junit.extender.impl.internal.CallableTestMethodImpl.injectContextAndInvoke(CallableTestMethodImpl.java:124)
      at org.ops4j.pax.exam.junit.extender.impl.internal.CallableTestMethodImpl.call(CallableTestMethodImpl.java:101)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:80)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:309)
      at sun.rmi.transport.Transport$1.run(Transport.java:168)
      at java.security.AccessController.doPrivileged(AccessController.java:279)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:164)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:506)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest(TCPTransport.java:838)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:912)
      at java.lang.Thread.run(Thread.java:810)
      Caused by: java.lang.ClassNotFoundException: org.ops4j.pax.exam.junit.Configuration
      at java.lang.Class.forName(Class.java:163)
      at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:33)
      ... 27 more

      The test launches okay, but the pax Configuration annotation class cannot be found. Adding the jar that contains the class, pax-exam-junit as a bundle in the test when we detect that we are using the ibm jdk allows the test to pass.

      Attachments

        Activity

          People

            gertvanthienen Gert Vanthienen
            gertvanthienen Gert Vanthienen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: