Saturday, July 14, 2012

EMF not yet runnable in Apache Karaf OSGi Runtime

My attempt at deploying EMF inside Karaf 2.2.8 has not yet been successful.

I've tried adding Import-Package instruction:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <version>2.3.7</version>
    <extensions>true</extensions>
    <configuration>
        <instructions>
            <Import-Package>*, org.eclipse.emf.ecore, org.eclipse.emf.ecore.impl, org.eclipse.emf.ecore.plugin</Import-Package>
        </instructions>
    </configuration>
    <executions>
        <execution>
            <id>manifest</id>
            <phase>process-classes</phase>
            <goals>
                <goal>manifest</goal>
            </goals>
            <configuration>
            </configuration>
        </execution>
    </executions>
</plugin>

However the mere mention of an EMF Factory :

processCatalog = ProcessFactory.eINSTANCE.createProcessCatalog();

Throws exception:

2012-07-15 11:57:25,057 | ERROR | rint Extender: 3 | BlueprintContainerImpl           | 9 - org.apache.aries.blueprint - 0.3.2 | Unable to start blueprint container for bundle com.soluvas.com.soluvas.process.shell
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instanciating bean mock of class class com.soluvas.process.shell.Mock
        at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:271)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:708)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:631)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:337)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:230)[9:org.apache.aries.blueprint:0.3.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.6.0_23]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.6.0_23]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.6.0_23]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)[:1.6.0_23]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)[:1.6.0_23]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.6.0_23]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.6.0_23]
        at java.lang.Thread.run(Thread.java:679)[:1.6.0_23]
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.soluvas.process.ProcessFactory
        at com.soluvas.process.shell.Mock.<init>(Mock.java:12)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.6.0_23]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.6.0_23]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.6.0_23]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)[:1.6.0_23]
        at org.apache.aries.blueprint.utils.ReflectionUtils.newInstance(ReflectionUtils.java:257)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BeanRecipe.newInstance(BeanRecipe.java:842)[9:org.apache.aries.blueprint:0.3.2]
        at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:269)[9:org.apache.aries.blueprint:0.3.2]
        ... 15 more

Here are the list of bundles I've installed:

karaf@root> list -s
START LEVEL 100 , List Threshold: 50
   ID   State         Blueprint      Level  Symbolic name
[  75] [Active     ] [Created     ] [   80] org.ops4j.pax.wicket.service (1.0.1)
[  79] [Resolved   ] [            ] [   80] com.google.guava (12.0.0)
[  91] [Resolved   ] [            ] [   80] org.apache.servicemix.bundles.cglib (2.2.2.1)
[ 136] [Active     ] [            ] [   80] tomcat-sample (0)
[ 147] [Active     ] [            ] [   80] com.wikindonesia.place (0.0.0)
[ 148] [Active     ] [            ] [   80] com.wikindonesia.checkin (0.0.0)
[ 150] [Active     ] [            ] [   80] com.wikindonesia.cafe (0.0.0)
[ 151] [Active     ] [            ] [   80] org.soluvas.process (0.0.0)
[ 158] [Active     ] [            ] [   50] org.apache.camel.camel-core (2.10.0)
[ 159] [Active     ] [Created     ] [   50] org.apache.camel.karaf.camel-karaf-commands (2.10.0)
[ 160] [Active     ] [Created     ] [   50] org.apache.camel.camel-blueprint (2.10.0)
[ 161] [Active     ] [            ] [   80] org.apache.geronimo.specs.geronimo-annotation_1.1_spec (1.0.1)
[ 162] [Active     ] [            ] [   80] org.drools.core (5.4.0.Final)
[ 163] [Active     ] [            ] [   80] org.drools.compiler (5.4.0.Final)
[ 164] [Active     ] [            ] [   80] org.drools.templates (5.4.0.Final)
[ 166] [Active     ] [            ] [   80] org.mvel2 (2.1.0.drools16)
[ 167] [Active     ] [            ] [   80] org.drools.api (5.4.0.Final)
[ 168] [Active     ] [            ] [   80] org.jbpm.flow.core (5.3.0.Final)
[ 169] [Active     ] [            ] [   80] org.jbpm.flow.builder (5.3.0.Final)
[ 170] [Resolved   ] [            ] [   80] org.jbpm.bpmn2 (5.3.0.Final)
[ 172] [Active     ] [            ] [   80] org.apache.servicemix.bundles.jaxb-xjc (2.2.4.2)
[ 179] [Active     ] [            ] [   80] wrap_mvn_com.sun.istack_istack-commons-runtime_2.12_Export-Package___version_2.12.0 (0)
[ 182] [Active     ] [            ] [   80] org.apache.servicemix.specs.jaxb-api-2.2 (2.0.0)
[ 183] [Active     ] [            ] [   80] org.apache.servicemix.bundles.jaxb-impl (2.2.4.2)
[ 185] [Resolved   ] [            ] [   80] wrap_mvn_com.thoughtworks.xstream_xstream_1.4.2_Export-Package___version_1.4.2 (0)
[ 186] [Resolved   ] [            ] [   80] wrap_mvn_com.google.protobuf_protobuf-java_2.4.1_Export-Package___version_2.4.1 (0)
[ 187] [Resolved   ] [            ] [   80] org.drools.internalapi (5.4.0.Final)
[ 188] [Installed  ] [            ] [   80] wrap_mvn_antlr_antlr_2.7.7_Export-Package___version_2.7.7 (0)
[ 189] [Resolved   ] [            ] [   80] org.apache.servicemix.bundles.antlr-runtime (3.4.0.2)
[ 190] [Active     ] [Failure     ] [   80] com.soluvas.com.soluvas.process.shell (1.0.0.SNAPSHOT)
[ 210] [Resolved   ] [            ] [   80] org.eclipse.osgi (3.7.0.v20110613)
[ 212] [Resolved   ] [            ] [   80] org.eclipse.core.runtime (3.7.0.v20110110)
[ 213] [Resolved   ] [            ] [   80] org.eclipse.emf.common (2.8.0.v20120606-0717)
[ 214] [Resolved   ] [            ] [   80] org.eclipse.emf.ecore (2.8.0.v20120606-0717)
[ 215] [Resolved   ] [            ] [   80] org.eclipse.emf.ecore.xmi (2.8.0.v20120606-0717)
[ 216] [Resolved   ] [            ] [   80] org.eclipse.equinox.common (3.6.0.v20110523)
[ 217] [Resolved   ] [            ] [   80] org.eclipse.core.jobs (3.5.100.v20110404)
[ 218] [Resolved   ] [            ] [   80] org.eclipse.equinox.registry (3.5.0.v20100503)
[ 219] [Resolved   ] [            ] [   80] org.eclipse.equinox.preferences (3.4.0.v20110502)
[ 220] [Resolved   ] [            ] [   80] org.eclipse.core.contenttype (3.4.100.v20110423-0524)
[ 221] [Resolved   ] [            ] [   80] org.eclipse.equinox.app (1.3.0.v20100512)
[ 222] [Active     ] [            ] [   80] org.soluvas.async (0.0.0)


Note that I'm also unable to start any EMF bundles:

karaf@root> start 213
org.osgi.framework.BundleException: Activator start error in bundle org.eclipse.emf.common [213].

But there's no error log to be found.

No comments:

Post a Comment