Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NoSuchMethod - sufix _vh(Works just with EAGER)
NoSuchMethod - sufix _vh [message #655199] Fri, 18 February 2011 10:51 Go to next message
Mauro Flores is currently offline Mauro Flores
Messages: 84
Registered: September 2009
Location: Brasil
Member
I have the folowing onetoone relationship: OcorrenciaED - OcorrenciaVinculoED. It works fine with FetchType.EAGER. When I change to LAZY and run a select over OcorrenciaED I get:
NoSuchMethodException: teste.ed.OcorrenciaED._persistence_getocorrenciaVinculoED_vh ()

The method getOcorrenciaVinculoED exists, but the one with suffix 'vh' doesn't.
Thaks for some hint.

Excerpt of the entity
@Entity
@Table(name = "KICC66D")
@IdClass(OcorrenciaPK.class)
public class OcorrenciaED  {
...
  @OneToOne(fetch=FetchType.LAZY)
  @JoinColumns( { @JoinColumn(name = "K66_ORG_REG", referencedColumnName = "K74_ORG_REG", insertable = false, updatable = false), @JoinColumn(name = "K66_AA_REGISTRO", referencedColumnName = "K74_AA_REGISTRO", insertable = false, updatable = false), @JoinColumn(name = "K66_NRO_INT", referencedColumnName = "K74_NRO_INT", insertable = false, updatable = false) })
  private OcorrenciaVinculoED                ocorrenciaVinculoED;
..
}


Complete Exception

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

Exception [EclipseLink-60] (Eclipse Persistence Services - 1.2.0.v20091016-r5565): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_setocorrenciaVinculoED_vh] or [_persistence_getocorrenciaVinculoED_vh] is not defined in the object [teste.ed.OcorrenciaED].
Internal Exception: java.lang.NoSuchMethodException: teste.ed.OcorrenciaED._persistence_getocorrenciaVinculoED_vh ()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[ocorrenciaV inculoED]
Descriptor: RelationalDescriptor(teste.ed.OcorrenciaED --> [DatabaseTable(KICC66D)])

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

java.lang.NullPointerException

at org.eclipse.persistence.internal.sessions.DatabaseSessionImp l.initializeDescriptors(DatabaseSessionImpl.java:478)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImp l.initializeDescriptors(DatabaseSessionImpl.java:406)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImp l.postConnectDatasource(DatabaseSessionImpl.java:671)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImp l.loginAndDetectDatasource(DatabaseSessionImpl.java:620)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryPro vider.login(EntityManagerFactoryProvider.java:231)
... (12 lines)
at weblogic.deployment.TransactionalEntityManagerProxyImpl$Quer yImpl.getResultList(TransactionalEntityManagerProxyImpl.java :224)
Re: NoSuchMethod - sufix _vh [message #655263 is a reply to message #655199] Fri, 18 February 2011 15:48 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1016
Registered: July 2009
Senior Member
Hello,

This indicates that the class is not being weaved correctly. As per http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_We b_Tutorial#EJB_module_with_.40PersistenceContext_Injection_s hould_be_first
can you verify that any EJB jar containing persistence units are placed preceed any WAR injecting a bean containing the persistence unit?

Best Regards,
Chris
Re: NoSuchMethod - sufix _vh [message #659258 is a reply to message #655263] Fri, 11 March 2011 12:05 Go to previous message
Mauro Flores is currently offline Mauro Flores
Messages: 84
Registered: September 2009
Location: Brasil
Member
As suggested the link I, changed the application.xml putting the reference to the web context after the reference of all ejbs.
The problem was solved.

Thanks Chris!

Mauro.
Previous Topic:Embeddable with ManyToMany relationship
Next Topic:MOXy support for inheritance (Java -> XML)
Goto Forum:
  


Current Time: Fri Jul 25 18:22:23 EDT 2014

Powered by FUDForum. Page generated in 0.01607 seconds