- how to package all jars in the EAR's lib
Jars can be moved to the EAR's lib but sometimes the WAR cannot see certain jars
needed for the web application. To solve that, one needs to modify the MANIFEST.MF
of the WAR to include the lib/ folder in the CLASSPATH. Doing so may override
the default classpath of the JBoss AS7 (or EAP6) though, so there are two solutions:
(a) either explicitly complement the MANIFEST.MF with the Dependencies
tag:
Classpath:lib
Dependencies:javax.faces.api
-or-
(b) 'install' the necessary jars in JBoss using the 'modules' mechanism.
It is worth noting that this overriding behavior is likely a bug in JBoss.
- how to copy an EAR to a remote JBoss and deploy it
See : here
- how to start JBoss AS 7.1.1 in Debug mode in Linux
In file standalone.sh which is typically located in:
jboss-as-7.1.1.Final/bin/standalone.sh
add the following line at the top:
JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Note the suspend=n at the end (if set to y JBoss suspends and doesn't load deployed EARs.
You can then attach to the JBoss AS from NetBeans using the debug/attach option (you don't have to deploy the EARs yourself to attach, you can attach to a running
JBoss AS instance where the EARs have been deployed from another machine).
- to build from github
be sure to have OpenJDK 1.7.0_07 installed:
- sudo apt-get remove openjdk-7-jdk
- sudo apt-get install openjdk-7-jdk
After that mvn install (with Maven 3) should build OK without any problems
(or so the theory goes). It was also successfully built using build.sh
(not maven) with the following configuration:
- java -version
java version "1.7.0_02-ea"
Java(TM) SE Runtime Environment (build 1.7.0_02-ea-b08)
Java HotSpot(TM) Server VM (build 22.0-b06, mixed mode)
- javac -version
javac 1.7.0_02-ea
- configuring JBoss AS7 clustering
There's a surprising dearth of material on that subject.
The only guide I found is given in the 'useful links' section
of my Gaia page. Thankfully it worked.
- Running multiple JBoss 7 instances on the same machine
NB: not all the following pieces of advice work in JBoss AS7.
There are three options (see here for more):
- manually override all sets of ports on the second instance
- use the jboss.service.binding.set property as in:
./run.sh -Djboss.service.binding.set=ports-01
- create another virtual IP address
- Configuring JBoss 7 AS HTTP port
you need to modify the following file (in standalone mode):
/standalone/configuration/standalone.xml
Take note that this file allows you to set both the port and the IP address bindings.
By default JBoss 7 AS is bound to 127.0.0.1 but you can set this to another address
or even to 0.0.0.0 (which binds to all interfaces).
The important section in the above configuration file is the following:
The various bindings can be enforced (in place of the default 127.0.0.1 values) by defining environment parameters
upon the invocation of the "/bin/standalone.sh" script. E.g. I've defined a script "jboss-start" as follows: