-
2. Re: Configuring a classpath for a .cfg file
larito Nov 27, 2012 6:47 AM (in response to nickarls)Thanks Nicklas, I had alredy seen that tutorial as half the forums searches I have done lead there, but I with that solution It seems hard to edit the file in case we need to and I was hoping there were more alternatives
-
3. Re: Configuring a classpath for a .cfg file
sfcoy Nov 27, 2012 6:54 AM (in response to larito)With the module solution your .cfg file lives in the file system. That's the whole point.
-
4. Re: Configuring a classpath for a .cfg file
nickarls Nov 28, 2012 1:42 AM (in response to larito)There are always ugly hacks - stick it in the configuration folder and use File() access on it, picking up the system property which resolves the configuration dir path...
-
5. Re: Configuring a classpath for a .cfg file
larito Nov 28, 2012 8:21 AM (in response to nickarls)Thank you for the suggestions , at the moment I'm trying the module solution which does not seem to be working, I can not modify the application so I will just keep trying other solutions
-
6. Re: Configuring a classpath for a .cfg file
sfcoy Nov 28, 2012 8:32 AM (in response to larito)How are you trying to read the file? Show the code if you can.
-
7. Re: Configuring a classpath for a .cfg file
larito Nov 29, 2012 5:29 AM (in response to sfcoy)I will post it after I solve a new issue with the login and roles that has came up loggin in the application, which is necesary to be working for this properties to work. Thank you for your answers I'll get back get back when it solved
-
8. Re: Configuring a classpath for a .cfg file
larito Dec 4, 2012 6:49 AM (in response to larito)Hi! I got back to trying to install the property and I'm getting an error deploying the application. I have tried deploying it through the deployment structure and manifest (not at the same time ), would you mind looking if there are any obvious errors that I'm missing?
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.enviroment.settings" />
</dependencies>
</deployment>
</jboss-deployment-structure>
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.enviroment.settings">
<resources>
<resource-root path="enviroment.cfg"/>
</resources>
</module>
The module directory is:
modules/com/enviroment/settings/main
-enviroment.cfg
-module.xml
The error:
11:08:52,196 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.module.service."deployment.app.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.app.war".main: Failed to load module: deployment.app.war:main
-
9. Re: Configuring a classpath for a .cfg file
sfcoy Dec 4, 2012 6:57 AM (in response to larito)Please attach the whole server.log to the discussion thread.
Tip: the button you're looking for is available after you click on "Use advanced editor" over on the right.
-
10. Re: Configuring a classpath for a .cfg file
larito Dec 4, 2012 7:22 AM (in response to sfcoy)Here it is (and thanks for the tip)
-
server.log.zip 2.2 KB
-
-
11. Re: Configuring a classpath for a .cfg file
sfcoy Dec 4, 2012 7:42 AM (in response to larito)Change
{code:xml}<resource-root path="enviroment.cfg"/>{code}
to
{code:xml}<resource-root path="."/>{code}
This has the effect of making every file in that directory available as a resource in the classpath.
-
12. Re: Configuring a classpath for a .cfg file
larito Dec 14, 2012 4:26 AM (in response to sfcoy)After a bit of fighting I gave up the module solution and just dropped the files in the classes directory, and it worked like a charm. I know every case is different but this is what worked for me. Thank you for all the help and answers!