IBM Support

PM78785: MISLEADING "FOUND DUPLICATE QUERY" WARNING MESSAGE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Even when unique @NamedQuery is defined in application, the
    following misleading warning message is posted in the
    SystemOut.log file...
    
    [10/31/12 10:00:03:249 CET] 000000ec MetaData W
    openjpa.MetaData: Warn: Found duplicate query
    "TestGroup.findByPrimaryKey" in "class
    com.test.testpackage.TestGroup Entity". Ignoring.
    
    This problem is documented in OPENJPA-570
    
    https://issues.apache.org/jira/browse/OPENJPA-570
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server V6.1.0 Feature Pack for Enterprise   *
    *                  JavaBeans 3.0 who define @NamedQuery.       *
    ****************************************************************
    * PROBLEM DESCRIPTION: A misleading warning message is         *
    *                      printed which indicates a duplicate     *
    *                      query exists.                           *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The following misleading warning message is posted in
    the system log:
    openjpa.MetaData - Found duplicate query
    "getEmployeeOrdered" in "class employee.list.Employee".
    Ignoring.
    In this case, the query "getEmployeeOrdered" is only defined
    once, thus making this warning misleading.  This message should
    only be printed when a user has actually duplicated
    an @NamedQuery definition.
    The reason this message is posted is because the same entity
    is being "parsed" twice, once from:
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parseNamedQueries(AnnotatedElement, NamedQuery...)
    line: 1571
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parseClassAnnotations() line: 547
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parse(Class) line: 352
    PersistenceMappingFactory(PersistenceMetaDataFactory).load(Class
    , int, ClassLoader) line: 229
    MappingRepository(MetaDataRepository).getQueryMetaDataInternal(C
    lass, String, ClassLoader) line: 1664
    MappingRepository(MetaDataRepository).getQueryMetaData(Class,
    String, ClassLoader, boolean) line: 1603
    EntityManagerImpl.createNamedQuery(String) line: 97
    EntityManagerImpl.createNamedQuery(String) line: 37
    and subsequently from:
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parseNamedQueries(AnnotatedElement, NamedQuery...)
    line: 1571
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parseClassAnnotations() line: 547
    AnnotationPersistenceMappingParser(AnnotationPersistenceMetaData
    Parser).parse(Class) line: 352
    PersistenceMappingFactory(PersistenceMetaDataFactory).load(Class
    , int, ClassLoader) line: 229
    MappingRepository(MetaDataRepository).getMetaDataInternal(Class,
    ClassLoader) line: 475
    MappingRepository(MetaDataRepository).getMetaData(Class,
    ClassLoader, boolean) line: 295
    MappingRepository(MetaDataRepository).getMetaData(String,
    ClassLoader, boolean) line: 364
    QueryImpl.classForName(String, String[]) line: 1563
    ExpressionStoreQuery$1.classForName(String, String[]) line: 108
    JPQLExpressionBuilder.getClassMetaData(String, boolean) line:
    168
    JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder
    $JPQLNode) line: 139
    JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder
    $JPQLNode) line: 225
    JPQLExpressionBuilder.getCandidateMetaData() line: 195
    JPQLExpressionBuilder.getCandidateType() line: 188
    JPQLExpressionBuilder.access$600(JPQLExpressionBuilder) line:
    69
    JPQLExpressionBuilder$ParsedJPQL.populate(ExpressionStoreQuery)
    line: 1749
    JPQLParser.populate(Object, ExpressionStoreQuery) line: 56
    JDBCStoreQuery(ExpressionStoreQuery).populateFromCompilation(Obj
    ect) line: 153
    QueryImpl.newCompilation() line: 657
    QueryImpl.compilationFromCache() line: 638
    QueryImpl.compileForCompilation() line: 604
    QueryImpl.compileForExecutor() line: 666
    QueryImpl.compile() line: 573
    EntityManagerImpl.createNamedQuery(String) line: 105
    EntityManagerImpl.createNamedQuery(String) line: 37
    

Problem conclusion

  • With this fix, code has been added to OpenJPA to ensure that a
    @NamedQuery is only parsed once, and thus avoid the warning
    message when the named query is defined only once.  This
    warning message will be printed in cases where it is
    necessary (that is, when the user has duplicated a named
    query).
    
    The fix for this APAR is currently targeted for inclusion
    in Enterprise JavaBeans 3.0 Feature Pack Fix Pack 47
    (6.1.0.47) of WebSphere Application Server version
    6.1.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

    PM78785

  • Reported component name

    WAS EJB3 FEATUR

  • Reported component ID

    5724J0851

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-12-08

  • Closed date

    2013-01-08

  • Last modified date

    2013-01-08

  • 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

    WAS EJB3 FEATUR

  • Fixed component ID

    5724J0851

Applicable component levels

  • R610 PSY

       UP

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

Document Information

Modified date:
10 February 2022