org.osgi.framework.BundleException, How do I add and use dependencies in Cytoscape bundle app?

612 views
Skip to first unread message

Torgeir Ous

unread,
May 12, 2016, 8:15:10 AM5/12/16
to cytoscape...@googlegroups.com
Hi,

I'm making a Cytoscape app and want to use Solrj for searching multiple files (size up to 0.5GBf for each file). The problem is that I get a "org.osgi.framework.BundleException" when starting the app. I've added the dependency in pom.xml, but if I try importing something from SolrJ I get this error:
org.cytoscape.app.internal.exception.AppStartupException: Bundle start error
at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:84)
at org.cytoscape.app.internal.manager.AppManager.initializeApps(AppManager.java:347)
at org.cytoscape.app.internal.manager.AppManager.attemptInitialization(AppManager.java:230)
at org.cytoscape.app.internal.manager.AppManager.frameworkEvent(AppManager.java:222)
at org.apache.felix.framework.util.EventDispatcher.invokeFrameworkListenerCallback(EventDispatcher.java:835)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:785)
at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:1088)
at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:54)
at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:101)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.cytoscape.drugapp.drug-cyaction-app [113]: Unable to resolve 113.0: missing requirement [113.0] osgi.wiring.package; (osgi.wiring.package=org.apache.solr.client.solrj.impl)
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:82)
... 9 more

What is the right approach to add and use dependencies in a Cytoscape bundle app?

Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>

<properties>
<bundle.symbolicName>org.cytoscape.drugapp.drug-cyaction-app</bundle.symbolicName>
<bundle.namespace>org.cytoscape.drugapp</bundle.namespace>
</properties>

<modelVersion>4.0.0</modelVersion>
<groupId>org.cytoscape.drugapp</groupId>
<artifactId>drug-cyaction-app</artifactId>
<version>1.0-SNAPSHOT</version>

<name>${bundle.symbolicName} [${bundle.namespace}]</name>

<packaging>bundle</packaging>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<!-- Cytoscape requires Java 1.8 -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.8</source>
<target>1.8</target>
<optimize>true</optimize>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<compilerArguments>
<Xmaxwarns>10000</Xmaxwarns>
<Xmaxerrs>10000</Xmaxerrs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.1</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
<!-- Generates the OSGi metadata based on the osgi.bnd file. -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>${bundle.namespace}</Export-Package>
<Private-Package>${bundle.namespace}.internal.*</Private-Package>
<Bundle-Activator>${bundle.namespace}.internal.CyActivator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

<!-- Links to the Cytoscape Maven repositories. -->
<repositories>
<repository>
<id>cytoscape_snapshots</id>
<snapshots>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
<name>Cytoscape Snapshots</name>
</repository>
<repository>
<id>cytoscape_releases</id>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
</releases>
<name>Cytoscape Releases</name>
</repository>
</repositories>

<!-- Dependencies needed to compile this project. -->
<dependencies>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>core-task-api</artifactId>
<version>3.3.0</version>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>layout-api</artifactId>
<version>3.3.0</version>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.2.0</version>
</dependency>

<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>service-api</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>swing-application-api</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>session-api</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>6.0.0</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<version>1.5.2</version>
<scope>provided</scope>
</dependency>

</dependencies>

</project>



piet molenaar

unread,
May 12, 2016, 11:22:39 AM5/12/16
to cytoscape-helpdesk

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

Torgeir Ous

unread,
May 26, 2016, 9:22:14 AM5/26/16
to cytoscape...@googlegroups.com
I tried the approach mentioned in your link and also this: http://wiki.cytoscape.org/HowToAddLibraryDependencies
but without success. I created a new project using the version 3.3.0 cyaction-app archetype, then followed both procedures from the links again and it still doesn't work.
I've added my pom-file and a file with output from running "mvn clean install". If someone can take a look or maybe show me how you guys are adding dependencies would be helpful. :)
By the way, I'm using cytoscape 3.3.0 and mvn 3.3.9.


-- UPDATE: I've narrowed it down to that for some reason I cant use any later release than Solr 4.3.1


Torgeir
mvndump.txt
pom.xml

piet molenaar

unread,
May 26, 2016, 12:29:05 PM5/26/16
to cytoscape-helpdesk
Hi Torgeir,
You have to add the dependencies to the bundle configuration instructions also: see for example one of my poms attached; note escpecially the part in the maven bundle plugin around line 80
Hope this helps,
Piet


On Thu, May 26, 2016 at 3:22 PM, Torgeir Ous <torge...@gmail.com> wrote:
I tried the approach mentioned in your link and also this: http://wiki.cytoscape.org/HowToAddLibraryDependencies
but without success. I created a new project using the version 3.3.0 cyaction-app archetype, then followed both procedures from the link again in it still doesn't work.
I've added my pom-file and a file with output from running "mvn clean install". If someone can take a look or maybe show me how you guys are adding dependencies would be helpful. :)
By the way, I'm using cytoscape 3.3.0 and mvn 3.3.9.

Torgeir
pom.xml

Torgeir Ous

unread,
May 28, 2016, 5:40:55 AM5/28/16
to cytoscape-helpdesk
I ended up updating maven-bundle-plugin from version 2.3.7 to 3.0.1 and that solved the problem.
Reply all
Reply to author
Forward
0 new messages