-
1. Re: NullPointerException with log4j since JBoss 7.1.x
jamezp Apr 16, 2012 12:10 PM (in response to hd0815)1 of 1 people found this helpfulIf you're using log4j as a log manager, e.g. you're not using the standalone or domain configs, you need to exclude the servers version of log4j and provide your own. Note when doing this though you lose the ability to use any of the consoles to configure your logging.
To exclude the server via the jboss-deployment-structure.xml and include the log4j library in your deployment. You can get more details on doing there here https://docs.jboss.org/author/display/AS71/How+To#HowTo-HowdoIuselog4j.propertiesorlog4j.xmlinsteadofusingtheloggingsubsystemconfiguration%3F
-
2. Re: NullPointerException with log4j since JBoss 7.1.x
hd0815 Apr 17, 2012 5:09 AM (in response to jamezp)Following the instructions from the linked document brought me to the following result:
{noformat}10:47:52,801 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."testApp.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."testApp.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "testApp.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_27]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_27]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Error loading jboss-structure.xml from C:\jboss\jboss-as-7.1.1.Final\standalone\deployments\testApp.war\WEB-INF\jboss-deployment-structure.xml
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:277) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:249) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:134) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[5,13]
Message: Unexpected content of type 'element start' named 'exclusions'
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.unexpectedContent(JBossDeploymentStructureParser11.java:1098) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseDependencies(JBossDeploymentStructureParser11.java:399) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseModuleStructureSpec(JBossDeploymentStructureParser11.java:316) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.parseDeployment(JBossDeploymentStructureParser11.java:234) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:211) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:42) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:271) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 8 more{noformat}
I guess the description in the document ist wrong.
I changed the jboss-deployment-structure.xml to the following and now the NullPointerException is gone:
{code:xml}
<jboss-deployment-structure>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding
some dependencies -->
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>{code}
-
3. Re: NullPointerException with log4j since JBoss 7.1.x
jamezp Apr 17, 2012 11:44 AM (in response to hd0815)Thanks for catching the invalid XML. I've updated the documentation to reflect the correct sample.