JBoss Community

Re: Having issues getting a KnowledgeSession when using JPA persistence

created by Marshall Lucas in jBPM - View the full discussion

Fixed it using a bit of Maven Ant-Run magick.  Have to modify the manifest of the knowledge-api jar file to have a Require-Bundle: org.drools.persistence-jpa directive on it.

<code>

          <plugin>

                <artifactId>maven-antrun-plugin</artifactId>

                <version>1.4</version>

                <executions>

                    <execution>

                        <phase>install</phase>

                        <configuration>

                            <tasks>

                                <!-- Major Magick here, allows the Knowledge-API bundle split package to -->

                                <!-- find the rest of the package in the persistence bundle.  This adds  -->

                                <!-- the Require-Bundle: org.drools.persistnce-jpa directive to the      -->

                                <!-- MANIFEST.MF within the knowledge-api jar file.                      -->

                                <jar file="${basedir}/target/system/org/drools/knowledge-api/5.5.0.Final/knowledge-api-5.5.0.Final.jar" update="true">

                                    <manifest>

                                        <attribute

                                            name="Require-Bundle"

                                            value="org.drools.persistence-jpa;bundle-version=5.5.0.Final" />

                                    </manifest>

                                </jar>

                                <!-- Build the executable version of full Karaf/Felix OSGi ESB Container -->

                                <!-- with all required bundles and APWS features installed               -->

                                <copy todir="/devel/apws">

                                    <fileset dir="${basedir}/resources" includes="**/*" />

                                    <fileset dir="${basedir}/target" includes="system/**/*" />

                                </copy>

                            </tasks>

                        </configuration>

                        <goals>

                            <goal>run</goal>

                        </goals>

                    </execution>

                </executions>

            </plugin>

</code>

 

Marshall

Reply to this message by going to Community

Start a new discussion in jBPM at Community