[ 
https://issues.apache.org/jira/browse/OPENJPA-1042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-1042.
--------------------------------------
    Resolution: Won't Fix

Closing as obsolete during backlog cleanup: named-query in orm.xml is parsed on 
master (XMLPersistenceMetaDataParser). The report relies on a dead sourceforge 
orm.xml with no reproducer, so it is a 1.2.1 support question that most likely 
comes from element ordering or schema problems in the user's file. Please 
reopen if this still happens with OpenJPA 4.x.

> can't define named-query in configuration orm.xml
> -------------------------------------------------
>
>                 Key: OPENJPA-1042
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1042
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Giovanni Azua
>            Priority: Major
>
> Having a orm.xml define like (see the two named-query):
> http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-jee/src/test/resources/META-INF/orm.xml?view=markup
> and a test case like "testFindByNamedQueryPositional" 
> "testFindByNamedQueryNamed":
> http://perfectjpattern.svn.sourceforge.net/viewvc/perfectjpattern/trunk/perfectjpattern-jee/src/test/java/org/perfectjpattern/jee/integration/dao/TestJpaBaseReadOnlyDao.java?view=markup
> I get the following exception stack:
> 110  default  INFO   [main] openjpa.Runtime - Starting OpenJPA 1.2.1
> 297  default  INFO   [main] openjpa.jdbc.JDBC - Using dictionary class 
> "org.apache.openjpa.jdbc.sql.HSQLDictionary".
> org.perfectjpattern.jee.api.integration.dao.DaoException: 
> <openjpa-1.2.1-r752877:753278 nonfatal general error> 
> org.apache.openjpa.persistence.PersistenceException: 
> org.xml.sax.SAXException: 
> file:/D:/code/perfectjpattern/perfectjpattern-jee/target/test-classes/META-INF/orm.xml
>  [Location: Line: 23, C: 44]: org.xml.sax.SAXParseException: 
> cvc-complex-type.2.4.a: Invalid content was found starting with element 
> 'named-query'. One of '{"http://java.sun.com/xml/ns/persistence/orm":entity, 
> "http://java.sun.com/xml/ns/persistence/orm":embeddable}' is expected.
> I double checked in the JPA orm.xml documentation and seems there is nothing 
> wrong with defining the named-queries there ... in fact MyEclipse 
> autocompleter sees the named-query entry as correct, only when running the 
> test cases that use OpenJPA brings this issue



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to