Friday, August 19, 2011

jboss web.xml

<jboss-web>
<context-root><name-of-app></name-of-app>
</context-root>
</jboss-web>

Put the above snippet into a file called jboss-web.xml in your WEB-INF directory of your war to give it a new context root. Replace with whatever your app is called. Without this file, jboss will use whatever the name of your WAR file is as the context root of your application.


Note: This was used with JBOSS 5.1.0 EAP. I believe it works with most new versions of jboss though.

jboss classloading

<classloading xmlns="urn:jboss:classloading:1.0"
name="<war-name>"
domain="<domain-name>"
export-all="NON_EMPTY"
import-all="true">
</classloading>

Put the above snippet in a file called jboss-classloading.xml within your WEB-INF directory and jboss will use your WARs jars instead of it's own when classloading for your application. Of course, be sure to substitute with your applications war file name and with whatever domain you decide to use. You can use any domain, but any two applications on the server sharing a domain name will both have access to eachother's classes.


Note: This was used with JBOSS 5.1.0 EAP. I believe it works with most new versions of jboss though.

Finding out what ports a particular process is listening on in UNIX

run netstat -tulpn | grep PID and substitute PID with your process' PID. This should give you a listening of ports in the third column of the output that your process is listening on.