Discussion:
[jira] [Created] (LOG4J2-461) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Gaurav Kapoor (JIRA)
2013-12-04 19:26:35 UTC
Permalink
Gaurav Kapoor created LOG4J2-461:
------------------------------------

Summary: ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker


ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

Code:
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");


<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>



--
This message was sent by Atlassian JIRA
(v6.1#6144)
Remko Popma (JIRA)
2013-12-04 22:02:36 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-461:
-------------------------------

Description:
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

Code:
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}

was:
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

Code:
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");


<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>


Have you tried configuring with log4j internal logging switched on?
{code}
<Configuration status="debug">
...
</Configuration>
{code}

This will print any problems that log4j encounters during initialization to the console. Can you post the output of that here?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Gary Gregory (JIRA)
2013-12-04 22:08:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839382#comment-13839382 ]

Gary Gregory commented on LOG4J2-461:
-------------------------------------

Also, what is on your classpath?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Gaurav Kapoor (JIRA)
2013-12-05 05:16:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839828#comment-13839828 ]

Gaurav Kapoor commented on LOG4J2-461:
--------------------------------------

[~garydgregory] log4j-api-2.0-beta9.jar & log4j-core-2.0-beta9.jar is there in the Build path as I'm creating an Android App.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Gaurav Kapoor (JIRA)
2013-12-05 09:06:41 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839959#comment-13839959 ]

Gaurav Kapoor commented on LOG4J2-461:
--------------------------------------

[~***@yahoo.com] 12-05 14:49:55.832: W/System.err(11650): ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
12-05 14:49:55.832: W/System.err(11650): ERROR MainActivity Test Log4j2
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Remko Popma (JIRA)
2013-12-05 10:56:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13840011#comment-13840011 ]

Remko Popma commented on LOG4J2-461:
------------------------------------

Gaurav, the only way this error can occur is if the log4j-core-2.0-beta9.jar is not found in the classpath when your application executes.

You mention that this jar is in your Build path. Do you mean your IDE's Build path?
How do you run your Android App? Do you use an emulator? Can you print the value of system property "java.class.path" to the console when you start your app to ensure that it contains log4j-core-2.0-beta9.jar ?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Gaurav Kapoor (JIRA)
2013-12-05 12:29:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13840049#comment-13840049 ]

Gaurav Kapoor commented on LOG4J2-461:
--------------------------------------
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1#6144)
Remko Popma (JIRA)
2013-12-12 01:47:09 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13845989#comment-13845989 ]

Remko Popma edited comment on LOG4J2-461 at 12/12/13 1:45 AM:
--------------------------------------------------------------

(I'm copying my last comment from LOG4J2-460 here. I will mark LOG4J2-460 as a duplicate as I think it is the same underlying issue.)

This looks like a classpath issue. If both the core and the api jars are on the classpath, the LogManager class (which lives in the api jar) will load implementation classes from the core jar.
If the LogManager returns a org.apache.logging.log4j.simple.SimpleLoggerContext instance it means that it has been unable to find the core implementation on the classpath.

Specifically, it has been unable to find the /META-INF/log4j-provider.properties file that is in the core jar.

Can you print the value of system property {{java.class.path}} to the console from your application to verify that the core jar is on the classpath?



was (Author: ***@yahoo.com):
(I'm copying my last comment from LOG4J2-460 here. I will mark LOG4J2-461 as a duplicate as I think it is the same underlying issue.)

This looks like a classpath issue. If both the core and the api jars are on the classpath, the LogManager class (which lives in the api jar) will load implementation classes from the core jar.
If the LogManager returns a org.apache.logging.log4j.simple.SimpleLoggerContext instance it means that it has been unable to find the core implementation on the classpath.

Specifically, it has been unable to find the /META-INF/log4j-provider.properties file that is in the core jar.

Can you print the value of system property {{java.class.path}} to the console from your application to verify that the core jar is on the classpath?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)
Remko Popma (JIRA)
2013-12-12 01:47:07 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13845989#comment-13845989 ]

Remko Popma commented on LOG4J2-461:
------------------------------------

(I'm copying my last comment from LOG4J2-460 here. I will mark LOG4J2-461 as a duplicate as I think it is the same underlying issue.)

This looks like a classpath issue. If both the core and the api jars are on the classpath, the LogManager class (which lives in the api jar) will load implementation classes from the core jar.
If the LogManager returns a org.apache.logging.log4j.simple.SimpleLoggerContext instance it means that it has been unable to find the core implementation on the classpath.

Specifically, it has been unable to find the /META-INF/log4j-provider.properties file that is in the core jar.

Can you print the value of system property {{java.class.path}} to the console from your application to verify that the core jar is on the classpath?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)
Remko Popma (JIRA)
2014-01-11 06:00:52 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13868672#comment-13868672 ]

Remko Popma commented on LOG4J2-461:
------------------------------------

Hi Gaurav,
Has this issue been resolved, or do you still need help with this?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
Matt Sicker (JIRA)
2014-01-27 00:10:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13882483#comment-13882483 ]

Matt Sicker commented on LOG4J2-461:
------------------------------------

This might be a class loader issue if Android does weird things like OSGi does. I'll take a look into the issue if that turns out to be the case.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
Ronko (JIRA)
2014-03-18 03:15:44 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13938730#comment-13938730 ]

Ronko commented on LOG4J2-461:
------------------------------

Hi guys,
I have been just tripping over this and the error in LOG4J2-460. I tried to use log4j2 in a project last year, was hoping would be more stable by now, but been at it hours, and cannot get log4j2 to work.

I am using 2.0-rc1.

Maven builds (while executing plugins) are failing with these mentioned errors. I really think this is still a significant issue. When trying to executing mvn command line to build a jar, these errors occur.
mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Service Client 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ service-client ---
[INFO] Deleting /git/common/common/service-client/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ service-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ service-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 15 source files to /git/common/common/service-client/target/classes
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.305s
[INFO] Finished at: Mon Mar 17 23:05:17 EDT 2014
[INFO] Final Memory: 21M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project
service-client: Fatal error compiling: java.lang.ExceptionInInitializerError:
org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

As you can see, it fails during the maven-compiler-plugin. I have tried adding the dependencies to the plugin, but no change.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-rc1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.0-rc1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-rc1</version>
</dependency>

</dependencies>

</plugin>


Using java 1.7.0_51, OSX 10.9.2, Maven 3.1.1.
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Ronko (JIRA)
2014-03-18 20:56:43 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939771#comment-13939771 ]

Ronko commented on LOG4J2-461:
------------------------------

Hi guys, ok, have studied this immensely and the log4j2 source code, and believe I have found the issue with log4j2. LOG4J2-460 is directly related but I do not believe they are same issue. One causes the other.

We are trying to use AWS SWF FLow Framework. SWF flow runs annotation processor, which uses Freemarker, which is coded to log4j 1.x API. With the log4j1.2 api from log4j2, that should theoretically be fine, but read on.

TWO PROBLEMS
1) Log 4j2 CORE (only, apis are fine) will not load under some circumstances (such as from maven plugin reactor).

2) There are class cast code bugs in log4j2 code that are trying to cast wrong incompatible types. Details follow.

First, on 1)...

First issue: log4j2 core (ONLY) cannot be found or loaded under some circumstances. Log4j2 api and log4j1.2 api load fine under all circumstances I have found. I have gone through direct coding against core, forcing it via classpath, maven dependency, plugin dependency, (including system dependency), i have even written my own instance of org.apache.logging.log4j.spi.LoggerContextFactory, passed it in via system properly via properties-maven-plugin:set-system-properties:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>log4j2.loggerContextFactory</name>
<value>com.myco.common.commons.log.HackLogContextFactory</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>

Then I run maven-compiler-plugin (or maven processor plugin, both fail identically) WITH annotation processing. maven-compiler-plugin:compile then runs with proc jvm arg enabled. The APT annotation processor code in the AWS SKJ jar is found, and runs. It uses freemarker for templating.
Log4j2-1.2 api IS found, tries to load. It cannot find core, both are right beside each other in dependencies. No power I have found can cause it to find it.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
NOW is bug #2! SimpleLogger, LoggerContext, and SimpleLoggerContext, possibly others are coded across packages to cast the wrong types, it seems. When log4j2-1.2 API tries to load logging, it itself throws a class cast at org.apache.log4j.Logger.getLogger(Logger.java:39):

Caused by: java.lang.ExceptionInInitializerError
at freemarker.ext.beans.BeansWrapper.<clinit>(BeansWrapper.java:147)
at freemarker.template.ObjectWrapper.<clinit>(ObjectWrapper.java:81)
at freemarker.core.Configurable.<init>(Configurable.java:161)
at freemarker.template.Configuration.<init>(Configuration.java:195)
at freemarker.template.Configuration.<clinit>(Configuration.java:172)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.freemarker.ActivitiesCodeGenerator.getConfiguration(ActivitiesCodeGenerator.java:49)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.freemarker.ActivitiesCodeGenerator.generate(ActivitiesCodeGenerator.java:97)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.freemarker.ActivitiesCodeGenerator.generateActivitiesClientInterface(ActivitiesCodeGenerator.java:85)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.freemarker.ActivitiesCodeGenerator.generateCode(ActivitiesCodeGenerator.java:79)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.annotationprocessor.AsynchronyDeciderAnnotationProcessor.processActivities(AsynchronyDeciderAnnotationProcessor.java:120)
at com.amazonaws.eclipse.simpleworkflow.asynchrony.annotationprocessor.AsynchronyDeciderAnnotationProcessor.process(AsynchronyDeciderAnnotationProcessor.java:64)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:439)
... 26 more
Caused by: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at org.apache.log4j.Logger.getLogger(Logger.java:39)
at freemarker.log._Log4JLoggerFactory.getLogger(_Log4JLoggerFactory.java:67)
at freemarker.log.Logger.getLogger(Logger.java:284)
at freemarker.template.utility.SecurityUtilities.<clinit>(SecurityUtilities.java:66)

Here is why: SimpleLoggerContext (being run because CORE could not be found), extends:
org.apache.logging.log4j.spi.LoggerContext
But LOOK!
The class that Logger.java:39 tries to cast it to is of type:
org.apache.logging.log4j.core.LoggerContext

!!!!DIFFERENT!!!
Note the "spi" versus "core" in the package.

This causes the stack dump above.

THis same problem can be found elsewhere. When implemented my own HackLogContextFactory and passed it in via system prop, I got this:

ERROR StatusLogger org.apache.logging.log4j.core.impl.Log4jContextFactory does not implement org.apache.logging.log4j.spi.LoggerContextFactory

Again, types being cast to the wrong types.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-04-24 07:28:19 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979390#comment-13979390 ]

Abid commented on LOG4J2-461:
-----------------------------

Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}


- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-04-24 07:30:16 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979390#comment-13979390 ]

Abid edited comment on LOG4J2-461 at 4/24/14 7:28 AM:
------------------------------------------------------

Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks


was (Author: pirabid):
Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}


- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-04-24 07:30:19 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Abid updated LOG4J2-461:
------------------------

Attachment: MANIFEST.MF
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-04-24 07:34:14 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979390#comment-13979390 ]

Abid edited comment on LOG4J2-461 at 4/24/14 7:32 AM:
------------------------------------------------------

Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.MyAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks


was (Author: pirabid):
Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-04-24 07:34:16 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979390#comment-13979390 ]

Abid edited comment on LOG4J2-461 at 4/24/14 7:32 AM:
------------------------------------------------------

Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.MyAuditProviderImpl.initialize(MyAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks


was (Author: pirabid):
Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.MyAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Matt Sicker (JIRA)
2014-04-27 20:08:15 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Sicker updated LOG4J2-461:
-------------------------------

Affects Version/s: 2.0-rc1
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Matt Sicker (JIRA)
2014-04-27 20:08:15 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13982448#comment-13982448 ]

Matt Sicker commented on LOG4J2-461:
------------------------------------

I've made a bunch of updates to the OSGi handling. Could you try this again with the latest trunk? I noticed you're using WebLogic which uses OSGi internally from what I recall (depending on the version of WL that is). You should still get an error at startup about using SimpleLoggerContextFactory, but log4j-core will override that when it's started as a bundle.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: API
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Ralph Goers (JIRA)
2014-05-10 22:04:03 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13994139#comment-13994139 ]

Ralph Goers commented on LOG4J2-461:
------------------------------------

Abid, are you getting any messages routed to wherever weblogic routes system.err?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Ralph Goers (JIRA)
2014-05-10 22:04:03 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers updated LOG4J2-461:
-------------------------------

Component/s: (was: API)
log4j 1.2 emulation
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Ralph Goers (JIRA)
2014-05-10 22:04:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13994138#comment-13994138 ]

Ralph Goers commented on LOG4J2-461:
------------------------------------

This is a duplicate of LOG4J2-146. The Log4j 1.2 bridge requires that the Log4j 2 core be available for it to work properly. I am not sure that that dependency can be removed.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-01 11:37:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14014963#comment-14014963 ]

Abid commented on LOG4J2-461:
-----------------------------

Sorry for the delay Ralph...was on vacation... I will test it soon and let you know the results.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 06:18:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021116#comment-14021116 ]

Abid commented on LOG4J2-461:
-----------------------------

Tried with the latest trunk however still same classcast error when I place the jars inside subdirectory of WL_HOME/server/lib/mbeantypes.


{code:title=std.out/error|borderStyle=solid}

<Jun 8, 2014 8:38:33 AM AST> <Notice> <Log Management> <BEA-170019> <The server
log file D:\tqa0666\oracle\wls1036\user_projects\domains\TestDomain1\servers\Adm
inServer\logs\AdminServer.log is opened. All server side log events will be writ
ten to this file.>
QNBAuditProviderImpl.initialize
activeHandlerEntries.length=1
handlerEnabled=true
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

<Jun 8, 2014 8:38:34 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm
" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.
logging.log4j.core.LoggerContext.
weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1789)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:443)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
Truncated. see log file for complete stacktrace
Caused By: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(WLSIdentityServiceImpl.java:43)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:60)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 8:38:35 AM AST> <Notice> <Security> <BEA-090082> <Security initiali
zing using security realm myrealm.>
<Jun 8, 2014 8:38:35 AM AST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

There are 1 nested errors:

weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:917)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FAILED>
<Jun 8, 2014 8:38:35 AM AST> <Error> <WebLogicServer> <BEA-000383> <A critical s
ervice failed. The server will shut itself down>
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FORCE_SHUTTING_DOWN>

{code}
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 06:18:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021116#comment-14021116 ]

Abid edited comment on LOG4J2-461 at 6/8/14 6:17 AM:
-----------------------------------------------------

Tried with the latest trunk however still same classcast error when I place the jars inside subdirectory of WL_HOME/server/lib/mbeantypes.


{code:title=std.out/error|borderStyle=solid}

<Jun 8, 2014 8:38:33 AM AST> <Notice> <Log Management> <BEA-170019> <The server
log file D:\tqa0666\oracle\wls1036\user_projects\domains\TestDomain1\servers\Adm
inServer\logs\AdminServer.log is opened. All server side log events will be writ
ten to this file.>
QNBAuditProviderImpl.initialize
activeHandlerEntries.length=1
handlerEnabled=true
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

<Jun 8, 2014 8:38:34 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm
" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.
logging.log4j.core.LoggerContext.weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1789)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:443)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
Truncated. see log file for complete stacktrace
Caused By: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(WLSIdentityServiceImpl.java:43)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:60)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 8:38:35 AM AST> <Notice> <Security> <BEA-090082> <Security initiali
zing using security realm myrealm.>
<Jun 8, 2014 8:38:35 AM AST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

There are 1 nested errors:

weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:917)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FAILED>
<Jun 8, 2014 8:38:35 AM AST> <Error> <WebLogicServer> <BEA-000383> <A critical s
ervice failed. The server will shut itself down>
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FORCE_SHUTTING_DOWN>

{code}


was (Author: pirabid):
Tried with the latest trunk however still same classcast error when I place the jars inside subdirectory of WL_HOME/server/lib/mbeantypes.


{code:title=std.out/error|borderStyle=solid}

<Jun 8, 2014 8:38:33 AM AST> <Notice> <Log Management> <BEA-170019> <The server
log file D:\tqa0666\oracle\wls1036\user_projects\domains\TestDomain1\servers\Adm
inServer\logs\AdminServer.log is opened. All server side log events will be writ
ten to this file.>
QNBAuditProviderImpl.initialize
activeHandlerEntries.length=1
handlerEnabled=true
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger

<Jun 8, 2014 8:38:34 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm
" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.
logging.log4j.core.LoggerContext.
weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1789)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:443)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
Truncated. see log file for complete stacktrace
Caused By: com.bea.common.engine.ServiceInitializationException: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(WLSIdentityServiceImpl.java:43)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
at com.qnb.itd.wls.sec.providers.QNBAuditProviderImpl.initialize(QNBAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:60)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 8:38:35 AM AST> <Notice> <Security> <BEA-090082> <Security initiali
zing using security realm myrealm.>
<Jun 8, 2014 8:38:35 AM AST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

There are 1 nested errors:

weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:917)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FAILED>
<Jun 8, 2014 8:38:35 AM AST> <Error> <WebLogicServer> <BEA-000383> <A critical s
ervice failed. The server will shut itself down>
<Jun 8, 2014 8:38:35 AM AST> <Notice> <WebLogicServer> <BEA-000365> <Server stat
e changed to FORCE_SHUTTING_DOWN>

{code}
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 06:20:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979390#comment-13979390 ]

Abid edited comment on LOG4J2-461 at 6/8/14 6:19 AM:
-----------------------------------------------------

Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.MyAuditProviderImpl.initialize(MyAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

{code:title=MyAuditProviderImpl.java|borderStyle=solid}
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}

{code}

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks


was (Author: pirabid):
Hi,

I am also hitting the same ClassCastException issue while trying to run the log4j2 in WebLogic application server. Here is what I have done:

- if I put the api and core jars into DOMAIN_HOME/lib (equivalent to adding the jars into server classpath) things run okay.

- if I put the api and core jars into WL_HOME/server/lib/mbeantypes/3rdpartyjars, then this classcast exception is thrown:

java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext
at com.qnb.itd.wls.sec.providers.MyAuditProviderImpl.initialize(MyAuditProviderImpl.java:108)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:65)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(Unknown Source)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealms(Unknown Source)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(Unknown Source)
at weblogic.security.service.SecurityServiceManager.initialize(Unknown Source)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
With code snippet:

===============starts==================
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.LogManager;
...
...

public final class MyAuditProviderImpl implements AuditProvider, AuditChannel{
...
...


public void initialize(ProviderMBean mbean, SecurityServices services){
...
...
LoggerContext ctx = null;
Configuration config = null;
Map mp = null;

ctx = (LoggerContext) LogManager.getContext(false);
mp = config.getAppenders();
System.out.println("***<MyAudit Provider o/p follows> Before logger re-configuration:");
System.out.println("\tAppenders:" + mp.keySet());
...
...
}
}
===============ends==================

- with least hope to solve this issue, I also merged the two jars carefully (making sure MANIFEST.MF has all the entries) into single one but still same issue.

Hope this helps in someway to identify what is going wrong.

I am ready to test to collect any additional data for debugging.


Thanks
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 06:39:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021120#comment-14021120 ]

Abid commented on LOG4J2-461:
-----------------------------

Adding of jars into subdirectory of "WL_HOME/server/lib/mbeantypes" was suggested by Oracle Support with whom I have an SR open to track this issue. But I think this suggestion was not correct because I suspect that WLS loads each jar inside the subdirectory inside a separate classloader and hence this visibility issue between API and core jars. So I dropped this option floated as a half-hearted solution by Oracle. And they have not been able to suggest anything so far.

Given your pointers on weblogic use of OSGi, I packaged the core and api jars with my custom security provider jar (which is generated by WLS tools), and modified "MANIFEST.MF" to have entries:

{code:title=MANIFEST.MF|borderStyle=solid}
...
..
Name: log4j-core-2.0-rc2-SNAPSHOT.jar
Name: log4j-api-2.0-rc2-SNAPSHOT.jar
Bundle-ClassPath: log4j-api-2.0-rc2-SNAPSHOT.jar,log4j-core-2.0-rc2-SNAPSHOT.jar,disruptor-3.2.0.jar,log4j2.xml,.
{code}


But nothing progressive; now WLS starts to throw NoClassDefFoundError:

{code:title=std.out/error|borderStyle=solid}
<Jun 8, 2014 9:08:27 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
Caused By: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:46)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 9:08:28 AM AST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
...
...
{code}

Thanks,
Abid
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 06:43:02 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021120#comment-14021120 ]

Abid edited comment on LOG4J2-461 at 6/8/14 6:42 AM:
-----------------------------------------------------

Adding of jars into subdirectory of "WL_HOME/server/lib/mbeantypes" was suggested by Oracle Support with whom I have an SR open to track this issue. But I think this suggestion was not correct because I suspect that WLS loads each jar inside the subdirectory inside a separate classloader and hence this visibility issue between API and core jars. So I dropped this option floated as a half-hearted solution by Oracle. And they have not been able to suggest anything so far.

Given your pointers on weblogic use of OSGi, I packaged the core and api jars with my custom security provider jar (which is generated by WLS tools), I modified "MANIFEST.MF" to have entries:

{code:title=MANIFEST.MF|borderStyle=solid}
...
..
Name: log4j-core-2.0-rc2-SNAPSHOT.jar
Name: log4j-api-2.0-rc2-SNAPSHOT.jar
Bundle-ClassPath: log4j-api-2.0-rc2-SNAPSHOT.jar,log4j-core-2.0-rc2-SNAPSHOT.jar,disruptor-3.2.0.jar,log4j2.xml,.
{code}


But nothing progressive; now WLS starts to throw NoClassDefFoundError:

{code:title=std.out/error|borderStyle=solid}
<Jun 8, 2014 9:08:27 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
Caused By: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:46)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 9:08:28 AM AST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
...
...
{code}

Thanks,
Abid


was (Author: pirabid):
Adding of jars into subdirectory of "WL_HOME/server/lib/mbeantypes" was suggested by Oracle Support with whom I have an SR open to track this issue. But I think this suggestion was not correct because I suspect that WLS loads each jar inside the subdirectory inside a separate classloader and hence this visibility issue between API and core jars. So I dropped this option floated as a half-hearted solution by Oracle. And they have not been able to suggest anything so far.

Given your pointers on weblogic use of OSGi, I packaged the core and api jars with my custom security provider jar (which is generated by WLS tools), and modified "MANIFEST.MF" to have entries:

{code:title=MANIFEST.MF|borderStyle=solid}
...
..
Name: log4j-core-2.0-rc2-SNAPSHOT.jar
Name: log4j-api-2.0-rc2-SNAPSHOT.jar
Bundle-ClassPath: log4j-api-2.0-rc2-SNAPSHOT.jar,log4j-core-2.0-rc2-SNAPSHOT.jar,disruptor-3.2.0.jar,log4j2.xml,.
{code}


But nothing progressive; now WLS starts to throw NoClassDefFoundError:

{code:title=std.out/error|borderStyle=solid}
<Jun 8, 2014 9:08:27 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
Caused By: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:46)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 9:08:28 AM AST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
...
...
{code}

Thanks,
Abid
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 07:04:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021120#comment-14021120 ]

Abid edited comment on LOG4J2-461 at 6/8/14 7:02 AM:
-----------------------------------------------------

Adding of jars into subdirectory of "WL_HOME/server/lib/mbeantypes" was suggested by Oracle Support with whom I have an SR open to track this issue. But I think this suggestion was not correct because I suspect that WLS loads each jar inside the subdirectory inside a separate classloader and hence this visibility issue between API and core jars. So I dropped this option floated as a half-hearted solution by Oracle. And they have not been able to suggest anything new so far.

Given your pointers on weblogic use of OSGi, I packaged the core and api jars with my custom security provider jar (which is generated by WLS tools), I modified "MANIFEST.MF" to have entries:

{code:title=MANIFEST.MF|borderStyle=solid}
...
..
Name: log4j-core-2.0-rc2-SNAPSHOT.jar
Name: log4j-api-2.0-rc2-SNAPSHOT.jar
Bundle-ClassPath: log4j-api-2.0-rc2-SNAPSHOT.jar,log4j-core-2.0-rc2-SNAPSHOT.jar,disruptor-3.2.0.jar,log4j2.xml,.
{code}


But nothing progressive; now WLS starts to throw NoClassDefFoundError:

{code:title=std.out/error|borderStyle=solid}
<Jun 8, 2014 9:08:27 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
Caused By: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:46)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 9:08:28 AM AST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
...
...
{code}

Thanks,
Abid


was (Author: pirabid):
Adding of jars into subdirectory of "WL_HOME/server/lib/mbeantypes" was suggested by Oracle Support with whom I have an SR open to track this issue. But I think this suggestion was not correct because I suspect that WLS loads each jar inside the subdirectory inside a separate classloader and hence this visibility issue between API and core jars. So I dropped this option floated as a half-hearted solution by Oracle. And they have not been able to suggest anything so far.

Given your pointers on weblogic use of OSGi, I packaged the core and api jars with my custom security provider jar (which is generated by WLS tools), I modified "MANIFEST.MF" to have entries:

{code:title=MANIFEST.MF|borderStyle=solid}
...
..
Name: log4j-core-2.0-rc2-SNAPSHOT.jar
Name: log4j-api-2.0-rc2-SNAPSHOT.jar
Bundle-ClassPath: log4j-api-2.0-rc2-SNAPSHOT.jar,log4j-core-2.0-rc2-SNAPSHOT.jar,disruptor-3.2.0.jar,log4j2.xml,.
{code}


But nothing progressive; now WLS starts to throw NoClassDefFoundError:

{code:title=std.out/error|borderStyle=solid}
<Jun 8, 2014 9:08:27 AM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
Caused By: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Logger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:46)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Truncated. see log file for complete stacktrace
<Jun 8, 2014 9:08:28 AM AST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
...
...
{code}

Thanks,
Abid
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-08 10:24:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021168#comment-14021168 ]

Abid commented on LOG4J2-461:
-----------------------------

I have managed to reproduce the issue without log4j api and core jars. I created dummy ClassA (whose object I instantiate in custom security provider implementation class) and ClassB (object instantiated in ClassA) in jars A.jar and B.jar respectively, bundled these with the WLS custom security provider and modified the manifest file bundle-classpath - am getting same "NoClassDefFoundError"

{code}
<Jun 8, 2014 1:16:01 PM AST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: examples/pack1/A.
weblogic.security.service.SecurityServiceException: java.lang.NoClassDefFoundError: examples/pack1/A
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
...
...
{code}

Will check with Oracle Support on this.

Thanks,
Abid
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-06-08 12:36:01 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14021177#comment-14021177 ]

Remko Popma commented on LOG4J2-461:
------------------------------------

Nice detective work, Abid!
Glad to hear you have a workaround by putting api and core jars into DOMAIN_HOME/lib, but I'd be interested in Oracle Weblogic support team's response to your inquiry.
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-19 07:35:24 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14037073#comment-14037073 ]

Abid commented on LOG4J2-461:
-----------------------------

Got an update from Oracle which essentially means that packaging of library jars with the security provider is not supported; library jars for security provider have to go into server classpath in one way or the other.

For me this would mean taking risk of exposing those jars at global level to whole bunch of multi-vendor applications (deployed into weblogic environment) who use their own different versions of log4j libraries.

Oracle raised an Enhancement Request of low severity in this regard :(
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Ralph Goers (JIRA)
2014-06-21 05:34:24 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14039701#comment-14039701 ]

Ralph Goers commented on LOG4J2-461:
------------------------------------

Is there a link to the enhancement request that you can add here for completeness?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Abid (JIRA)
2014-06-22 10:32:24 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14040098#comment-14040098 ]

Abid commented on LOG4J2-461:
-----------------------------

It can be looked up in Oracle Support site as:

Bug 18998060 : CUSTOM SECURITY PROVIDER IMPLEMENTATION WITH LOG4J2+DISRUPTER
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Priority: Blocker
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-25 05:56:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-461:
-------------------------------

Priority: Major (was: Blocker)

Changed priority from "Blocking" to "Major" since a workaround exists (put the api and core jars into DOMAIN_HOME/lib ).

Also it appears that this is a WebLogic problem rather than a log4j2 problem. Should we still keep this issue open?
Post by Gaurav Kapoor (JIRA)
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
---------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-26 15:09:38 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-461:
-------------------------------

Summary: (Android) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger (was: ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger)
(Android) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
-------------------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Labels: Android
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Remko Popma (JIRA)
2014-07-26 15:09:39 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma updated LOG4J2-461:
-------------------------------

Labels: Android (was: )
Post by Remko Popma (JIRA)
(Android) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
-------------------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Labels: Android
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Nelson MELINA (JIRA)
2014-08-11 15:16:12 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14092862#comment-14092862 ]

Nelson MELINA commented on LOG4J2-461:
--------------------------------------

[~gauravk] Did you manage to make Log4J 2 work on Android ?
Post by Remko Popma (JIRA)
(Android) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
-------------------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Labels: Android
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
Snehadeep Sethia (JIRA)
2014-09-04 18:42:52 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14121744#comment-14121744 ]

Snehadeep Sethia commented on LOG4J2-461:
-----------------------------------------

I'm get the following message on an OSGi project. "ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...", I'm using log4j-api v2.0.2 and log4j-core v2.0.2; The logger works very well on a stand alone java project but fails on an eclipse project. Any pointers?
Post by Remko Popma (JIRA)
(Android) ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
-------------------------------------------------------------------------------------------
Key: LOG4J2-461
URL: https://issues.apache.org/jira/browse/LOG4J2-461
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.0-beta9, 2.0-rc1
Environment: Android
Reporter: Gaurav Kapoor
Labels: Android
Attachments: MANIFEST.MF
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
Logger LOG = LogManager.getLogger(MainActivity.class);
LOG.error("Test Log4j2");
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="hello" level="info"/>
<Root level="trace">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Loading...