This discussion is archived
3 Replies Latest reply: Aug 2, 2013 8:12 AM by Paendrag RSS

Deployment Issue with EclipseLink 2.4.1

422827 Newbie
Currently Being Moderated
Hello,

I am trying to include EclipseLink 2.4.1 in my ear file (APP-INF/lib/eclipselink.jar), with below FilteringClassLoader setup in weblogic-application.xml. I am using Weblogic 10.3.6. I thought this should override the default EclipseLink and JPA jars provided by Weblogic. However I got NoClassDefFoundError during deployment as shown below. Maybe I have missed something. Any insight would be appreciated.

Thanks!
Jeffrey

===== weblogic-application.xml ===========
<prefer-application-packages>
<package-name>com.sun.activation.*</package-name>
<package-name>commonj.sdo.impl.*</package-name>
<package-name>javax.activation.*</package-name>
<package-name>javax.persistence.*</package-name>
<package-name>javax.persistence.criteria.*</package-name>
<package-name>javax.persistence.metamodel.*</package-name>
<package-name>javax.persistence.spi.*</package-name>
<package-name>org.apache.commons.*</package-name>
<package-name>org.eclipse.persistence.*</package-name>
</prefer-application-packages>
==============================

===== error during deployment ==============
java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceProvider
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
     at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
     Truncated. see log file for complete stacktrace
Caused By: java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceProvider
     at java.lang.ClassLoader.defineClass1(Native Method)

Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.WrappedDeploymentException: javax/persistence/spi/PersistenceProvider
     at java.lang.ClassLoader.defineClass1(Native Method)
======================================
  • 1. Re: Deployment Issue with EclipseLink 2.4.1
    JamesSutherland Pro
    Currently Being Moderated
    I think the best way to upgrade the version is using a shared library,

    see,

    http://buttso.blogspot.com/2011/07/plugging-in-later-version-of.html

    You could also always just replace the jar in WebLogic modules, or add the new jar to domain/lib.
  • 2. Re: Deployment Issue with EclipseLink 2.4.1
    422827 Newbie
    Currently Being Moderated
    Thanks James. Great info. I will try the shared library option. We have 4 different applications running on the same Weblogic server. And we'd like to able to control which application is using what version of EclipseLink.

    Anther issue we encountered is that, BLOB insert throws out exception on Weblogic 10.3.6 (eclipselink 2.3.1) after we upgraded from Weblogic 10.3.5 (with eclipselink 2.1.3). This only happens to our oldest application which uses the deployment xml (the mapping file). This app was originally developed using TopLink 6 years ago. Our other apps which use JPA implementation seem work fine. Below are the details. Are there any changes in this area with 2.3.1?

    EJB3.0 method to insert file attachment BLOB:
    AppAttachment has: private byte[] fileContent;
    ==================================================
    public void addFileAttachment(AppCert appCert, AppAttachment attachment,
    String userId) throws PCITDBException {
    Session session = getSessionFactory().acquireSession();

    try {
    UnitOfWork uow = session.acquireUnitOfWork();

    AppCert appCertWorkingCopy = (AppCert)uow.readObject(appCert);

    AppCertAttachment attachmentLink = new AppCertAttachment();
    attachmentLink.setAppAttachment(attachment);
    attachmentLink.setCreateDate(new Date());
    attachmentLink.setUpdateDate(new Date());
    attachmentLink.setUpdateUser(userId);
    attachmentLink.setCreateUser(userId);
    attachment.addAppCertAttachment(attachmentLink);
    appCertWorkingCopy.addAppCertAttachment(attachmentLink);

    // fix BLOB issue with weblogic jdbc driver
    ((Oracle8Platform)session.getPlatform()).setShouldUseLocatorForLOBWrite(false);

    uow.commit();
    session.release();
    } catch (Exception ex) {
    log.error("Exception occurred in addFileAttachment() ... ", ex);
    throw new PCITDBException(ex);
    } finally {
    if (session.isConnected()) {
    session.release();
    }
    }
    }
    ========================================================

    Exception during insert
    ========================================================
    <Stdout> <aphpcitpvsa06> <PCIT> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1365175142236> <BEA-000000> <[EL Warning]: 2013-04-05 10:19:02.235--UnitOfWork(-895679171)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--java.lang.NullPointerException
         at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:366)
         at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
         at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
         at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:472)
         at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
         at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
         at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:287)
         at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
         at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
         at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:743)
         at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
         at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
         at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1449)
         at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224)
         at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsForClassWithChangeSet(CommitManager.java:191)
         at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:136)
         at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3799)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1415)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3143)
         at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3124)
         at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
         at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
         at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1244)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1219)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:121)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1355)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2172)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:267)
         at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:622)
         at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
         at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:52)
         at pcit.model.services.Application572_q5c5qo_Application572LocalImpl.addFileAttachment(Unknown Source)
         at view.backing.application.FileUploadBean.upload(FileUploadBean.java:115)
    =====================================================================================
  • 3. Re: Deployment Issue with EclipseLink 2.4.1
    Paendrag Newbie
    Currently Being Moderated

    Did you resolve this? If so, can you share how?

     

    I am getting the same problem error.  It seems to work when testing with the integrated WLS in JDeveloper, but not after I deploy to a standalone server with WebLogic.  Also, with me, it seems to only happen with one insert; others are working fine.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points