Cytoscape 3 fails to start a installed OSGi app

110 views
Skip to first unread message

huiju wang

unread,
Jul 17, 2014, 6:26:39 AM7/17/14
to cytoscape...@googlegroups.com
Hi all,

I'm building an OSGi app. As I defined my own class(in the same maven project), I have added three lines into my pom.xml:

<Embed-Dependency>!*log4j;scope=compile|runtime;type=!pom</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>*;resolution:=optional</Import-Package>

Also,  <scope>provided</scope> clause was added to the sections for all dependencies included with Cytoscape (including Cytoscape APIs and OSGi) in the pom.xml file.

The app can be installed sucessfully, but cannot be started. An "Failed to start" error is reported in the app manager.

I tried all kinds of methods, and all failed.  Attached is my pom.xml file.  I'm new to Cytoscape and bundle-based app. Any help is greatly appreciated. Can anybody help me?

Thanks a lot.

Logs are as follows:

2014-07-17 18:11:41,128 [fileinstall-C:\Users\workshop/CytoscapeConfiguration/3/apps/installed] WARN  org.apache.felix.fileinstall - Error while starting bundle: file:/C:/Users/workshop/CytoscapeConfiguration/3/apps/installed/visualization-0.0.1-SNAPSHOT.jar
org.osgi.framework.BundleException: Activator start error in bundle nus.soc.vcexplorer.visualization [170].
 at org.apache.felix.framework.Felix.activateBundle(Felix.java:1951)
 at org.apache.felix.framework.Felix.startBundle(Felix.java:1822)
 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)
 at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1244)
 at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1216)
 at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1205)
 at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:500)
 at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)
Caused by: java.lang.ClassCastException: nus.soc.vcexplorer.visualization.CyActivator cannot be cast to org.osgi.framework.BundleActivator
 at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:3814)
 at org.apache.felix.framework.Felix.activateBundle(Felix.java:1899)
 ... 7 more
pom.xml

Scooter Morris

unread,
Jul 17, 2014, 11:39:49 AM7/17/14
to cytoscape...@googlegroups.com
Greetings,
   The problem you have is in your code, not your pom file.  Looks like you are trying to cast your CyActivator class to BundleActivator, or your CyActivator class doesn't extend AbstractCyActivator.

-- scooter

Tim Hull

unread,
Jul 17, 2014, 1:26:20 PM7/17/14
to cytoscape...@googlegroups.com
I'd double-check to make sure you have <scope>provided</scope> for all Cytoscape/OSGI dependencies - this error is frequently seen when Embed-Dependencies is used but provided is not specified for an internal dependency. 


--
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 http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages