Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @Version and DescriptorException
@Version and DescriptorException [message #760320] Thu, 01 December 2011 20:57 Go to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
Member
I have an entity called Foo with an embedded class Boo. Both classes are declared in my persistence.xml. Boo is packaged in different jar than Foo. Foo is packaged in an EJB jar; Boo is packaged in an utility jar (app-inf/lib). Boo has a timestamp property.

Both jar are deployed and run successfully.

When I put @Version on timestamp property of Boo, I get following exception:

Exception [EclipseLink-93] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The table [FOO] is not present in this descriptor.
Descriptor: RelationalDescriptor(Foo --> [DatabaseTable(FOO)])


If I package Foo and Boo in the same ejb jar, this exception is not shown.

Thanks for any help.

Re: @Version and DescriptorException [message #761032 is a reply to message #760320] Mon, 05 December 2011 19:40 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
Odd. Can you include the full exception stack trace.
--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: @Version and DescriptorException [message #810944 is a reply to message #761032] Thu, 01 March 2012 18:10 Go to previous messageGo to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
Member
I'm back to this problem.

The problem happens only if I have two classes containing another one embedded and the embeded class has @Version property.
Foo is the Embedded class
Boo is one off the class that declares Foo
Doo is the other classe that declares Foo

The first time time I try to run the aplication I get the following exception:

Caused by:(5) org.eclipse.persistence.exceptions.IntegrityException 
Descriptor Exceptions: 
---------------------------------------------------------

Exception [EclipseLink-93] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The table [FOO] is not present in this descriptor.
Descriptor: RelationalDescriptor(mypackage.Doo --> [DatabaseTable(DOO)])

Runtime Exceptions: 
---------------------------------------------------------

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:471)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:666)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:615)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	... (6 lines)
	at weblogic.deployment.QueryProxyImpl.getResultList(QueryProxyImpl.java:124)
	at com.xyz.util.crud.CrudBDImpl.lista(CrudBDImpl.java:161)
	at com.xyz.util.crud.CrudBDImpl.lista(CrudBDImpl.java:179)
	at mypackage.aluno.AlunoRNImpl.lista(AlunoRNImpl.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



The second:

	
	Caused by:(4) org.eclipse.persistence.exceptions.JPQLException 
Exception Description: Error compiling the query [Doo.lista: select c from Doo c WHERE c.tituloCur LIKE :tituloCur AND c.vlrPreco = :vlrPreco], line 1, column 32: unknown state or association field [tituloCur] of class [mypackage.ed.Doo].
	at org.eclipse.persistence.exceptions.JPQLException.unknownAttribute(JPQLException.java:457)
	at org.eclipse.persistence.internal.jpa.parsing.DotNode.validate(DotNode.java:88)
	at org.eclipse.persistence.internal.jpa.parsing.LikeNode.validate(LikeNode.java:43)
	at org.eclipse.persistence.internal.jpa.parsing.Node.validate(Node.java:91)
	at org.eclipse.persistence.internal.jpa.parsing.LogicalOperatorNode.validate(LogicalOperatorNode.java:39)
	... (19 lines)
	at weblogic.deployment.QueryProxyImpl.getResultList(QueryProxyImpl.java:124)
	at com.xyz.util.crud.CrudBDImpl.lista(CrudBDImpl.java:161)



When I take the annotation @Version of Boo the problem disapear.
When just one Entity declares Boo the problem disapear too.
Re: @Version and DescriptorException [message #813716 is a reply to message #810944] Mon, 05 March 2012 16:34 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

This error does not occur if you package both classes in the same jar?
That is odd, please include your persistence.xml file.


James : Wiki : Book : Blog : Twitter
Re: @Version and DescriptorException [message #813858 is a reply to message #813716] Mon, 05 March 2012 19:49 Go to previous messageGo to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
Member
Quote:
This error does not occur if you package both classes in the same jar?

It DOES happen even packaging all classes in the same jar.
I've just checked, the problem happens even if all classes have the same package (qualified name).

Quote:
That is odd, please include your persistence.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<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="XYZ">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<jta-data-source>XyzDS</jta-data-source>
		<mapping-file>META-INF/orm.xml</mapping-file>
		<class>Foo</class>		
		<class>Boo</class>
		<class>Doo</class>
		<properties>
			<property name="eclipselink.logging.level" value="INFO" />
		</properties>
	</persistence-unit>
</persistence>

[Updated on: Mon, 05 March 2012 20:12]

Report message to a moderator

Re: @Version and DescriptorException [message #825161 is a reply to message #813858] Tue, 20 March 2012 14:53 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

But you said in your first post,

>> If I package Foo and Boo in the same ejb jar, this exception is not shown.

So, that was false?

Try the latest release, this may have been something that was fixed. Otherwise log a bug, it seems like the version field is not getting initialized correctly.


James : Wiki : Book : Blog : Twitter
Previous Topic:application freeze
Next Topic:"No [EntityType] was found" Error with Spring 3.0.5 and EclipseLink 2.3.2
Goto Forum:
  


Current Time: Wed Nov 26 03:15:44 GMT 2014

Powered by FUDForum. Page generated in 0.12829 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software