1 Reply Latest reply on Sep 8, 2012 2:59 AM by jaikiran

    JBoss AS 7.1.3 - NullPointerException if an expression is in the jboss-app.xml file

    fmessiaen

      Hello everyone,

       

      A NullPointerException is thrown when the JBoss AS 7.1.3 tries to replace an expression in the "jboss-app.xml" file. (the "jboss-descriptor-property-replacement" property is set true in the "standalone.xml" file)

       

      Wolf-Dieter Fink says that the "jboss-app.xml" file should not contain expresssion (https://community.jboss.org/message/747278#747278), but a RedHat document say that the "jboss-descriptor-property-replacement", if set true, enables the properties replacement in the "jboss-app.xml" file. (https://access.redhat.com/knowledge/docs/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configuration_Guide/EnablingDisabling_Descriptor_Based_Property_Replacement.html)

       

      We want to avoid the use of the "default-distinct-name" property of the "standalone.xml" file. We have other deployed applications and we think that they does not have to manage a distinct-name if they does not declared one.

       

      One other point is that the property replacement works well in the JBoss AS 7.1.1

       

      Best regards,

       

      François

       

      The "jboss-app.xml" file:

       <?xml version="1.0" encoding="UTF-8"?>
      <!--
        ~ JBoss, Home of Professional Open Source.
        ~ Copyright 2012, Red Hat, Inc., and individual contributors
        ~ as indicated by the @author tags. See the copyright.txt file in the
        ~ distribution for a full listing of individual contributors.
        ~
        ~ This is free software; you can redistribute it and/or modify it
        ~ under the terms of the GNU Lesser General Public License as
        ~ published by the Free Software Foundation; either version 2.1 of
        ~ the License, or (at your option) any later version.
        ~
        ~ This software is distributed in the hope that it will be useful,
        ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
        ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
        ~ Lesser General Public License for more details.
        ~
        ~ You should have received a copy of the GNU Lesser General Public
        ~ License along with this software; if not, write to the Free
        ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
        ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
        -->
      <jboss-app xmlns="http://www.jboss.com/xml/ns/javaee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/noschema/jboss-app_5_0.xsd"
                 version="5.0"
                 id="jboss-app-id">
          <distinct-name>${jboss.server.name}</distinct-name>
      </jboss-app>
      

       

      The log file shows:

      15:09:30,496 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."DS.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."DS.ear".STRUCTURE: JBAS018733: N'a pas pu traiter la phase STRUCTURE de deployment "DS.ear"
       at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.3.Beta1.jar:7.1.3.Beta1]
       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.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
       at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011059: Impossible d'analyser "/D:/home/fme/jboss7.1.3/bin/content/DS.ear/META-INF/jboss-app.xml"
       at org.jboss.as.ee.structure.EarMetaDataParsingProcessor.handleJbossMetadata(EarMetaDataParsingProcessor.java:126)
       at org.jboss.as.ee.structure.EarMetaDataParsingProcessor.deploy(EarMetaDataParsingProcessor.java:67)
       at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.3.Beta1.jar:7.1.3.Beta1]
       ... 5 more
      Caused by: java.lang.NullPointerException
       at org.jboss.metadata.property.DefaultPropertyReplacer.replaceProperties(DefaultPropertyReplacer.java:110)
       at org.jboss.metadata.parser.util.MetaDataElementParser.getElementText(MetaDataElementParser.java:194)
       at org.jboss.metadata.parser.jboss.JBossAppMetaDataParser.parse(JBossAppMetaDataParser.java:103)
       at org.jboss.as.ee.structure.EarMetaDataParsingProcessor.handleJbossMetadata(EarMetaDataParsingProcessor.java:123)
       ... 7 more
      

       

      fmessiaen: add the NullPointerExcpetion