<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    OSGI + human task persistence
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/grischan">Grischan Engel</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/754461#754461">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p style="text-align: justify;">Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: justify;">I am currently trying to use human tasks (jBPM 5.3)&#160; in an application based on OSGI (Equinox).&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: justify;">As far as I know Hibernate doesn&rsquo;t really support OSGI. So I decided to use Eclipse Gemini JPA for persistence. Though I can`t make it work. Seemingly the OSGI JPA specification requires all entities and metadata to be contained in a single persistence bundle. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: justify;">I get the following Exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [jbpm.unit] failed.
Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Could not load the field named [processInstanceId] on the <font color="navy"><b>class</b></font> [<font color="navy"><b>class</b></font> org.jbpm.persistence.processinstance.ProcessInstanceInfo]. Ensure there is a corresponding field with that name defined on the class.
&#160;&#160;&#160; at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1541)
&#160;&#160;&#160; at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1532)
&#160;&#160;&#160; at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:98)
&#160;&#160;&#160; at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:306)
&#160;&#160;&#160; at org.eclipse.gemini.jpa.provider.GeminiOSGiInitializer.initializeFromBundle(GeminiOSGiInitializer.java:120)
&#160;&#160;&#160; at org.eclipse.gemini.jpa.provider.EclipseLinkOSGiProvider.assignPersistenceUnitsInBundle(EclipseLinkOSGiProvider.java:193)
&#160;&#160;&#160; at org.eclipse.gemini.jpa.PersistenceBundleExtender.tryAssigningPersistenceUnitsInBundle(PersistenceBundleExtender.java:175)
&#160;&#160;&#160; at org.eclipse.gemini.jpa.PersistenceBundleExtender.bundleChanged(PersistenceBundleExtender.java:317)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)
&#160;&#160;&#160; at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
&#160;&#160;&#160; at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1569)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1505)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1500)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:486)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:251)
&#160;&#160;&#160; at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:174)
&#160;&#160;&#160; at java.lang.Thread.run(Unknown Source)
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: justify;">Could you give me some hints which setup might work to use human tasks in an OSGI environment? Does someone have a working project in an OSGI environment which uses Eclipse Gemini JPA, Hibernate or some other JPA Provider?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: justify;">Thanks,</p><p style="text-align: justify;">Grischan</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/754461#754461">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>