I need some help with understanding when a bundle is valid and shows up in Karaf vs not. What's the minimum a jar must have to show up as a bundle in Karaf?
We are trying to obfuscate a bundle app (ENViz) that doesn't even show up as a bundle (e.g., osgi:ls ENViz doesn't show anything). Although the app manager sees and shows it as installed. The bundle app works fine when unobfuscated. We are calling the obfuscation program (jshrink) using the exec-maven-plugin. The program takes the unobfuscated jar and produces a new obfuscated jar. I've tried turning off all the obfuscation, that doesn't help, so maybe the problem is much more simple and high-level.
The unobfuscated version and the obfuscated version seem to have the same META-INF/MANIFEST.MF file.
--
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.
Tim,
That's very helpful--I didn't know about the framework-cytoscape.log file. So, what the log claims is that there is no MANIFEST in the jar:
2014-07-07 17:46:39,174 [fileinstall-C:\Users\creech/CytoscapeConfiguration/3/apps/installed] ERROR org.apache.felix.fileinstall - Failed to install artifact: C:\Users\creech\CytoscapeConfiguration\3\apps\installed\ENViz-3.1.1.jar
org.osgi.framework.BundleException: The bundle file:/C:/Users/creech/CytoscapeConfiguration/3/apps/installed/ENViz-3.1.1.jar does not have a META-INF/MANIFEST.MF! Make sure, META-INF and MANIFEST.MF are the first 2 entries in your JAR!
at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:994)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:941)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:854)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)
However, when I use winzip to look inside the jar file that works and the one that fails (at the location specified), they both have META-INF/MANIFEST.MF entries that look to have the same information inside them. So does this imply the jar file is formatted in some funny way not readable by felix?
Tim,
That was very helpful and is exactly my problem. Once again you've really helped me out!
The obfuscator built a jar that isn't a correct bundle because the MANIFEST isn't the first entry in the jar. I need to come up with a way to automatically repackage the obfuscated jar as a bundle each time I build our app. I didn't find any maven plugins that do this--does anyone know of anything that does? If I can't find such a maven plugin, I guess I'll write an ANT script that is called by maven to do the repackaging.