1 Reply Latest reply on Aug 27, 2013 1:44 AM by Stephen Coy Branched from an earlier discussion.

    How to include an external properties file in application classpath

    Administrator Administrator Novice

      Tks Jaikiran. It's ok now.

      I profit this discussion to ask another question pls:

      I'm configurating some external properties files in the classpath by following https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath

       

      I've put my properties in:jboss-as-7.1.1.Final\modules\com\tt\airman\configuration\main

      And declare un module.xml as below:

      <module xmlns="urn:jboss:module:1.1" name="com.tt.airman.configuration">

         <resources>

           <resource-root path="provisioning.properties"/>

         </resources>

      </module>

      And put the module dependency in jboss-deployment-structure.xml of the jar which needs the configuration.

       

      But I've the error below (it seems that the server is using a xml parser to parse a properties file):

       

      11:35:48,441 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.module.service."deployment.framework.ear".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.framework.ear".main: Failed to load module: deployment.framework.ear:main

          at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [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_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\RMM\jboss-as-7.1.1.Final\modules\com\tt\airman\configuration\main\module.xml

          at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:292)

          at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:242)

          at org.jboss.modules.LocalModuleLoader.parseModuleInfoFile(LocalModuleLoader.java:138)

          at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:122)

          at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)

          at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)

          at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)

          at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:233)

          at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:246)

          at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:160) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.modules.Module.addPaths(Module.java:841)

          at org.jboss.modules.Module.link(Module.java:1181)

          at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207)

          at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208)

          at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,53]

      Message: Failed to add resource root 'provisioning.properties' at path 'provisioning.properties'

          at org.jboss.modules.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:898)

          at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:854)

          at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:676)

          at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:548)

          at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:287)

          ... 19 more