Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unknown abstract schema type

708171Jun 22 2009 — edited Jun 23 2009
Hi,

I've had a good look around the web and the forum for this and although it seems similar to existing threads, I think it is still something new/different, hence this thread.

I have a J2SE class lifted from Pro EJB 3 (listing 7-1) that allows me to repeatedly execute JPQL statements from a command prompt whilst developing a statement.

However, I'm consistenly getting the following error when running a simple query : 'SELECT l FROM Location l'
java.lang.IllegalArgumentException: An exception occured while creating a query in EntityManager
	at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.createQuery(EntityManagerImpl.java:209)
	at QueryTester.main(QueryTester.java:36)
Caused by: Exception [TOPLINK-8034] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Error compiling the query [SELECT l FROM Location l]. Unknown abstract schema type [Location].
Here are the contents of persistence.xml
<persistence
    xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
    http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">

	<persistence-unit name="agencyPU" transaction-type="RESOURCE_LOCAL">
			
		<class>com.amr.ejb.entity.TourOperator</class>
		<class>com.amr.ejb.entity.User</class>
		<class>com.amr.ejb.entity.UserSession</class>			
		<class>com.amr.ejb.entity.Location</class>
				
 		<properties>

			<property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/> 
			<property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/amragency_com"/> 
			<property name="toplink.jdbc.user" value="xxxx"/>
			<property name="toplink.jdbc.password" value="xxxx"/>
			 			
		</properties> 
	</persistence-unit>
</persistence>
My initial thoughts were that the class entries in persistence.xml where not being read. However, if I remove :
<class>com.amr.ejb.entity.TourOperator</class>
.... I get the following error on startup ...
[class com.amr.ejb.entity.TourOperator] uses a non-entity [class com.amr.ejb.entity.Location] as target entity in the relationship attribute [private com.amr.ejb.entity.Location com.amr.ejb.entity.TourOperator.location].
This would suggest the class entries are being parsed and 'investigated' properly on startup. Is that correct?

And if so, what is the problem I'm seeing ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2009
Added on Jun 22 2009
2 comments
3,399 views