java.lang.ClassFormatError Running JaCoCo

Bob Bick
2012-08-21
2013-04-24
  • Bob Bick
    Bob Bick
    2012-08-21

    Hi All,

    Error-----

    The following ClassFormatError exception is occurring when running integration tests using JaCoCo (i.e. -javaagent:C:/jacoco/lib/jacocoagent.jar added to the Java command line):


    Test set: com.xxx.esl.general.GeneralIT

    Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 32.168 sec <<< FAILURE!
    testGetCodeTables(com.xxx.esl.general.sb.CodeTableServiceBeanTestCase)  Time elapsed: 6.068 sec  <<< ERROR!
    java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=oracle/jdbc/driver/T4CConnection, offset=0
         at java.lang.ClassLoader.defineClassImpl(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:540)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
         at java.net.URLClassLoader.access$300(URLClassLoader.java:79)
         at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1034)
         at java.security.AccessController.doPrivileged(AccessController.java:284)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:429)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
         at java.sql.DriverManager.getConnection(DriverManager.java:322)
         at java.sql.DriverManager.getConnection(DriverManager.java:297)
         at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:113)
         at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
         at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:150)

    Environment Details------------

    JaCoCo 0.5.9.201207300726
    Sonar 3.1.1
    Maven 2.2

    Question----------

    Has anyone seen this type of error before? Any solutions/suggestions to resolve this?

    Any help would be much appreciated.

    Kind Regards,

    Bob

     
  • Just to double check:

    1) You're using J9, right? What version?
    2) You verified that you code runs fine without the jacoco agent?
    3) What is the exact syntax you use for the JaCoCo agent? For example do you use any includes/excludes?

    Thanks,
    -marc