title: org.apache.openjpa.persistence.ArgumentException
body: <p>I m using Hibernate and EJB... I got EntityManager from Container, When i try to persist, I m hitting with below error.. Could some one help?</p>
  
  <p>[1/25/14 23:12:46:832 CST] 00000056 SystemOut     O 2014-01-25 23:12:46 ERROR XXXXXXXService:114 - XXXXX Screening Failed
   org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "XXXXXXXXVO@9941827f" to PersistenceCapable failed.  Ensure that it has been enhanced.
  FailedObject: com.XXXXX.XXXXX.XXXXX.vo.XXXXXVO@9941827f
      at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4665)
      at org.apache.openjpa.kernel.BrokerImpl.persistInternal(BrokerImpl.java:2626)
      at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2571)
      at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2554)
      at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2458)
      at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1077)
      at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:716)
      at com.ibm.ws.jpa.management.JPAExEmInvocation.persist(JPAExEmInvocation.java:317)
      at com.ibm.ws.jpa.management.JPAEntityManager.persist(JPAEntityManager.java:143)
      at XXXXXXX.persistCCCCResult(XXXXXXX.java:192)
      at XXXXXXX.prepareCCCCResponse(XXXXXXX.java:176)
      at XXXXXXX.requestCCCCCcreening(XXXXXXX.java:108)
      at XXXXXXXService.requestCCCCCcreening(CCCCCervice.java:59)
      at XXXXXXXXX,EJSRemote0SLCCCCCervice_0e27d761.requestCCCCCcreening(EJSRemote0SLCCCCCervice_0e27d761.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:611)
      at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java:609)
      at java.security.AccessController.doPrivileged(AccessController.java:280)
      at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:606)
      at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1177)
      at $Proxy225.requestCCCCCcreening(Unknown Source)
      at com.XXXXX.XXXXX.XXXXX.service.remote.XXXXX._CCCCCerviceRemote_Stub.requestCCCCCcreening(_CCCCCerviceRemote_Stub.java:1)
      at com.XXXXX.XXXXX.servlet.CCCCCcreening.doGet(CCCCCcreening.java:68)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
      at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1027)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)
      at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:522)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:311)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:282)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;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_2_0.xsd" version="2.0"&gt;
   &lt;persistence-unit name="poc" transaction-type="RESOURCE_LOCAL"&gt;
     &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; 
     &lt;class&gt;XXXXXXXXX.TempVO&lt;/class&gt;   
      &lt;properties&gt;
           &lt;property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver" /&gt;
           &lt;property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@XXXXXXXXX" /&gt;
           &lt;property name="javax.persistence.jdbc.user" value="XXXXX" /&gt;
           &lt;property name="javax.persistence.jdbc.password" value="XXXXX" /&gt;
           &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /&gt;
           &lt;property name="hibernate.show_sql" value="true" /&gt;
        &lt;/properties&gt; 
    &lt;/persistence-unit&gt;
  
   &lt;/persistence&gt;
  </code></pre>