Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 1.0.5, 1.2.3, 2.0.2, 2.1.1, 2.2.0
    • Component/s: samples
    • Labels:
      None
    • Environment:
      MacOS X 1.6.x

      Description

      It was reported on the OpenJPA User Forum that the samples were not working on the MacOS X architecture. I downloaded a copy and gave it a ran, and sure enough, it did not work. Basically, the problem was in the derby build itself, which attempted to load sun/security/pkcs11/SunPKCS11 and the MacOS X version of the class is apparently different enough from the version Derby was built against to be incompatible causing the LinkageError that I noted in the derby log:

      java.lang.LinkageError: loader (instance of sun/misc/Launcher$ExtClassLoader): attempted duplicate class definition for name: "sun/security/pkcs11/SunPKCS11"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at sun.security.jca.ProviderConfig$4.run(ProviderConfig.java:253)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:244)
      at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:224)
      at sun.security.jca.ProviderList.getProvider(ProviderList.java:215)
      at sun.security.jca.ProviderList.getService(ProviderList.java:313)
      at sun.security.jca.GetInstance.getInstance(GetInstance.java:140)
      at java.security.Security.getImpl(Security.java:659)
      at java.security.MessageDigest.getInstance(MessageDigest.java:129)
      at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1759)
      at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:52)
      at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:205)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:202)
      at java.io.ObjectStreamClass.writeNonProxy(ObjectStreamClass.java:667)
      at java.io.ObjectOutputStream.writeClassDescriptor(ObjectOutputStream.java:648)
      at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1253)
      at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1211)
      at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1290)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
      at org.apache.derby.iapi.services.io.FormatIdOutputStream.writeObject(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatableHashtable.writeExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdOutputStream.writeObject(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DDColumnDependableFinder.writeExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdOutputStream.writeObject(Unknown Source)
      at org.apache.derby.iapi.types.UserType.writeExternal(Unknown Source)
      at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(Unknown Source)
      at org.apache.derby.impl.store.raw.data.StoredPage.logRow(Unknown Source)
      at org.apache.derby.impl.store.raw.data.InsertOperation.writeOptionalDataToBuffer(Unknown Source)
      at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(Unknown Source)
      at org.apache.derby.impl.store.raw.data.LoggableActions.actionInsert(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BasePage.insertNoOverflow(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BasePage.insertAtSlot(Unknown Source)
      at org.apache.derby.impl.store.raw.data.StoredPage.insertAtSlot(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BasePage.insert(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapController.doInsert(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapController.insertAndFetchLocation(Unknown Source)
      at org.apache.derby.impl.sql.catalog.TabInfoImpl.insertRowListImpl(Unknown Source)
      at org.apache.derby.impl.sql.catalog.TabInfoImpl.insertRow(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(Unknown Source)
      at org.apache.derby.impl.sql.depend.BasicDependencyManager.addDependency(Unknown Source)
      at org.apache.derby.impl.sql.depend.BasicDependencyManager.copyDependencies(Unknown Source)
      at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.compileStatement(Unknown Source)
      at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.prepareAndRelease(Unknown Source)
      at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(Unknown Source)
      at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(Unknown Source)
      at org.apache.derby.impl.sql.compile.ExecSPSNode.generate(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
      at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
      at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.prepareMetaDataStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.prepareSPS(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQueryUsingSystemTables(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.doGetCols(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getColumns(Unknown Source)
      at org.apache.commons.dbcp.DelegatingDatabaseMetaData.getColumns(DelegatingDatabaseMetaData.java:218)
      at org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData.getColumns(DelegatingDatabaseMetaData.java:145)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingDatabaseMetaData.getColumns(LoggingConnectionDecorator.java:776)
      at org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData.getColumns(DelegatingDatabaseMetaData.java:145)
      at org.apache.openjpa.jdbc.sql.DBDictionary.getColumns(DBDictionary.java:4061)
      at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateTables(SchemaGenerator.java:524)
      at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchema(SchemaGenerator.java:364)
      at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:300)
      at org.apache.openjpa.jdbc.schema.SchemaTool.getDBSchemaGroup(SchemaTool.java:1163)
      at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:363)
      at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:340)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:505)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:456)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:160)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:164)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:122)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:210)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
      at hellojpa.Main.main(Main.java:43)

      I was able to resolve the issue by changing the classpath to reference an install of Derby that is shipped with every install of MacOS X (in /usr/share/derby). Opening this JIRA issue to update the OpenJPA samples so that they will choose the version of Derby that comes pre-installed on MacOS X.

        Activity

          People

          • Assignee:
            Jody Grassel
            Reporter:
            Jody Grassel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development