Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

enhancement ?? ejb3 entity

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem with my first ejb3 entity.

Hi I have just attempted to make my first ejb3 entity, but I get an error stating that it have not been enhanced. and I have no idea of what it is talking about ?
I have tried to search for an answer but still been unable to find any.

I get this error.

[09-03-19 09:19:50:380 CET] 00000026 SystemOut O StatelessUserBean:increment - caught unexpected exception: <openjpa-1.0.3-SNAPSHOT-r420667:649224 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "com.incase.orp.ejb.cmp.JPAUserEntity@3b983b98" to PersistenceCapable failed. Ensure that it has been enhanced.
FailedObject: com.incase.orp.ejb.cmp.JPAUserEntity@3b983b98
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are <openjpa-1.0.3-SNAPSHOT-r420667:649224 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "com.incase.orp.ejb.cmp.JPAUserEntity@3b983b98" to PersistenceCapable failed. Ensure that it has been enhanced.
FailedObject: com.incase.orp.ejb.cmp.JPAUserEntity@3b983b98
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4286)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2365)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2225)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1005)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:541)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at com.ibm.ws.jpa.management.JPAExEmInvocation.persist(JPAExEmInvocation.java:348)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at com.ibm.ws.jpa.management.JPAEntityManager.persist(JPAEntityManager.java:109)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at com.incase.orp.ejb.cmp.UsersSessionBean.update(UsersSessionBean.java:51)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at java.lang.reflect.Method.invoke(Method.java:618)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:547)
[09-03-19 09:19:50:380 CET] 00000026 SystemErr are at com.incase.orp.ejb.cmp.Audit.methodChecker(Audit.java:15)

I have this method in a session bean:

and my interceptor is

and my bean is like this:

and with getters and setters for the rest of the fields aswell making them into the bean properties.

and my persistence xml looks like this:

I call it from a servlet, and this call seems to be fine, it is only in the em.persist that seems to fail, and I am at a loss as to why ?? and what is this enhancement the error is talking about ?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic