You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jeff Drew <je...@gmail.com> on 2006/12/05 18:08:40 UTC

building a jar with SMTP appender in it?

When I build an application .jar, I include the log4j classes I need. This
works fine. However, I'm now using SMTP appender and get an error.  I have
the activation.jar in my .jar in the same path as the jaf1-1 framework
does.  Here is the exception.

Any suggestions would be appreciated.

Thanks

Jeff

Exception in thread "main" java.lang.SecurityException: no manifiest section
for
 signature file entry javax/activation/DataContentHandlerFactory.class
        at sun.security.util.SignatureFileVerifier.verifySection
(SignatureFileVe
rifier.java:329)
        at sun.security.util.SignatureFileVerifier.process0
(SignatureFileVerifie
r.java:241)
        at sun.security.util.SignatureFileVerifier.process
(SignatureFileVerifier
.java:191)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
        at java.util.jar.JarVerifier.update(JarVerifier.java:194)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
        at java.util.jar.JarFile.getInputStream(JarFile.java:362)
        at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:619)
        at sun.misc.Resource.getBytes(Resource.java:57)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

Re: building a jar with SMTP appender in it?

Posted by patrick <Pa...@mobilesolutions.ch>.
the problem with this is that you have to manually merge the META-INF and
especially the manifest.mf
otherwise there is a possibility to get the  "SecurityException: no
manifiest" as the original post said or any number of other strange
behaviour.
for some jar files you may also get into legal problems if you repackage
them.
that's why i would recommend to use One-JAR or something like that (i think
there was one called superjar or something)

cheers
patrick


Bence Takács wrote:
> 
> sorry: it is recommended to extract the contents of the inner.jar into
> the would-be main.jar's /lib directory
> 
> On 12/6/06, Bence Takács <ta...@gmail.com> wrote:
>> The simple solution is: extract the would-be inner jars into the
>> source directory of the would-be main.jar and after that you pack the
>> whole thing into a jar.
>>
>> There would be further solutions, but I tried only this, and this works.
>>
>> Regards:
>>    Bence
>>
>> On 12/6/06, patrick <Pa...@mobilesolutions.ch> wrote:
>> >
>> > i'm not an expert at this but...
>> >
>> > 1) make sure you also put the information from MEAT-INF into your jar
>> file
>> > or
>> > 2) use One-JAR to package several jar files into one
>> > http://www-128.ibm.com/developerworks/library/j-onejar/
>> >
>> > cheers
>> > patrick
>> >
>> >
>> > Jeff Drew-2 wrote:
>> > >
>> > > When I build an application .jar, I include the log4j classes I need.
>> This
>> > > works fine. However, I'm now using SMTP appender and get an error.  I
>> have
>> > > the activation.jar in my .jar in the same path as the jaf1-1
>> framework
>> > > does.  Here is the exception.
>> > >
>> > > Any suggestions would be appreciated.
>> > >
>> > > Thanks
>> > >
>> > > Jeff
>> > >
>> > > Exception in thread "main" java.lang.SecurityException: no manifiest
>> > > section
>> > > for
>> > >  signature file entry
>> javax/activation/DataContentHandlerFactory.class
>> > >         at sun.security.util.SignatureFileVerifier.verifySection
>> > > (SignatureFileVe
>> > > rifier.java:329)
>> > >         at sun.security.util.SignatureFileVerifier.process0
>> > > (SignatureFileVerifie
>> > > r.java:241)
>> > >         at sun.security.util.SignatureFileVerifier.process
>> > > (SignatureFileVerifier
>> > > .java:191)
>> > >         at
>> java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
>> > >         at java.util.jar.JarVerifier.update(JarVerifier.java:194)
>> > >         at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
>> > >         at java.util.jar.JarFile.getInputStream(JarFile.java:362)
>> > >         at
>> sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:619)
>> > >         at sun.misc.Resource.getBytes(Resource.java:57)
>> > >         at
>> java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
>> > >         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>> > >         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>> > >         at java.security.AccessController.doPrivileged(Native Method)
>> > >         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>> > >         at
>> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>> > >         at
>> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/building-a-jar-with-SMTP-appender-in-it--tf2762939.html#a7715087
>> > Sent from the Log4j - Users mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> > For additional commands, e-mail: log4j-user-help@logging.apache.org
>> >
>> >
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/building-a-jar-with-SMTP-appender-in-it--tf2762939.html#a7722637
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: building a jar with SMTP appender in it?

Posted by Bence Takács <ta...@gmail.com>.
sorry: it is recommended to extract the contents of the inner.jar into
the would-be main.jar's /lib directory

On 12/6/06, Bence Takács <ta...@gmail.com> wrote:
> The simple solution is: extract the would-be inner jars into the
> source directory of the would-be main.jar and after that you pack the
> whole thing into a jar.
>
> There would be further solutions, but I tried only this, and this works.
>
> Regards:
>    Bence
>
> On 12/6/06, patrick <Pa...@mobilesolutions.ch> wrote:
> >
> > i'm not an expert at this but...
> >
> > 1) make sure you also put the information from MEAT-INF into your jar file
> > or
> > 2) use One-JAR to package several jar files into one
> > http://www-128.ibm.com/developerworks/library/j-onejar/
> >
> > cheers
> > patrick
> >
> >
> > Jeff Drew-2 wrote:
> > >
> > > When I build an application .jar, I include the log4j classes I need. This
> > > works fine. However, I'm now using SMTP appender and get an error.  I have
> > > the activation.jar in my .jar in the same path as the jaf1-1 framework
> > > does.  Here is the exception.
> > >
> > > Any suggestions would be appreciated.
> > >
> > > Thanks
> > >
> > > Jeff
> > >
> > > Exception in thread "main" java.lang.SecurityException: no manifiest
> > > section
> > > for
> > >  signature file entry javax/activation/DataContentHandlerFactory.class
> > >         at sun.security.util.SignatureFileVerifier.verifySection
> > > (SignatureFileVe
> > > rifier.java:329)
> > >         at sun.security.util.SignatureFileVerifier.process0
> > > (SignatureFileVerifie
> > > r.java:241)
> > >         at sun.security.util.SignatureFileVerifier.process
> > > (SignatureFileVerifier
> > > .java:191)
> > >         at java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
> > >         at java.util.jar.JarVerifier.update(JarVerifier.java:194)
> > >         at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
> > >         at java.util.jar.JarFile.getInputStream(JarFile.java:362)
> > >         at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:619)
> > >         at sun.misc.Resource.getBytes(Resource.java:57)
> > >         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
> > >         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> > >         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> > >         at java.security.AccessController.doPrivileged(Native Method)
> > >         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> > >         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > >         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/building-a-jar-with-SMTP-appender-in-it--tf2762939.html#a7715087
> > Sent from the Log4j - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: building a jar with SMTP appender in it?

Posted by Bence Takács <ta...@gmail.com>.
The simple solution is: extract the would-be inner jars into the
source directory of the would-be main.jar and after that you pack the
whole thing into a jar.

There would be further solutions, but I tried only this, and this works.

Regards:
   Bence

On 12/6/06, patrick <Pa...@mobilesolutions.ch> wrote:
>
> i'm not an expert at this but...
>
> 1) make sure you also put the information from MEAT-INF into your jar file
> or
> 2) use One-JAR to package several jar files into one
> http://www-128.ibm.com/developerworks/library/j-onejar/
>
> cheers
> patrick
>
>
> Jeff Drew-2 wrote:
> >
> > When I build an application .jar, I include the log4j classes I need. This
> > works fine. However, I'm now using SMTP appender and get an error.  I have
> > the activation.jar in my .jar in the same path as the jaf1-1 framework
> > does.  Here is the exception.
> >
> > Any suggestions would be appreciated.
> >
> > Thanks
> >
> > Jeff
> >
> > Exception in thread "main" java.lang.SecurityException: no manifiest
> > section
> > for
> >  signature file entry javax/activation/DataContentHandlerFactory.class
> >         at sun.security.util.SignatureFileVerifier.verifySection
> > (SignatureFileVe
> > rifier.java:329)
> >         at sun.security.util.SignatureFileVerifier.process0
> > (SignatureFileVerifie
> > r.java:241)
> >         at sun.security.util.SignatureFileVerifier.process
> > (SignatureFileVerifier
> > .java:191)
> >         at java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
> >         at java.util.jar.JarVerifier.update(JarVerifier.java:194)
> >         at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
> >         at java.util.jar.JarFile.getInputStream(JarFile.java:362)
> >         at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:619)
> >         at sun.misc.Resource.getBytes(Resource.java:57)
> >         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
> >         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
> >         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> >         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> >         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> >
> >
>
> --
> View this message in context: http://www.nabble.com/building-a-jar-with-SMTP-appender-in-it--tf2762939.html#a7715087
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: building a jar with SMTP appender in it?

Posted by patrick <Pa...@mobilesolutions.ch>.
i'm not an expert at this but...

1) make sure you also put the information from MEAT-INF into your jar file
or
2) use One-JAR to package several jar files into one
http://www-128.ibm.com/developerworks/library/j-onejar/

cheers
patrick


Jeff Drew-2 wrote:
> 
> When I build an application .jar, I include the log4j classes I need. This
> works fine. However, I'm now using SMTP appender and get an error.  I have
> the activation.jar in my .jar in the same path as the jaf1-1 framework
> does.  Here is the exception.
> 
> Any suggestions would be appreciated.
> 
> Thanks
> 
> Jeff
> 
> Exception in thread "main" java.lang.SecurityException: no manifiest
> section
> for
>  signature file entry javax/activation/DataContentHandlerFactory.class
>         at sun.security.util.SignatureFileVerifier.verifySection
> (SignatureFileVe
> rifier.java:329)
>         at sun.security.util.SignatureFileVerifier.process0
> (SignatureFileVerifie
> r.java:241)
>         at sun.security.util.SignatureFileVerifier.process
> (SignatureFileVerifier
> .java:191)
>         at java.util.jar.JarVerifier.processEntry(JarVerifier.java:239)
>         at java.util.jar.JarVerifier.update(JarVerifier.java:194)
>         at java.util.jar.JarFile.initializeVerifier(JarFile.java:300)
>         at java.util.jar.JarFile.getInputStream(JarFile.java:362)
>         at sun.misc.URLClassPath$5.getInputStream(URLClassPath.java:619)
>         at sun.misc.Resource.getBytes(Resource.java:57)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> 
> 

-- 
View this message in context: http://www.nabble.com/building-a-jar-with-SMTP-appender-in-it--tf2762939.html#a7715087
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org