I am running JBoss as a windows service using Tanuki software. When running as a开发者_运维百科 windows service, the path changes to a directory where wrapper.exe is present. The relative path used in the code is relative to that directory and not JBoss home. How can I fix this problem without having to provide absolute paths in the code?
JBoss defines quite a bunch of properties for various path, that you can use. Look at boot.log to see them:
12:29:51,581 INFO [Server] Server Home Dir: /im/dev-container/jbossas/server/default
12:29:51,581 INFO [Server] Server Home URL: file:/im/dev-container/jbossas/server/default/
12:29:51,581 INFO [Server] Server Log Dir: /im/dev-container/jbossas/server/default/log
12:29:51,581 DEBUG [Server] Server Data Dir: /im/dev-container/jbossas/server/default/data
12:29:51,581 INFO [Server] Server Temp Dir: /im/dev-container/jbossas/server/default/tmp
12:29:51,582 DEBUG [Server] Server Config URL: file:/im/dev-container/jbossas/server/default/conf/
12:29:51,582 DEBUG [Server] Server Library URL: file:/im/dev-container/jbossas/server/default/lib/
and then later in the file
12:29:52,015 DEBUG [ServerInfo] jboss.home.url: file:/im/dev-container/jbossas/
12:29:52,017 DEBUG [ServerInfo] jboss.server.temp.dir: /im/dev-container/jbossas/server/default/tmp
12:29:52,017 DEBUG [ServerInfo] jboss.lib.url: file:/im/dev-container/jbossas/lib/
and so on.
精彩评论