I don&#39;t know if this helps, but I had to turn the MVEL JIT compiler off in the Equinox OSGi container:<br>            OptimizerFactory.setDefaultOptimizer(&quot;reflective&quot;);<br><br>Also, we used pre-compiled packages instead of compiling the DRL files at runtime.  For example:<br>
<br>....<br>            RuleBaseConfiguration ruleBaseConfig = new RuleBaseConfiguration();<br>            ruleBaseConfig.setClassLoader(this.getClass().getClassLoader());            <br>            <br>            //MVEL in OSGi is a complete CF - this turns off the MVEL JIT - potential resource hog but that&#39;s the nature of OSGi classloading<br>
            //and Drools...<br>            OptimizerFactory.setDefaultOptimizer(&quot;reflective&quot;);<br>            <br>            RuleBase ruleBase = RuleBaseFactory.newRuleBase(ruleBaseConfig);            <br>            <br>
            InputStream pkgIs = this.getClass().getResourceAsStream(&quot;/com/cjs/hazel/rules/com.cjs.hazel.rules.pkg&quot;);<br>            addPackage(ruleBase,pkgIs);<br>.....<br><br><div class="gmail_quote">On Fri, Apr 2, 2010 at 4:42 PM, AervTerrh <span dir="ltr">&lt;<a href="mailto:woutervanisterdael@gmail.com">woutervanisterdael@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Hey,<br>
<br>
Okay. I know this problem can be found all over. But I can&#39;t seem to figure<br>
out a solution to it. Somehow I must be doing something wrong. I&#39;ve created<br>
a simple application that evaluates some rules and changes some objects<br>
based on that. Everything worked fine, not a single problem there. All<br>
libraries could be easily found etc.<br>
<br>
Now I wanted to convert this to a Felix OSGi bundle.<br>
<br>
So, what I did, was creating a bundle (new plugin project based on existing<br>
jars) with the drools jars (core, compiler, api, jsr) and tried the next<br>
code in the RuleEngine class:<br>
<br>
Properties props = new Properties();<br>
props.setProperty(&quot;drools.dialect.java.compiler&quot;, &quot;JANINO&quot;);<br>
KnowledgeBuilderConfiguration config =<br>
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props, null);<br>
(here&#39;s where it fails)<br>
KnowledgeBuilder kbuilder =<br>
KnowledgeBuilderFactory.newKnowledgeBuilder(config);<br>
kbuilder.add(ResourceFactory.newClassPathResource(fileName,<br>
RuleEngine.class), ResourceType.DRL);<br>
<br>
This is pretty much the loading of the rule file. The RuleEngine is started<br>
in an Activator. The file is found and everything. But I keep getting the<br>
same error when starting the bundle.<br>
<br>
org.drools.RuntimeDroolsException: Unable to load dialect<br>
&#39;org.drools.rule.builder.dialect.mvel.MVELDialectConfigurati on:mvel:null&#39;<br>
at org.drools.compiler.PackageBuilderConfiguration.addDialect(P<br>
ackageBuilderConfiguration.java:274)<br>
at org.drools.compiler.PackageBuilderConfiguration.buildDialect<br>
ConfigurationMap(PackageBuilderConfiguration.java:259)<br>
at org.drools.compiler.PackageBuilderConfiguration.init(Package<br>
BuilderConfiguration.java:176)<br>
at<br>
org.drools.compiler.PackageBuilderConfiguration.&lt;init&gt;(PackageBuilderConfiguration.java:148)<br>
at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnow<br>
ledgeBuilderConfiguration(KnowledgeBuilderProviderImpl.java: 21)<br>
at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuild<br>
erConfiguration(KnowledgeBuilderFactory.java:68)<br>
at test.Activator$RuleCreator.createRule(Activator.java:52)<br>
at test.Activator.start(Activator.java:32)<br>
at org.apache.felix.framework.util.SecureAction.startActivator(<br>
SecureAction.java:639)<br>
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1 700)<br>
at org.apache.felix.framework.Felix.startBundle(Felix.java:1622 )<br>
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.j ava:1077)<br>
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl .java:264)<br>
at java.lang.Thread.run(Unknown Source)<br>
Caused by: java.lang.ClassNotFoundException:<br>
org.drools.rule.builder.dialect.mvel.MVELDialectConfiguratio n<br>
at java.net.URLClassLoader$1.run(Unknown Source)<br>
<br>
<br>
The packages I import in the manifest:<br>
Import-Package: org.codehaus.janino;version=&quot;2.4.3&quot;,<br>
org.drools,<br>
org.drools.builder,<br>
org.drools.compiler,<br>
<a href="http://org.drools.io" target="_blank">org.drools.io</a>,<br>
org.drools.rule,<br>
org.drools.rule.builder.dialect.java,<br>
org.drools.rule.builder.dialect.mvel,<br>
org.osgi.framework;version=&quot;1.3.0&quot;<br>
<br>
In my target platform I add the the drools project I created (with<br>
drools-xx.jar (the necessary ones), I also added the following:<br>
-ant<br>
-antlr-runtime<br>
-janino<br>
-jsr94<br>
-xstream<br>
<br>
But I can&#39;t seem to get it working... Does anyone know what can be done<br>
about this? Or a working example of Drools in Felix OSGi would also be<br>
helpful.<br>
<br>
Any help is very much appreciated, I&#39;ve been looking into this for days.<br>
<br>
Thanks!<br>
<br>
Kind regards,<br>
<br>
Aerv<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Drools-and-OSGi-tp694011p694011.html" target="_blank">http://n3.nabble.com/Drools-and-OSGi-tp694011p694011.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">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></blockquote></div><br>