[ 
https://issues.apache.org/jira/browse/LOG4J2-752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14705826#comment-14705826
 ] 

Zachary Boe commented on LOG4J2-752:
------------------------------------

Upon further inspection (and a year later), I've boiled this down a little 
further. If I run my app on the command line with the command "java -cp 
lib/log4j-api-2.3.jar:lib/log4j-core-2.3.jar:App.jar main.Main" then it works 
just fine, even with Webstart enabled. The Jar is built with Ant from Netbeans, 
and has the Class-Path directive set in the manifest to include the two log4j2 
libs.

I would really like to able to use "java -jar App.jar" and have this work. It 
seems like it's picking up the jars for the purpose of running the code, but it 
just can't find the Log4j2Plugins.dat file inside is what I'm thinking. I'm at 
a loss here. Any help would be appreciated.

> Log4J2 not finding core Log4J2Plugins.dat when a custom appender is present
> ---------------------------------------------------------------------------
>
>                 Key: LOG4J2-752
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-752
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0
>         Environment: RHEL 6
> Netbeans 7.4
> Java 1.7.0u45
>            Reporter: Zachary Boe
>
> I'm working on a GUI that needs to be webstart capable.  I have a custom 
> appender that I use to capture logging entries in memory so they can be 
> displayed on a Swing panel for the user.  Everything runs fine when I run it 
> straight from the IDE, but things get wonky when I try to build the jars and 
> run with the "java -jar" incantation.
> In short, with the webstart option *on* and when the custom appender is 
> present (in a package in the src/ folder, not even referenced anywhere else 
> in code or in log4j2.xml), Log4J2 will fail to find the Log4J2Plugins.dat 
> file in the log4j2-core jar, and will subsequently fail to find any other 
> appenders/loggers besides my custom one. Upon removing the package with the 
> custom appender, Log4J2 will find it's own .dat file and everything is fine.
> With the webstart option *off* in the netbeans menu (which all it seems to 
> do, by looking a diff, is remove the "Codebase: *" line from 
> META-INF/MANIFEST.MF), the custom appender and log4j2 work in harmony.
> I have the log4j2-core and log4j2-api jars added as compile-time libraries. I 
> can unzip the log4j2-core jar and my application jar after everything is 
> built and find the respective Log4J2Plugins.dat files in each jar.
> I have example netbeans projects which I can hopefully attach at request to 
> demonstrate this problem. I feel I've done a great bit of troubleshooting to 
> narrow down this problem. Hopefully this can be resolved, or I may have to 
> downgrade to log4j, since it's known working on other projects in house.
> Thanks for your help!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to