OpenJPA
  1. OpenJPA
  2. OPENJPA-401

UnsatisfiedLinkError in MappingToolTask when using DB2 JDBC driver

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1, 1.0.2, 1.1.0
    • Component/s: None
    • Labels:
      None

      Description

      The MappingToolTask's class resolver loads classes from a temporary classloader before loading them in the "normal" classloader. This can cause problems if the JDBC driver requires access to native libraries (which can only be loaded once).

      I've seen errors like this when using the DB2 JCC driver and the IBM JDK :

      [mapping] 608 persistence-tests INFO [main] openjpa.Tool - Recording mapping and schema changes.
      [mapping] java.lang.UnsatisfiedLinkError: com/ibm/jvm/Trace.initTrace([Ljava/lang/String;[Ljava/lang/String;)V
      [mapping] at com.ibm.jvm.Trace.initializeTrace(Trace.java:96)
      [mapping] at com.ibm.jvm.Trace.<clinit>(Trace.java:61)
      [mapping] at java.lang.J9VMInternals.initializeImpl(Native Method)
      [mapping] at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
      [mapping] at java.lang.Class.forNameImpl(Native Method)
      [mapping] at java.lang.Class.forName(Class.java:130)
      [mapping] at com.ibm.db2.jcc.c.o.q(o.java:550)
      [mapping] at com.ibm.db2.jcc.c.o.<clinit>(o.java:319)
      [mapping] at java.lang.J9VMInternals.initializeImpl(Native Method)
      [mapping] at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
      [mapping] at java.lang.Class.forNameImpl(Native Method)
      [mapping] at java.lang.Class.forName(Class.java:130)
      [mapping] at com.ibm.db2.jcc.DB2Driver.class$(DB2Driver.java:48)
      [mapping] at com.ibm.db2.jcc.DB2Driver.<clinit>(DB2Driver.java:51)
      [mapping] at java.lang.J9VMInternals.initializeImpl(Native Method)
      [mapping] at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
      [mapping] at java.lang.Class.forNameImpl(Native Method)
      [mapping] at java.lang.Class.forName(Class.java:163)
      [mapping] at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:82)

      <snip>

      Note that this does not occur with the Sun JDK (or at least I haven't hit the problem.

      A potential solution is to change the order of the classloaders used in MappingToolTask.

        Activity

          People

          • Assignee:
            Michael Dick
            Reporter:
            Michael Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development