Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2035

Tomee+OpenEJB+OpenJPA: deployment-time JPA enhancement trouble

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 4.5.2
    • Fix Version/s: None
    • Component/s: deployment
    • Labels:
      None

      Description

      Hello,

      I am struggling to get JPA working with deployment-time enhancement.
      When I attempt to persist an entity I receive the exception below.
      I have added 'openejb.jpa.deploy-time-enhancement=true' to Tomee's catalina.property, which is picked up properly according to the logs.

      Caused by: javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is: 
      	<openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "1234 [java.lang.String]" to PersistenceCapable failed.  Ensure that it has been enhanced.
      FailedObject: 1234 [java.lang.String]
      	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
      	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:283)
      	at com.bankapp.service.blacklist.BlackListEJB$LocalBeanProxy.addToBlackList(com/bankapp/service/blacklist/BlackListEJB.java)
      	at com.bankapp.servlet.AddToBlackListServlet.doGet(AddToBlackListServlet.java:40)
      	... 19 more
      

      See the attachment for the webapp to reproduce the problem.
      The relevant Tomee config files can be found at src/test/resources/tomee.

      Environment:
      Tomee:1.5.2 Plus
      OpenEJB: 4.5.2
      OpenJPA: 2.2.0
      JDK: 1.7.0_21, Windows 7, 64 bit
      H2DB: 1.3.170

        Attachments

        1. ejb-jpa.zip
          13 kB
          Apache Fan
        2. ejb-jpa2.zip
          17 kB
          Apache Fan

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              apache_fan Apache Fan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: