I have done the following:<br><br>- Created a new Project in Eclipse, &quot;Plug-in from existing jar archives&quot; : added the .jar files of the lib directory in <a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/org.drools.eclipse-5.1.0.SNAPSHOT.zip">org.drools.eclipse-5.1.0.SNAPSHOT.zip.</a><br>
- Created a new project: droolstest, based on the example code in SimpleOsgiTest.<br>- This is the code:<br><br>        @SuppressWarnings(&quot;unchecked&quot;)<br>        public void testCompiler() throws Exception {        <br>
            ServiceReference serviceRef = bundleContext.getServiceReference( ServiceRegistry.class.getName() );<br>            ServiceRegistry registry = (ServiceRegistry) bundleContext.getService( serviceRef );<br><br>           <b> KnowledgeBuilderFactoryService knowledgeBuilderFactoryService = registry.get( KnowledgeBuilderFactoryService.class );</b><br>
            <br>            KnowledgeBaseFactoryService knowledgeBaseFactoryService = registry.get( KnowledgeBaseFactoryService.class );<br>            ResourceFactoryService resourceFactoryService = registry.get( ResourceFactoryService.class );<br>
<br>            String str = &quot;&quot;;<br>            str += &quot;package org.test\n&quot;;<br>            str += &quot;import org.test.Person\n&quot;;<br>            str += &quot;global java.util.List list\n&quot;;<br>
            str += &quot;rule rule1\n&quot;;<br>            str += &quot;when\n&quot;;<br>            str += &quot;    $p : Person( age &gt; 30 )\n&quot;;<br>            str += &quot;then\n&quot;;<br>            str += &quot;    list.add($p);\n&quot;;<br>
            str += &quot;end\n&quot;;<br><br>            KnowledgeBuilderConfiguration kbConf = knowledgeBuilderFactoryService.newKnowledgeBuilderConfiguration( null,<br>                                                                                                                    getClass().getClassLoader() );<br>
<br>            KnowledgeBuilder kbuilder = knowledgeBuilderFactoryService.newKnowledgeBuilder( kbConf );<br>            ResourceFactoryService resource = resourceFactoryService;<br>            kbuilder.add( resource.newByteArrayResource( str.getBytes() ),<br>
                          ResourceType.DRL );<br><br>            if ( kbuilder.hasErrors() ) {<br>                System.out.println( kbuilder.getErrors() );<br>                throw new RuntimeException( kbuilder.getErrors().toString() );<br>
            }<br><br>            KnowledgeBaseConfiguration kbaseConf = knowledgeBaseFactoryService.newKnowledgeBaseConfiguration( null,<br>                                                                                                              getClass().getClassLoader() );<br>
<br>            KnowledgeBase kbase = knowledgeBaseFactoryService.newKnowledgeBase( kbaseConf );<br>            kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );<br>            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();<br>
            List list = new ArrayList();<br>            ksession.setGlobal( &quot;list&quot;,<br>                                list );<br><br>            ksession.insert( new Person( &quot;name&quot;,<br>                                         34 ) );<br>
<br>            ksession.fireAllRules();<br>            ksession.dispose();<br><br><br>        }<br>        <br>        public class Person<br>        {<br>            private String name;<br>            private int age;<br>
            <br>        <br>            public Person(String name, int age)<br>            {<br>                <a href="http://this.name">this.name</a> = name;<br>                this.age = age;<br>            }<br>        }<br>
<br>The other methods work fine. I then added the following packages to my dependencies in the manifest:<br><br>Import-Package: org.drools,<br> org.drools.builder,<br> org.drools.builder.impl,<br> <a href="http://org.drools.io">org.drools.io</a>,<br>
 org.drools.rule,<br> org.drools.rule.builder,<br> org.drools.runtime,<br> org.drools.runtime.rule,<br> org.drools.util,<br> org.drools.vsm;version=&quot;5.1.0.SNAPSHOT&quot;,<br> org.osgi.framework;version=&quot;1.5.0&quot;<br>
<br>However, when I run I get this error:<br>Testing compiler<br>org.osgi.framework.BundleException: Activator start error in bundle droolstest [2].<br>    at org.apache.felix.framework.Felix.activateBundle(Felix.java:1751)<br>
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1622)<br>    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:915)<br>    at org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:114)<br>
    at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:286)<br>    at org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:184)<br>    at java.lang.Thread.run(Unknown Source)<br>
<b>Caused by: java.lang.IllegalArgumentException: Unable to instantiate service for Class &#39;org.drools.builder.KnowledgeBuilderFactoryService&#39;</b><br>    at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:157)<br>
   <b> at droolstest.Activator$SimpleOsgiTest.testCompiler(Activator.java:79)</b><br>    at droolstest.Activator.start(Activator.java:44)<br>    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:639)<br>
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)<br>    ... 6 more<br>Caused by: java.lang.ClassCastException<br>    at java.lang.Class.cast(Unknown Source)<br>    at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:155)<br>
    ... 10 more<br>java.lang.IllegalArgumentException: Unable to instantiate service for Class &#39;org.drools.builder.KnowledgeBuilderFactoryService&#39;<br>-&gt; <br><br>The registry is not null. He just can&#39;t seem to find this service. Allthough the drools project with all bundles of the lib directory in <a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/org.drools.eclipse-5.1.0.SNAPSHOT.zip">org.drools.eclipse-5.1.0.SNAPSHOT.zip.</a> are installed and started. (this should register the service I believe)<br>
<br>These issues have been driving me crazy. :-(<br><br>Kind regards<br><br>Aerv<br><br><br><br>