BundleException: Activator start error in bundle

2,259 views
Skip to first unread message

Michael Heuer

unread,
Jul 23, 2013, 10:30:01 PM7/23/13
to cytoscap...@googlegroups.com
Hello,

I am seeing an error on installing a new OSGi Cytoscape 3.x app

Cytoscape 3.0.1> install file:///.../Desktop/foo-1.0-SNAPSHOT.jar
Bundle ID: 169
Cytoscape 3.0.1> start 169
org.osgi.framework.BundleException: Activator start error in bundle foo [169].

Unfortunately that is all the information I can get about the
BundleException. No amount of setting log levels and using all the
log-related commands from the console (log:display,
log:display-exception, log:tail, dev:print-stack-trace, etc.) shows me
anything.

Is there a bit of doc somewhere that I'm missing? Unit tests show
that my CyActivator is initializing correctly, at least with
FakeBundleContext.

Thanks,

michael

Igor Rodchenkov

unread,
Jul 24, 2013, 9:38:04 AM7/24/13
to cytoscap...@googlegroups.com
Well, we have several posts here and in cytostaff and cytoscape-helpdesk about very similar issues...

From my experience (with CyPath2), this has something to do with runtime dependencies; e.g., "bundle stopped" happens when not embedding enough or properly the app's transitive dependencies and also using "resolution=optional" flag in the maven-bundle -plugin configuration in pom.xml:

e.g., I do:
<Embed-Dependency>*;scope=runtime|compile;optional=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>*;resolution:=optional</Import-Package>
;  it also possible (but was less successful in my case) to use ";inline=true" or/and more specific groupId/artifactId patterns in the <Embed-Dependency> instead on the wildcard...

Unfortunately, it's uneasy to debug in Cy3, as there are no other messages show up in the logs, and even debugger might not always stop on a breakpoint in a CyActivator (not even in the no-argument constructor or static initializer...) It also depends on the system running Cy3.

So, I will at least try more debugging CyPath2 app on different Mac and Win machines to find out, though it might be not the app's issue this time but Cy frameworks'.

IR.

Eric Dawson

unread,
Jul 24, 2013, 10:23:22 AM7/24/13
to cytoscap...@googlegroups.com
Hi all,

   Registering a service that is buggy (but able to register) or registering a service but not using it seems to occasionally cause a BundleActivator error as well. Prepare to see a lot of BundleActivator errors. Like Igor said, dependencies seem to throw them if they aren't resolved. If your app is in the "Installed" status after installation and not "Resolved", it's probably a dependency issue.

Cheers,
   Eric

Michael Heuer

unread,
Jul 24, 2013, 11:15:36 AM7/24/13
to cytoscap...@googlegroups.com
Hello Igor, Eric

I am using

<Embed-Dependency>*;scope=!provided|test</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>*;resolution:=optional</Import-Package>

which worked fine for two other Cy3 apps.

If I use App Manager --> Install from File... it shows up as status
Installed but in Help --> Developer's Log Console... I see two of
these per second

WARN 10:10:36 AM
[fileinstall-/Users/xxx/CytoscapeConfiguration/3/apps/installed]
org.apache.felix.fileinstall: Error while starting bundle:
file:/Users/xxx/CytoscapeConfiguration/3/apps/installed/foo-1.0-SNAPSHOT.jar

This app is my first attempt to use both Guice injection and OSGi at
the same time, perhaps that is the issue, although as I mentioned
below it works ok in unit tests.

michael

Igor Rodchenkov

unread,
Jul 24, 2013, 12:05:02 PM7/24/13
to cytoscap...@googlegroups.com
BTW, I had (and have) this problem with CyPath2 app on some machines too: it's shown as "Installed" (if done via Apps manager), but not started, and constantly prints same error to Developer's Log Console...

Igor Rodchenkov

unread,
Jul 24, 2013, 12:07:40 PM7/24/13
to cytoscap...@googlegroups.com
The real problem is that Cy3 does not show/pass a error message that can help fixing it (Cy3 framework only logs the useless message...)

Michael Heuer

unread,
Jul 24, 2013, 12:44:04 PM7/24/13
to cytoscap...@googlegroups.com
Yes, I agree.
> --
> You received this message because you are subscribed to the Google Groups
> "cytoscape-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cytoscape-disc...@googlegroups.com.
> To post to this group, send email to cytoscap...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cytoscape-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Michael Heuer

unread,
Jul 25, 2013, 12:48:29 PM7/25/13
to cytoscap...@googlegroups.com
It appears that the problem I was having was with code in packages
that weren't properly OSGi exported or imported. I had code in

o.d.foo
o.d.foo.bar
o.d.foo.internal

in this Cy3 app and only in

o.d.foo.internal

in other Cy3 apps. I moved the other packages to a different maven
module and jar artifact and then the Cy3 app started ok.

michael

Igor Rodchenkov

unread,
Jul 26, 2013, 5:29:48 PM7/26/13
to cytoscap...@googlegroups.com
Wow, I actually now can see the exceptions and detailed log messages in the CytoscapeConfiguration/3/framework-cytoscape file.
(I was sure I looked there before - whether missed it somehow, sorry, or they weren't there ;)))

BTW, the issue was with missing JAXB classes...
Reply all
Reply to author
Forward
0 new messages