IBM Support

PM52096: ORG.APACHE.OPENJPA.PERSISTENCE.ARGUMENTEXCEPTION IS SEEN WHEN EXECUTING A JPA QUERY DUE TO SPACES IN THE APPPLICATION NAME.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The user sees the following exception when executing a JPA
    query:
    
    Caused by: org.apache.openjpa.persistence.ArgumentException:
    Type
    "class testcases.res.ejb.subscriber.SubscriberBehavior" loaded
    by
    com.ibm.ws.classloader.CompoundClassLoader@2179f59[appwar:
    RESTestSubscriber]
    Local ClassPath: C:\Program
    Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\Ce
    ll\app.ear\app.jar;C:\Program
    Files\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\ce
    ll\app.ear\lib\app.jar
    Parent: com.ibm.ws.classloader.ProtectionClassLoader@38eede
    Delegation Mode: PARENT_LAST does not have persistence
    metadata.
    at
    org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.
    java:687)
    at
    org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool
    .
    java:753)
    at
    org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:65
    1)
    at
    org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMapp
    ings
    (JDBCBrokerFactory.java:154)
    at
    org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMapp
    ings
    (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
    com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityMana
    ger
    (EntityManagerFactoryImpl.java:71)
    at
    com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityMana
    ger
    (EntityManagerFactoryImpl.java:35)
    at
    com.ibm.ws.jpa.management.JPAEMPool.getEntityManager(JPAEMPool.j
    ava:
    140)
    at
    com.ibm.ws.jpa.management.JPATxEntityManager.getEMInvocationInfo
    (JPATxEntityManager.java:242)
    at
    com.ibm.ws.jpa.management.JPATxEntityManager.getEMInvocationInfo
    (JPATxEntityManager.java:174)
    at com.ibm.ws.jpa.management.JPAEntityManager.createQuery
    (JPAEntityManager.java:299)
    ... 13 more
    
    
    The issue is caused by the fact that the user has spaces (' ')
    in their app path.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V8.0.0 who use JPA and where their   *
    *                  application contains spaces in the          *
    *                  application name or any component which     *
    *                  contains spaces in its name.                *
    ****************************************************************
    * PROBLEM DESCRIPTION: ArgumentException is caused when        *
    *                      executing a JPA query due to spaces     *
    *                      in the application name.                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The issue is caused by the fact that the user has spaces (' ')
    in their application name. The spaces cause problems when
    parsing an orm.xml file because the path (URI/URL) to the
    orm.xml file contains a '%20' in place of the spaces. When a
    URI is created, spaces are replaced with '%20', as per the
    java.net.URI javadoc (i.e. the URI is 'encoded').  OpenJPA is
    retrieving this URI/URL from the application server and
    it is the Classloader which creates the URI/URL. In addition to
    retrieving the resource URI/URL from the application server,
    OpenJPA has a persistence unit URL which contains spaces (i.e.
    the persistence unit URL is not encoded).  As part of some
    necessary validation, OpenJPA compares the resource URI/URL to
    the persistence unit URL. In this case the URLs do not match
    given one has '%20' and one has spaces.  This causes OpenJPA
    to not parse/read the orm.xml, thus OpenJPA does not know about
    the meta data it contains and causes the exception the user is
    seeing.
    

Problem conclusion

  • With this fix, OpenJPA will properly handle URIs/URLs which
    are encoded.
    
    The fix for this APAR is currently targeted for inclusion in
    Service Level (Fix Pack) 8.0.0.3 of WebSphere Application
    Server version 8.0.0.
    
    Please refer to the recommended updates page for delivery
    information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM52096

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-11-11

  • Closed date

    2012-01-09

  • Last modified date

    2012-01-09

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R800 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
28 October 2021