You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Hassan Kalaldeh (JIRA)" <ji...@apache.org> on 2014/11/16 12:36:33 UTC

[jira] [Comment Edited] (LOG4J2-890) log4j-web-2.1 doesn't work under JBOSS EAC 6.2

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

Hassan Kalaldeh edited comment on LOG4J2-890 at 11/16/14 11:35 AM:
-------------------------------------------------------------------

I found what is the problem, if you extract log4j-web-2.1.jar and open servlet container Initializer service in file :  log4j-web-2.1\META-INF\services\javax.servlet.ServletContainerInitializer you will find this:
{code:title=javax.servlet.ServletContainerInitializer|borderStyle=solid}
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache license, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the license for the specific language governing permissions and
# limitations under the license.
#
org.apache.logging.log4j.web.Log4jServletContainerInitializer
{code}

I've been reading JBoss deployer source code and I found it always read first row of service file
// this line from ServletContainerInitializerDeploymentProcessor.loadSci()
String servletContainerInitializerClassName = reader.readLine();

so when I manually edit the service file and just keep the last line (org.apache.logging.log4j.web.Log4jServletContainerInitializer) it works fine now :)

I'm not sure whether it's a bug from Log4j2 side or JBoss AS, but I was looking at previous release log4j-web-2.0.2.jar and I see you have only one line in that file (org.apache.logging.log4j.web.Log4jServletContainerInitializer) and that's why it works fine in that release.

I'll inform JBoss AS about this reading service issue to avoid in next releases.




was (Author: hassan.kalaldeh):
I found what is the problem, if you extract log4j-web-2.1.jar and open servlet container Initializer service in file :  log4j-web-2.1\META-INF\services\javax.servlet.ServletContainerInitializer you will find this:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache license, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the license for the specific language governing permissions and
# limitations under the license.
#
org.apache.logging.log4j.web.Log4jServletContainerInitializer

I've been reading JBoss deployer source code and I found it always read first row of service file
// this line from ServletContainerInitializerDeploymentProcessor.loadSci()
String servletContainerInitializerClassName = reader.readLine();

so when I manually edit the service file and just keep the last line (org.apache.logging.log4j.web.Log4jServletContainerInitializer) it works fine now :)

I'm not sure whether it's a bug from Log4j2 side or JBoss AS, but I was looking at previous release log4j-web-2.0.2.jar and I see you have only one line in that file (org.apache.logging.log4j.web.Log4jServletContainerInitializer) and that's why it works fine in that release.

I'll inform JBoss AS about this reading service issue to avoid in next releases.



> log4j-web-2.1 doesn't work under JBOSS EAC 6.2
> ----------------------------------------------
>
>                 Key: LOG4J2-890
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-890
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Web/Servlet
>    Affects Versions: 2.1
>         Environment: JBOSS EAC 6.2
>            Reporter: Hassan Kalaldeh
>
> I just upgraded my web project from log4j 2.0.2 to 2.1, after the upgrade I get the error below.
> when I deploy same project under tomcat 7.0 it works fine, so it looks like a compatibility issue between log4j-web-2.1.jar and jboss eac.
> problem is fixed when I keep using old log4j-web-2.0.2.jar with other log4j2.1 libraries, any idea ?
> also is it safe to use log4j-web-2.0.2.jar with other log4j2.1 libraries till this issue get solved ?
> Thanks!
> 13:51:17,855 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."Logging_POC_log4j_web.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."Logging_POC_log4j_web.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "Logging_POC_log4j_web.war"
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-10.jar:7.3.0.Final-redhat-10]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
> 	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
> Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018104: Deployment error processing SCI for jar: log4j-web-2.1.jar
> 	at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:189)
> 	at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:124)
> 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-10.jar:7.3.0.Final-redhat-10]
> 	... 5 more
> Caused by: java.lang.ClassNotFoundException: # from [Module "deployment.Logging_POC_log4j_web.war:main" from Service Module Loader]
> 	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
> 	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
> 	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
> 	at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:186)
> 	... 7 more



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

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