Hello!<div><br></div><div>I finally managed to get it working, but it required some changes in the existent stuff...</div><div>Here is a diff:</div><div><br></div><div>git://<a href="http://github.com/droolsjbpm/drools.git">github.com/droolsjbpm/drools.git</a></div>
<div><div>diff --git a/drools-compiler/pom.xml b/drools-compiler/pom.xml</div><div>index 708a5b2..4b1dc98 100644</div><div>--- a/drools-compiler/pom.xml</div><div>+++ b/drools-compiler/pom.xml</div><div>@@ -244,7 +244,7 @@</div>
<div> <_removeheaders>Ignore-Package</_removeheaders></div><div> <Bundle-SymbolicName>org.drools.compiler;singleton:=true</Bundle-SymbolicName></div><div> <Require-Bundle>org.drools.core;visibility:=reexport;bundle-version="${drools.osgi.version}"</Require-Bundle></div>
<div>- <Import-Package>!org.drools.*,</div><div>+ <Import-Package>org.antlr.*;version="3.4",!org.drools.*,</div><div> <!-- java compilers are optional: only need one at most --></div>
<div> org.codehaus.janino.*;resolution:=optional,org.eclipse.jdt.*;resolution:=optional,</div><div> *</Import-Package></div></div><div><br></div><div>git://<a href="http://github.com/droolsjbpm/droolsjbpm-integration.git">github.com/droolsjbpm/droolsjbpm-integration.git</a></div>
<div><div>diff --git a/drools-camel/pom.xml b/drools-camel/pom.xml</div><div>index a5a6b3d..273bfaa 100644</div><div>--- a/drools-camel/pom.xml</div><div>+++ b/drools-camel/pom.xml</div><div>@@ -23,7 +23,7 @@</div><div> <dependency></div>
<div> <groupId>org.drools</groupId></div><div> <artifactId>knowledge-internal-api</artifactId></div><div>- </dependency> </div><div>+ </dependency></div><div> <dependency></div>
<div> <groupId>org.drools</groupId></div><div> <artifactId>drools-core</artifactId></div><div>@@ -186,5 +186,44 @@</div><div> <scope>provided</scope></div><div> </dependency></div>
<div> </dependencies></div><div>-</div><div>+ <build></div><div>+ <plugins></div><div>+ <plugin></div><div>+ <artifactId>maven-jar-plugin</artifactId></div><div>+ <configuration></div>
<div>+ <archive></div><div>+ <manifestFile>META-INF/MANIFEST.MF</manifestFile></div><div>+ </archive></div><div>+ </configuration></div><div>+ </plugin></div>
<div>+ <plugin></div><div>+ <groupId>org.apache.felix</groupId></div><div>+ <artifactId>maven-bundle-plugin</artifactId></div><div>+ <extensions>true</extensions></div>
<div>+ <executions></div><div>+ <execution></div><div>+ <id>manifest</id></div><div>+ <phase>process-classes</phase></div><div>+ <goals></div>
<div>+ <goal>manifest</goal></div><div>+ </goals></div><div>+ </execution></div><div>+ </executions></div><div>+ <configuration></div><div>
+ <manifestLocation>META-INF</manifestLocation></div><div>+ <instructions></div><div>+ <Bundle-SymbolicName>org.drools.camel;singleton:=true</Bundle-SymbolicName></div>
<div>+ <_removeheaders>Ignore-Package</_removeheaders></div><div>+ <Require-Bundle></div><div>+ org.drools.core;bundle-version="${drools.osgi.version}",</div>
<div>+ org.drools.spring;bundle-version="${drools.osgi.version}"</div><div>+ </Require-Bundle></div><div>+ <Import-Package>!org.drools.*, *</Import-Package></div>
<div>+ <Export-Package>!org.drools.grid, org.drools.camel.*, org.drools.camel.jax</Export-Package></div><div>+ <DynamicImport-Package>org.drools.*</DynamicImport-Package></div>
<div>+ </instructions></div><div>+ </configuration></div><div>+ </plugin></div><div>+ </plugins></div><div>+ </build></div><div> </project></div><div>diff --git a/drools-container/drools-spring/pom.xml b/drools-container/drools-spring/pom.xml</div>
<div>index b6be52c..f83a457 100644</div><div>--- a/drools-container/drools-spring/pom.xml</div><div>+++ b/drools-container/drools-spring/pom.xml</div><div>@@ -126,7 +126,45 @@</div><div> <groupId>org.antlr</groupId></div>
<div> <artifactId>antlr-runtime</artifactId></div><div> <scope>test</scope></div><div>- </dependency> </div><div>+ </dependency></div><div> </dependencies></div>
<div>-</div><div>+ <build></div><div>+ <plugins></div><div>+ <plugin></div><div>+ <artifactId>maven-jar-plugin</artifactId></div><div>+ <configuration></div><div>
+ <archive></div><div>+ <manifestFile>META-INF/MANIFEST.MF</manifestFile></div><div>+ </archive></div><div>+ </configuration></div><div>+ </plugin></div>
<div>+ <plugin></div><div>+ <groupId>org.apache.felix</groupId></div><div>+ <artifactId>maven-bundle-plugin</artifactId></div><div>+ <extensions>true</extensions></div>
<div>+ <executions></div><div>+ <execution></div><div>+ <id>manifest</id></div><div>+ <phase>process-classes</phase></div><div>+ <goals></div>
<div>+ <goal>manifest</goal></div><div>+ </goals></div><div>+ </execution></div><div>+ </executions></div><div>+ <configuration></div><div>
+ <manifestLocation>META-INF</manifestLocation></div><div>+ <instructions></div><div>+ <Bundle-SymbolicName>org.drools.spring;singleton:=true</Bundle-SymbolicName></div>
<div>+ <_removeheaders>Ignore-Package</_removeheaders></div><div>+ <Require-Bundle>org.drools.core;bundle-version="${drools.osgi.version}"</Require-Bundle></div><div>
+ <Import-Package>!org.drools.*, *</Import-Package></div><div>+ <Export-Package></div><div>+ org.drools.grid,org.drools.grid.impl,org.drools.container.spring</div><div>
+ </Export-Package></div><div>+ <DynamicImport-Package>org.drools.*</DynamicImport-Package></div><div>+ </instructions></div><div>+ </configuration></div>
<div>+ </plugin></div><div>+ </plugins></div><div>+ </build></div><div> </project></div></div><div><br></div><div>Alex<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 6:01 PM, Alexander Filipchik <span dir="ltr"><<a href="mailto:afilipchik@gmail.com">afilipchik@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you! But didn't help.<div>Actually I see some weird behavior. I decided to try referring drools-core using Require-Bundle from my bundle, so I added</div>
<div><Bundle-SymbolicName>org.drools.core</Bundle-SymbolicName> to a drools-core package, recompiled it and got </div>
<div>NullPointerException (still without stacktrace) when I tried to deploy new core bundle to a karaf container.</div><div><br></div><div>I was able to deploy it after I removed Bundle-SymbolicName and recompiled again.</div>
<div><br></div><div>Thanks,</div><div>Alex<br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 4:42 PM, Mauricio Salatino <span dir="ltr"><<a href="mailto:salaboy@gmail.com" target="_blank">salaboy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've already answer a similar question here.. try including inside the<br>
application that is using the bundles the file called:<br>
drools.packagebuilder.conf<br>
<br>
which contains:<br>
drools.dialect.default = java<br>
drools.dialect.java =<br>
org.drools.rule.builder.dialect.java.JavaDialectConfiguration<br>
drools.dialect.java.compiler = ECLIPSE<br>
<br>
drools.dialect.mvel =<br>
org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration<br>
drools.dialect.mvel.strict = true<br>
drools.dialect.mvel.langLevel = 4<br>
<br>
drools.accumulate.function.average =<br>
org.drools.base.accumulators.AverageAccumulateFunction<br>
drools.accumulate.function.max =<br>
org.drools.base.accumulators.MaxAccumulateFunction<br>
drools.accumulate.function.min =<br>
org.drools.base.accumulators.MinAccumulateFunction<br>
drools.accumulate.function.count =<br>
org.drools.base.accumulators.CountAccumulateFunction<br>
drools.accumulate.function.sum =<br>
org.drools.base.accumulators.SumAccumulateFunction<br>
drools.accumulate.function.collectList =<br>
org.drools.base.accumulators.CollectListAccumulateFunction<br>
drools.accumulate.function.collectSet =<br>
org.drools.base.accumulators.CollectSetAccumulateFunction<br>
<br>
drools.evaluator.coincides =<br>
org.drools.base.evaluators.CoincidesEvaluatorDefinition<br>
drools.evaluator.before = org.drools.base.evaluators.BeforeEvaluatorDefinition<br>
drools.evaluator.after = org.drools.base.evaluators.AfterEvaluatorDefinition<br>
drools.evaluator.meets = org.drools.base.evaluators.MeetsEvaluatorDefinition<br>
drools.evaluator.metby = org.drools.base.evaluators.MetByEvaluatorDefinition<br>
drools.evaluator.overlaps =<br>
org.drools.base.evaluators.OverlapsEvaluatorDefinition<br>
drools.evaluator.overlappedby =<br>
org.drools.base.evaluators.OverlappedByEvaluatorDefinition<br>
drools.evaluator.during = org.drools.base.evaluators.DuringEvaluatorDefinition<br>
drools.evaluator.includes =<br>
org.drools.base.evaluators.IncludesEvaluatorDefinition<br>
drools.evaluator.starts = org.drools.base.evaluators.StartsEvaluatorDefinition<br>
drools.evaluator.startedby =<br>
org.drools.base.evaluators.StartedByEvaluatorDefinition<br>
drools.evaluator.finishes =<br>
org.drools.base.evaluators.FinishesEvaluatorDefinition<br>
drools.evaluator.finishedby =<br>
org.drools.base.evaluators.FinishedByEvaluatorDefinition<br>
drools.evaluator.equality =<br>
org.drools.base.evaluators.EqualityEvaluatorsDefinition<br>
drools.evaluator.comparable =<br>
org.drools.base.evaluators.ComparableEvaluatorsDefinition<br>
drools.evaluator.set = org.drools.base.evaluators.SetEvaluatorsDefinition<br>
drools.evaluator.matches =<br>
org.drools.base.evaluators.MatchesEvaluatorsDefinition<br>
drools.evaluator.soundslike =<br>
org.drools.base.evaluators.SoundslikeEvaluatorsDefinition<br>
<br>
Cheers<br>
<br>
<br>
On Tue, Feb 7, 2012 at 9:03 PM, Alexander Filipchik<br>
<<a href="mailto:afilipchik@gmail.com" target="_blank">afilipchik@gmail.com</a>> wrote:<br>
> It's not an obvious how to OSGI-fy something :)<br>
><br>
> I did some homework - now I have OSGi-ified versions of drools-spring and<br>
> drools-camel.<br>
> Also I created own bundle and tried to import KnowledgeBaseFactoryService,<br>
> ServiceRegistry and KnowledgeBaseFactoryService as described in<br>
> <a href="http://docs.jboss.org/jbpm/v5.2/userguide/ch18.html#d0e4308" target="_blank">http://docs.jboss.org/jbpm/v5.2/userguide/ch18.html#d0e4308</a>.<br>
> All what I got - NullPointerException from karaf core (haven't gotten full<br>
> staketrace yet. For some reason it is just:<br>
> 15:11:34,484 | INFO | l Console Thread | Console |<br>
> ? ? | 34 - org.apache.karaf.shell.console<br>
> - 2.2.2.fuse-02-13 | Exception caught while executing command<br>
> java.lang.NullPointerException<br>
> )<br>
><br>
> So, I spent some time randomly adding and removing configuration params and<br>
> I found - NPE occurs when I'm trying to import<br>
> org.drools.KnowledgeBaseFactoryService.<br>
> I guess (i'm not OSGI expert) it could be because org.drools package is<br>
> exported in 2! bundles. It is in drools-core and knowledge-api bundles. And<br>
> I guess, karaf container just can't link my bundle with both core and api,<br>
> only first bundle which contains requested package (org.drools) wins.<br>
><br>
> Any ideas on how to make it work?<br>
> I actually have one - every bundle should export own package. For<br>
> knowledge-api it should be org.drools.api, and org.drools.core for<br>
> drools-core.<br>
><br>
> Here is full log of similar packages:<br>
> WARNING: multiple bundles are exporting package org.drools.command<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
> - org.drools.internalapi [217]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.runtime.process<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.time<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> WARNING: multiple bundles are exporting package<br>
> org.apache.geronimo.transaction<br>
> - org.apache.aries.transaction.manager [123]<br>
> - org.apache.aries.transaction.manager [51]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> WARNING: multiple bundles are exporting package<br>
> org.apache.geronimo.transaction.manager<br>
> - org.apache.aries.transaction.manager [123]<br>
> - org.apache.aries.transaction.manager [51]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.grid<br>
> - org.drools.core [218]<br>
> - org.drools.spring [220]<br>
><br>
> WARNING: multiple bundles are exporting package jline<br>
> - org.apache.servicemix.bundles.jruby [210]<br>
> - org.apache.karaf.shell.console [34]<br>
><br>
> WARNING: multiple bundles are exporting package<br>
> org.apache.geronimo.transaction.log<br>
> - org.apache.aries.transaction.manager [123]<br>
> - org.apache.aries.transaction.manager [51]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.management<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.agent<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> WARNING: multiple bundles are exporting package org.drools.event<br>
> - org.drools.core [218]<br>
> - org.drools.api [216]<br>
><br>
> 2012/2/3 Mark Proctor <<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>><br>
>><br>
>> neither spring or camel have been OSGi-ified. only api, core, compiler,<br>
>> templates, decision-tables and flow have.<br>
>><br>
>> If someone wants to OSGi-ify those and contribute back they are very<br>
>> welcome:<br>
>> 1) update the pom.xml to use the osgi bundle plugin, see other existing<br>
>> poms.<br>
>><br>
>> <a href="https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/pom.xml" target="_blank">https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/pom.xml</a><br>
>> 2) create an Activator to register the module, again see Activator's for<br>
>> core, compiler etc.<br>
>><br>
>> <a href="https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/src/main/java/org/drools/osgi/decisiontables/Activator.java" target="_blank">https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/src/main/java/org/drools/osgi/decisiontables/Activator.java</a><br>
>> 3) update the osgi bundle's pom with new dependencies, make sure to pull<br>
>> in the spring ones, unless the actual project provides osgi ready jars.<br>
>><br>
>> <a href="https://github.com/droolsjbpm/droolsjbpm-build-distribution/tree/master/drools-osgi-bundles" target="_blank">https://github.com/droolsjbpm/droolsjbpm-build-distribution/tree/master/drools-osgi-bundles</a><br>
>> 4) Update the boot-bundles.properties so that Spring DM loads the OSGi<br>
>> dependencies<br>
>><br>
>> <a href="https://github.com/droolsjbpm/droolsjbpm-build-distribution/blob/master/drools-osgi-bundles/org.drools.osgi.test/src/test/filtered-resources/boot-bundles.properties" target="_blank">https://github.com/droolsjbpm/droolsjbpm-build-distribution/blob/master/drools-osgi-bundles/org.drools.osgi.test/src/test/filtered-resources/boot-bundles.properties</a><br>
>> 5) write unit tests for spring and camel.<br>
>><br>
>> Mark<br>
>> On 03/02/2012 03:47, Alexander Filipchik wrote:<br>
>><br>
>> Hello all!<br>
>><br>
>> Don't know if it is right list to ask, but I'm trying to make drools +<br>
>> camel running on Fuse (ServiceMix container).<br>
>> I couldn't even install OSGI drools artifacts for 5.3.1 version (because<br>
>> of weird dependency on drools.core Snapshot),<br>
>> but did it with v5.2.1. I used:<br>
>><br>
>> mvel2/2.1.0,<br>
>> org.drools/drools-core/5.2.1.Final, org.drools/drools-compiler/5.2.1.Final,<br>
>> org.drools/knowledge-api/5.2.1.Final<br>
>> and org.drools/drools-camel/5.2.1.Final.<br>
>><br>
>> All are installed and active. Part of log:<br>
>><br>
>> [ 162] [Active ] [ ] [ ] [ 60] Drools :: Compiler<br>
>> (5.2.1.Final)<br>
>><br>
>> [ 163] [Active ] [ ] [ ] [ 60] mvel2<br>
>> (2.1.0.drools4)<br>
>><br>
>> [ 164] [Active ] [ ] [ ] [ 60] Drools :: Core<br>
>> (5.2.1.Final)<br>
>><br>
>> [ 165] [Active ] [ ] [ ] [ 60] Knowledge API<br>
>> (5.2.1.Final)<br>
>><br>
>> [ 172] [Active ] [ ] [ ] [ 60]<br>
>> mvn:org.drools/drools-camel/5.2.1.Final<br>
>><br>
>> Then I tried to add my own camel-drools router (I created OSGI bundle for<br>
>> it). It depends on:<br>
>><br>
>> Import-Package:<br>
>> org.apache.activemq,org.apache.activemq.camel.component,org.apache.activemq.pool,org.apache.camel;version="[2.8,3)",org.apache.camel.builder;version="[2.8,3)",org.apache.camel.component.jms;version="[2.8,3)",org.apache.camel.model;version="[2.8,3)",org.drools.camel.component,org.osgi.service.blueprint;version="[1.0.0,2.0.0)",org.springframework.transaction;version="[3,4)"<br>
>><br>
>> It tried to install it to a container but all I got -<br>
>><br>
>> Error executing command: Unresolved constraint in bundle<br>
>> com.betfair.drools [170]: Unable to resolve 170.0: missing requirement<br>
>> [170.0] package; (package=org.drools.camel.component)<br>
>><br>
>> I even tried to put drools-camel.jar with org.drools.camel.component in a<br>
>> lib folder and add package to org.osgi.framework.system.packages.extra, but<br>
>> got same result.<br>
>><br>
>> Do you have any idea, blog posts, samples which could help me?<br>
>> I'm completely stuck.<br>
>><br>
>> Thanks,<br>
>> Alex<br>
>><br>
>><br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> rules-users mailing list<br>
>> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> rules-dev mailing list<br>
> <a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
<span><font color="#888888"><br>
<br><span class="HOEnZb"><font color="#888888">
<br>
--<br>
- CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a><br>
- MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
<br>
- Salatino "Salaboy" Mauricio -<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></span></font></span></blockquote></div><br></div>
</blockquote></div><br></div>