java -cp servicemix-exercises-osgi-service-2010.07.12.jar com.fusesource.training.service.greet.impl.GreeterImpl
Exception in thread "main" java.lang.SecurityException: SHA1 digest error for com/fusesource/training/service/greet/impl/GreeterImpl.class
at sun.security.util.ManifestEntryVerifier.verify(ManifestEntryVerifier.java:198)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:212)
at java.util.jar.JarVerifier.update(JarVerifier.java:199)
at java.util.jar.JarVerifier$VerifierStream.read(JarVerifier.java:449)
at sun.misc.Resource.getBytes(Resource.java:108)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:257)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
osgi_service_hack.zip contains an updated version of com/fusesource/training/service/greet/impl/GreeterImpl.class
instruction to replicate issue:
1)setup felix framework security as described in http://felix.apache.org/site/apache-felix-framework-security.html
.
2) install osgi bundle in servicemix
update cached bundle within servicemix :
3)Restart servicemix,
This should throw a "java.lang.SecurityException: SHA1 digest error for com/fusesource/training/service/greet/impl/GreeterImpl.class* or something similar BUT currently does not.
check the bundle is updated correctly:
To verify you have "tampered"/updated the bundle correctly you can try the following command on the updated bundle. This should result in the following exception if the version of the class does not match the signature contained in the manifest.mf file. (which is the case after the bundle is updated)