Change deploy location and lib directory in JBoss

    In order to manager our own archives convinently. We can change the deploy location and lib directory in JBoss. Both can change in jboss-service.xml file that in {your server configuration}/conf directory.
  • lib
    We can found "classpath" element in the begining part. According to JBoss configuration guide:
    This element specifies one or more external JARs that should be deployed with the MBean(s). The optional archives attribute specifies a comma separated list of the JAR names to load, or the * wild card to signify that all jars should be loaded. The wild card only works with file URLs, and http URLs if the web server supports the WEBDAV protocol.
    So, we can create sub-folder in lib directory to put our own jar archives and add path in archives attribute that use comma to seprate it. Or, we can change codebase attribute to point to other directory that not in JBoss_HOME, it also support WEBDAV. Otherwise, it's can create new classpath element, too.
  • deploy
    We can change deploy location by modify URLs attribute of org.jboss.deployment.scanner.URLDeploymentScanner MBean. URLDeploymentScanner has support recursive search if RecursiveSearch attribute is true. So, we can create a sub-folder to put our own war and ear archives. But the sub-folder can't contain "." in their name. Also, it's can change to other directory that not in JBOSS_HOME or use WEBDAV protocol. Also, it's the same as classpath element. It's can use comma to separate each path. The path isn't merely relatively path, it's also to use full path.

留言

熱門文章