Hi Jürgen,
I just check in a new version of log4j extension jar. Somehow the log4j orbit bundle was signed. As a result creating a new bundle from that jar corrupt the manifest. Therefore I took the original jar from Apache to create a new log4j bundle and add the missing imports. For example javax.mail was missing as optional import to support SMPTAppender. I tested the new log4j jar with the LogTester class you provided and it works for me.
Let me know if the new version still causes trouble.
Best regards
Peter
From: smila-dev-bounces@xxxxxxxxxxx [mailto:smila-dev-bounces@xxxxxxxxxxx] On Behalf Of Jürgen Schumacher
Sent: Mittwoch, 14. November 2012 11:22
To: Smila project developer mailing list
Subject: Re: [smila-dev] [smila-user] New features from branch
General:
- Modify log4j extension bundle to support SMTPAppender.
The modified JAR does not work here in "standard" Java application (i.e. no OSGi or Eclipse framework).
public class LogTester {
public static void main(final String[] args) {
org.apache.log4j.Logger.getLogger("test");
}
}
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:240)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:262)
at java.util.jar.JarVerifier.update(JarVerifier.java:216)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:341)
at java.util.jar.JarFile.getInputStream(JarFile.java:406)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:752)
at sun.misc.Resource.cachedInputStream(Resource.java:77)
at sun.misc.Resource.getByteBuffer(Resource.java:160)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at LogTester.main(LogTester.java:3)
It seems that your modification of the MANIFEST.MF is considered evil by the JDK class loader (-;