Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve OSGI metada #35

Merged
merged 1 commit into from

2 participants

Charles Moulliard Geoffrey De Smet
Charles Moulliard
Collaborator

The goal of this pull requst (since kie refactoring) is to improve OSGI MetaData and retest deployment of individual bundles (instead of uber workaround). So here are the modifications done for KIE :

  • Disable activator class of org.kia.api.osgi as it generates NPE when deployed on Apache Karaf (see email send to community to discussion about that),
  • Export missing package org.kie.api.cdi which is required by bundle drools-compiler,
  • Remove singleton := true property as it generates an error on Karaf when bundle is updated (= stop, replaced and restarted)
Charles Moulliard Disable activator as it generates NPE, export missing package org.kie…
….cdi, remove singleton := true
aa09069
Geoffrey De Smet ge0ffrey commented on the diff
kie-api/pom.xml
((16 lines not shown))
<DynamicImport-Package>*</DynamicImport-Package>
- <Bundle-Activator>org.kie.api.osgi.Activator</Bundle-Activator>
+ <!-- <Bundle-Activator>org.kie.api.osgi.Activator</Bundle-Activator> -->
Geoffrey De Smet Owner

Why disable it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Charles Moulliard
Collaborator

Because it generates the following error as the ServiceRegistry object is null.

ERROR: Bundle org.kie.api [67] EventDispatcher: Error during dispatch. (java.lang.NullPointerException)
java.lang.NullPointerException
at org.kie.api.osgi.Activator$DroolsServiceTracker.addingService(Activator.java:94)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260)
at org.apache.felix.framework.Felix.registerService(Felix.java:3275)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
at org.drools.compiler.osgi.Activator.start(Activator.java:56)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Thread.java:680)

Geoffrey De Smet ge0ffrey merged commit cb5a683 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. Disable activator as it generates NPE, export missing package org.kie…

    Charles Moulliard authored
    ….cdi, remove singleton := true
This page is out of date. Refresh to see the latest.
14 kie-api/pom.xml
View
@@ -24,11 +24,17 @@
<configuration>
<instructions>
<_removeheaders>Ignore-Package</_removeheaders>
- <Bundle-SymbolicName>org.kie.api;singleton:=true</Bundle-SymbolicName>
- <Import-Package>!org.kie.*,*;resolution:=optional,com.sun.tools.xjc;resolution:=optional</Import-Package>
- <Export-Package>!org.kie.api.cdi.*,org.kie.*</Export-Package>
+ <Bundle-SymbolicName>org.kie.api</Bundle-SymbolicName>
+ <Import-Package>
+ !org.kie.*,
+ *;resolution:=optional,
+ com.sun.tools.xjc;resolution:=optional
+ </Import-Package>
+ <Export-Package>
+ org.kie.api*
+ </Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
- <Bundle-Activator>org.kie.api.osgi.Activator</Bundle-Activator>
+ <!-- <Bundle-Activator>org.kie.api.osgi.Activator</Bundle-Activator> -->
Geoffrey De Smet Owner

Why disable it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
</instructions>
</configuration>
</plugin>
7 kie-api/src/main/java/org/kie/api/osgi/Activator.java
View
@@ -44,10 +44,9 @@
public void start(BundleContext bc) throws Exception {
logger.info( "registering api services" );
- // @TODO (mdp) commented t allow it to compile
-// this.serviceRegistry = bc.registerService( ServiceRegistry.class.getName(),
-// ServiceRegistryImpl.getInstance(),
-// new Hashtable() );
+ //this.serviceRegistry = bc.registerService( ServiceRegistry.class.getName(),
+ // ServiceRegistryImpl.getInstance(),
+ // new Hashtable() );
this.registryTracker = new ServiceTracker( bc,
Service.class.getName(),
12 kie-internal/pom.xml
View
@@ -24,10 +24,14 @@
<configuration>
<instructions>
<_removeheaders>Ignore-Package</_removeheaders>
- <Bundle-SymbolicName>org.kie.internalapi;singleton:=true</Bundle-SymbolicName>
- <Require-Bundle>org.kie.api;visibility:=reexport;bundle-version="${drools.osgi.version}"</Require-Bundle>
- <Import-Package>!org.kie.*,*;resolution:=optional,com.sun.tools.xjc;resolution:=optional</Import-Package>
- <Export-Package>org.kie.*</Export-Package>
+ <Bundle-SymbolicName>org.kie.internalapi</Bundle-SymbolicName>
+ <Import-Package>
+ !org.kie.*,
+ *;resolution:=optional,
+ com.sun.tools.xjc;resolution:=optional</Import-Package>
+ <Export-Package>
+ org.kie.internal*
+ </Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</configuration>
Something went wrong with that request. Please try again.