Friday 12 August 2011

JDK7 with JBoss 5.1

I've been doing some blogging recently for C2B2 the company I work covering the use of Google App Engine and auto scalability in 3 parts. Part 1 provided a quick run through of setting up a REST application in Google App Engine, Part 2 described basic testing and what monitoring was available and Part 3 used JAXB to serialize a person so we could chart load to response time. Anyway it's got me back into some blogging so I thought I would have a quick look at JDK 7.

For a trivial start I wonder if it worked with my existing JBoss 5.1 install and it does...kind of.

I installed just the JDK 7 x64 release on Windows 7 and updates the system variables as below

PATH=C:\Apps\Java\jdk1.7.0\bin
JAVA_HOME=C:\Apps\Java\jdk1.7.0

I went into my JBoss 5.1 bin directory and tried to start it...no go.

Calling C:\Apps\jboss-eap-5.1\jboss-as\bin\run.conf.bat
===============================================================================

JBoss Bootstrap Environment

JBOSS_HOME: C:\Apps\jboss-eap-5.1\jboss-as

JAVA: C:\Apps\Java\jdk1.7.0\bin\java

JAVA_OPTS: -Xms768m -Xmx768m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcI
nterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jbo
ss.resolver.warning=true -Dprogram.name=run.bat -server

CLASSPATH: C:\Apps\Java\jdk1.7.0\lib\tools.jar;C:\Apps\jboss-eap-5.1\jboss-as\bin\run.jar

===============================================================================

Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/bootstrap/BaseServerConfig
at org.jboss.bootstrap.AbstractServerImpl.doInit(AbstractServerImpl.java:190)
at org.jboss.bootstrap.AbstractServerImpl.init(AbstractServerImpl.java:173)
at org.jboss.bootstrap.AbstractServerImpl.init(AbstractServerImpl.java:143)
at org.jboss.Main.boot(Main.java:218)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: org.jboss.bootstrap.BaseServerConfig
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
Press any key to continue . . .

So I tried setting the JAVA_HOME back to a 1.6 using:

set JAVA_HOME=C:\Apps\Java\jdk1.6.0_22 and tried again.

This time everything works perfectly.

C:\Apps\jboss-eap-5.1\jboss-as\bin>run
Calling C:\Apps\jboss-eap-5.1\jboss-as\bin\run.conf.bat
===============================================================================

JBoss Bootstrap Environment

JBOSS_HOME: C:\Apps\jboss-eap-5.1\jboss-as

JAVA: C:\Apps\Java\jdk1.6.0_22\bin\java

JAVA_OPTS: -Xms768m -Xmx768m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcI
nterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jbo
ss.resolver.warning=true -Dprogram.name=run.bat -server

CLASSPATH: C:\Apps\Java\jdk1.6.0_22\lib\tools.jar;C:\Apps\jboss-eap-5.1\jboss-as\bin\run.jar

===============================================================================

14:39:39,788 INFO [ServerImpl] Starting JBoss (Microcontainer)...
14:39:39,791 INFO [ServerImpl] Release ID: JBoss [EAP] 5.1.0 (build: SVNTag=JBPAPP_5_1_0 date=201009150028)
14:39:39,794 INFO [ServerImpl] Bootstrap URL: null
14:39:39,796 INFO [ServerImpl] Home Dir: C:\Apps\jboss-eap-5.1\jboss-as
14:39:39,797 INFO [ServerImpl] Home URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/
14:39:39,799 INFO [ServerImpl] Library URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/lib/
14:39:39,803 INFO [ServerImpl] Patch URL: null
14:39:39,804 INFO [ServerImpl] Common Base URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/common/
14:39:39,806 INFO [ServerImpl] Common Library URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/common/lib/
14:39:39,808 INFO [ServerImpl] Server Name: default
14:39:39,810 INFO [ServerImpl] Server Base Dir: C:\Apps\jboss-eap-5.1\jboss-as\server
14:39:39,815 INFO [ServerImpl] Server Base URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/server/
14:39:39,816 INFO [ServerImpl] Server Config URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/server/default/conf/
14:39:39,818 INFO [ServerImpl] Server Home Dir: C:\Apps\jboss-eap-5.1\jboss-as\server\default
14:39:39,819 INFO [ServerImpl] Server Home URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/server/default/
14:39:39,821 INFO [ServerImpl] Server Data Dir: C:\Apps\jboss-eap-5.1\jboss-as\server\default\data
14:39:39,822 INFO [ServerImpl] Server Library URL: file:/C:/Apps/jboss-eap-5.1/jboss-as/server/default/lib/
14:39:39,823 INFO [ServerImpl] Server Log Dir: C:\Apps\jboss-eap-5.1\jboss-as\server\default\log

Now if you look at http://www.jboss.com/products/platforms/application/supportedconfigurations/ you'll see that JDK 7 isn't a supported configuration so it many ways it's no surprise but it sure is odd. I havent understood yet why it is but I'll come back here to add a note when I do.

I had to try this again with JBoss 5.1 GA on another computer also Win 7 x64. Previously I'd been using JBoss EAP on Win x64. This time it worked first time with JAVA_HOME still pointing at C:\Apps\Java\jdk1.6.0_23 (I have them setup with the same paths) and a java -version command reporting

java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)


I wonder if is because I used EAP before?

So I returned to my laptop and copied the JBoss GA release to it. Set it as below

PATH=C:\Apps\Java\jdk1.7.0\bin
JAVA_HOME=C:\Apps\Java\jdk1.7.0

Tried starting JBoss and it worked fine. So must be either something to do with the JBoss EAP configuration or perhaps because I'd had that install there for a while I had payed with its config to break it under JDK 7. So to get to the bottom of it I needed to get a clean copy of EAP and try again. Of course all this investigation for an unsupported configuration isn't really worth it but I hate not knowing.

OK so I find a clean copy of jboss-eap-5.1 unzip and try to start it and it wont start. jboss-5.1.0.GA will, EAP won't. So I guess its down to either differences in the start-up scripts of the supported and community editions or the packaging of the classes into the jars.

So what's my takeaway from all this? Beware the small differences between the community and supported versions!

I'm going to look at the new fork/join support in JDK 7 next...far more sensible.

Pete Raymond

Thursday 17 June 2010

building an oracle 11g soa install on centos5

Over the last few days I've built a CentOS 5 VMware machine with Oracle SOA 11.1.1.3 installed. This was essentially mirror of the system I built on Window to see what the issues would be and I had to work round the following:

  1. If you use the VMware easy install option when creating the root partition is too small to put Oracle XE on. I used GParted to increase the partition size.

  2. I didn't name the VM to begin with and ended up with localhost.localdomain. When I decided that wasn't a good idea I looked at some forums and documentation such as this one but ended up using the approach from Bob here. As root in the console type setup and then go to “Network Configuration” and edit the DNS config. Also update the /etc/hosts file.

  3. When I transferred the files contained in ofm_soa_generic_11.1.1.2.0_disk1_1of1 and changed to Disk1 directory and ran ./runInstaller -jreLoc JRE_LOCATION I got a permission errors. I then tried using a oraclewls user for the sftp and running the installer, copying to /tmp instead of the oraclesoa home, checking permission on the JDK and extensive internet searching. The documentation says that it cant be run as root so that wasn't an option. The simple answer eluded me which was to chmod -R 777 ofm_soa_generic_11.1.1.2.0_disk1_1of doh!
  4. I updated /etc/security/limits.conf to add
  • * soft nofile 4096
  • * hard nofile 4096

and also had to install some library updates which were:
  • compat-db.i386 0:4.2.52-5.1
  • sysstat.i386 0:7.0.2-3.el5
  • compat-libstdc++-296.i386 0:2.96-138
using yum install . That got me up and running and looking at:
















which was great. I then started configuring the weblogic server to support the development work from the hands on tutorial I've been working through.

Pete Raymond


Thursday 10 June 2010

I finally found the answer to my Oracle download woes in the Oracle forums where people worldwide have been unable to download software, but the problem seems to be limited to folks outside the US.

However, as the post by astramare notes by adding an HTTP proxy of 206.224.254.10 port 80 bingo you can download the JDeveloper Composite Editor from here. A quick whois by IP reveals its owned by:

OrgName: Garden Grove Unified School District
OrgID: GGUSD
Address: 10331 Stanford Ave.
City: Garden Grove
StateProv: CA PostalCode: 92640
Country: US

How very odd but thanks anyway. So after a brief hiccup as Pete Tong would say "we continue".

Pete Raymond


Tuesday 8 June 2010

No JDeveloper SOA Composite Editor

How frustrating, no matter how hard I search for the JDeveloper SOA Composite Editor I cant find it. I tried updating via JDeveloper updates:
















but all I get is:
















If I got to the Oracle site:













I still get:













Its been like this for two days now and I'm stumped can anyone put me out of my misery?

Pete Raymond

Monday 7 June 2010

Problems and resolutions to installing and running Oracle SOA Suite

I had a number of problems when trying to install the software. The first was trying to find a compatible database. I had Oracle 10.2.0.1.0 instance running on Centos 5 available but when using the Repository Creation Utility (RCU) you'll get an error message saying that the version must be 10.2.4. or higher.

Trying Oracle XE on a Windows 2008 server which was a domain controller also ran into difficulties in even getting the DB installed. A look on an Oracle forum indicated it might be that I was using a domain admin account rather than a local admin user. I eventually used Oracle XE on Windows 7 and all was well.

The second issue was creating the domain using the SOA Suite config.cmd in \Oracle\Middleware\home_11gR1\Oracle_SOA1\common\bin. I started by using the 11.1.1.2.0 version but this was incompatible with the data version used by RCU so had to use the 11.1.1.3.0 update to resovle this. I used an Oracle blog to help me realize that executing

SELECT version, status FROM schema_version_registry where owner = 'DEV_SOAINFRA'

gave me the wrong version.

Lastly when running the domains remember to use an administrator account to start the command shell. If you dont you'll get something similar to:

java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup

Pete Raymond

Starting Oracle SOA Expert revision

I've decided to knuckle down and work to gain Oracle SOA Expert certification. Some searching shows http://onlineappsdba.com/index.php/2009/08/14/1z0-114-oracle-soa-foundations-adoption-and-implementation-certification-for-soa-architects/ to be a useful start point. I've read the BEA Domain Model for SOA (which reminded me of TOGAF with its building blocks) and now I'm on to the BEA SOA reference architecture. Hopefully the change to Oracle terms isn't too confusing.

So that's the top down preparation and I've combined it with some bottom up hands on work and got Getting Started with Oracle SOA Suite 11g R1 - A Hands-On Tutorial (or the install and configuration section) and downloaded the Oracle SOA software:
You'll need to have a free OTN account to download the software. Installation provided the usual challenges of minor incompatibilities which I'll cover in a future post. Until then...

Pete Raymond