Tag cloud

JBoss (16) Fedora (5) Linux (4) Red Hat (4) JON (3) command line (3) 4.3 (2) JEE (2) JVM (2) Java (2) KVM (2) Oracle (2) Portal (2) Weblogic (2) installation (2) vs (2) /boot partition (1) Add-ons (1) Apache (1) Bundles (1) Business model (1) Byteman (1) CLASSPATH (1) EAP (1) EPP (1) Eclipse (1) Failover (1) Gnome (1) JAVA_OPTS (1) JBDS (1) JBoss Tools (1) JBossON (1) JConsole (1) JDK (1) JMS (1) JVM options (1) KDE (1) MBean (1) Network (1) Open Source (1) RHQ (1) Red Hat subscription (1) Thunderbird (1) Troubleshooting (1) Virtulization (1) WS (1) Webservices (1) Wireshark (1) classloading (1) clustering (1) comparison (1) debug (1) deployment (1) disable SELinux (1) disksize (1) error (1) fun (1) jboss.org (1) log (1) log4j (1) lvm (1) messaging (1) multiple WARs (1) patent FOSS (1) performance tuning (1) provisionning (1) scripting (1) services (1) switch (1) troll (1) upgrade (1) video (1) war (1) webapp (1) yum (1)

24 January 2011

Howto recompile and patch JBoss from SVN

Summary:
Within this post you will see
1. Howto download JBoss sources
2. Howto compile the downloaded JBoss sources
3. Howto run tests to check the integrity of the code (you might change a class to see the difference)


Main post:

- The first thing to do is to get a user/pw for jboss.org
- Then you will have to install Subversion (SVN) on your machine

- Download the current source code with the command line "svn export https://svn.jboss.org/repos/jbossas/trunk /app/my_jboss_dev/" (takes more than an hour)

- If you want to get an older/specific JBoss.org version browse all version with Firefox:
https://svn.jboss.org/repos/jbossas/branches/
and adapt the URL in the command line, for example :

$ svn export https://svn.jboss.org/repos/jbossas/branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432 /app/my_jboss_dev/

- After having downloaded the source files make sure to use the right Java compiler (JEE 5 in my case)
$ export JAVA_HOME=/app/java/jdk1.5.0_21/
$ export PATH=$PATH:$JAVA_HOME/bin

- Install the right ANT version (in my case 1.6 (not 1.7+). When using Fedora remove the latest ant from your machine via "sudo yum remove ant"
$ export ANT_HOME=/app/middleware/apache-ant-1.6.5
$ export PATH=$PATH:$ANT_HOME/bin

- Set the flag to be able to run test cases
$ cd <JBoss>/build
$ vi build.properties
(change build.unsecure=true)

- Build the server
$ cd <JBoss>/build
$ ./build.sh
(output can be found in <JBoss>/build/output)
- Start the server
$ cd <JBoss>/build/output/jboss-4.3.0.GA_CP08/bin
$ ./run.sh -c production

- Build all the testcase ( choose the right ANT version, here 1.6)
$ cd <JBoss>/testsuite
(output can be found in <JBoss>/testsuite/output)
$ export ANT_HOME=/app/middleware/apache-ant-1.6.5/
$ export PATH=$PATH:$ANT_HOME/bin
$ ./build.sh

- Run the testcases one by one
$ ./build.sh one-test -Dtest=org.jboss.test.cmp2.optimisticlock.test.OptimisticLockUnitTestCase
result: [junit] Running org.jboss.test.cmp2.optimisticlock.test.OptimisticLockUnitTestCase
    [junit] Tests run: 18, Failures: 0, Errors: 0, Time elapsed: 5.276 sec

$ ./build.sh one-test -Dtest=org.jboss.test.tm.test.TransactionManagerUnitTestCase
result: [junit] Running org.jboss.test.tm.test.TransactionManagerUnitTestCase
    [junit] Tests run: 28, Failures: 0, Errors: 0, Time elapsed: 0.823 sec

10 January 2011

Howto install JBoss Tools to Eclipse

If you want to use the ESB / BPEL, etc. features of Red Hat JBoss within your Eclipse, just add the following URL to your Eclipse software repositories:
http://download.jboss.org/jbosstools/updates/JBossTools-x.x.x.GA
(check on http://download.jboss.org/jbosstools/updates to find latest stable version)
Help --> Install new software ... Add after "Work with:" the URL above and hit Enter...




















Than you can choose the JBoss developpment tools you want to install.

To get the nightly build versions of JBoss Tools do the following :
Goto http://download.jboss.org/jbosstools/builds/nightly/trunk/latestBuild.html
--> all --> repo --> copy the URL from your browser -->
http://download.jboss.org/jbosstools/builds/nightly/trunk/20xx-xx-xx_xx-xx-xx-xxxxx/all/repo/
Paste it into "Work with:" and you can start installing...

03 January 2011

Howto add JVM options to JBoss

There are two useful files to add JVM options to JBoss.

1. <JBOSS>/bin/run.sh (when you need to reference the JBoss path)
Add this after line 12 GREP="grep" in the run.sh file for JBoss 4.3
JAVA_OPTS="-javaagent:$DIRNAME/../server/all/deploy/jboss-aop-jboss5.deployer/pluggable-instrumentor.jar"
or  this for JBoss 5
JAVA_OPTS="-javaagent:$DIRNAME/../server/all/deployers/jboss-aop-jboss5.deployer/pluggable-instrumentor.jar"
In this example I needed to specify the complete path of the JBoss instance using the $DIRNAME variable which points to the directory of the run.sh file. You see in 2. that via the run.conf file you will not be able to do this.

2. <JBOSS>/bin/run.conf (when no path is needed)
# Add this at the end of the file: Enables the jconsole agent locally
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"