Wednesday, 10 April 2013

Replacing JDK of JDeveloper 11.1.1.7 on 64 bit Oracle Linux 6

As mentioned yesterday, I installed Oracle SOA/BPM Suite 11g PS6 yesterday. It was on Oracle Linux 6 Update 3 (still have to update to Update 4).

Today I installed the accompanying JDeveloper 11.1.1.7 on the same machine. Everything went fine, except that apparently the installer failed to bring up a graphical UI.

Jdeveloper can then be started with


$JDEV_HOME/jdeveloper/jdev/bin/jdev
Where in my case in installed jdeveloper in:
$JDEV_HOME=/u01/app/oracle/jdeveloper/11.1.1.7

Doing so, to my surprice, I ran into the following exception:
[oracle@darlin-vce-db bin]$ ./jdev

Oracle JDeveloper 11g Release 1 (11.1.1.7.0)
Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 

java.lang.UnsatisfiedLinkError: /u01/app/oracle/jdeveloper/11.1.1.7/jdk160_24/jre/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702)
 at java.lang.Runtime.load0(Runtime.java:770)
 at java.lang.System.load(System.java:1003)
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1028)
 at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
 at sun.awt.DebugHelper.(DebugHelper.java:29)
 at java.awt.Component.(Component.java:567)
 at oracle.ide.IdeCore.startupImpl(IdeCore.java:1171)
 at oracle.ide.Ide.startup(Ide.java:710)
 at oracle.ideimpl.DefaultIdeStarter.startIde(DefaultIdeStarter.java:35)
 at oracle.ideimpl.Main.start(Main.java:184)
 at oracle.ideimpl.Main.main(Main.java:146)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.ide.boot.PCLMain.callMain(PCLMain.java:62)
 at oracle.ide.boot.PCLMain.main(PCLMain.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.classloader.util.MainClass.invoke(MainClass.java:128)
 at oracle.ide.boot.IdeLauncher.bootClassLoadersAndMain(IdeLauncher.java:189)
 at oracle.ide.boot.IdeLauncher.launchImpl(IdeLauncher.java:89)
 at oracle.ide.boot.IdeLauncher.launch(IdeLauncher.java:65)
 at oracle.ide.boot.IdeLauncher.main(IdeLauncher.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at oracle.ide.boot.Launcher.invokeMain(Launcher.java:714)
 at oracle.ide.boot.Launcher.launchImpl(Launcher.java:116)
 at oracle.ide.boot.Launcher.launch(Launcher.java:69)
 at oracle.ide.boot.Launcher.main(Launcher.java:58)
 

Nice!
Jdeveloper comes with it's own JVM. It's installed in $JDEV/jdk160_24. And is (as guessed) the following version:
[oracle@darlin-vce-db 11.1.1.7]$ cd jdk160_24/bin/
[oracle@darlin-vce-db bin]$ ./java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

Apparenlty it's 32 bit. On this machine I earlier installed the 64 Oracle/Sun Hotspot JDK in
[oracle@darlin-vce-db bin]$ set |grep JAVA_HOME
JAVA_HOME=/usr/java/jdk1.6.0_43
Checking it's version will get:
[oracle@darlin-vce-db bin]$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
To solve the exception above, I changed the jdev.conf in $JDEV_HOME/jdeveloper/jdev/bin to use my own 64-bit JDK.
#
# Directive SetJavaHome is not required by default, except for the base
# install, since the launcher will determine the JAVA_HOME.  On Windows
# it looks in ..\..\jdk, on UNIX it first looks in ../../jdk. If no JDK
# is found there, it looks in the PATH.
#
#SetJavaHome /u01/app/oracle/jdeveloper/11.1.1.7/jdk160_24
SetJavaHome  /usr/java/jdk1.6.0_43/
So find the SetJavaHome directive at the top and replace it with the path to your own. Apparently you should also be able to use JRockit with JDeveloper. Would be a nice try. Although I have to try if, for instance, the compiler works, but with the above change, JDeveloper started up fine.

Tuesday, 9 April 2013

Starting SOA/BPM Suite with wlst via nodemanager


Today I installed the brand new SOA and BPM Suite 11g PS6. The last few months for me were dedicated in deepdiving WebLogic to deliver a Tuning and Troubleshooting course for two customers.

Although it was not the first time to for me to install the suite, and I already have several bash-based scripts to start the server using the weblogic shell scripts, I wanted to use my conceived knowledge to create a WLST based tool to start weblogic.

To create the tutorials for the course I already created a script to create and startup a new test domain with an adminserver and a managed server. And for the course I downsized the script to be able to start the domain. So I only had to adapt the script to be able to use it to start my SOABPM Domain.

Having it started using the nodemanager and also having a seperate AdminServer enables you to use the Admin Console to restart your SOAServer. So if you have enough memory it is the way to go. If you have not  enough memory choose the development topology at creation of the SOA/BPM domain. In that case the domain is created with only an admin server that contains both the Admin Console, EM and SOA/BPM.

Now the script is as follows:
#############################################################################
# Start SOABPM Domain 
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 0.1, 2013-04-09
#
#############################################################################
print 'Set Properties';
wlHome=os.getenv("WL_HOME")
nmHome=wlHome+'/common/nodemanager';
nmHost=os.getenv("NM_HOST");
nmPort=os.getenv("NM_PORT");
nmType=os.getenv("NM_TYPE");

domainsHome='/u01/app/work/domains';
SOABPMDomainName=os.getenv("SOABPM_DOMAIN_NAME");
SOABPMDomainHome=os.getenv("SOABPM_DOMAIN_HOME");
adminServerName=os.getenv("ADMIN_SERVER_NAME");
adminServerPort=os.getenv("ADMIN_SERVER_PORT");
SOAServerName=os.getenv("SOA_SERVER_NAME");

adminUser='weblogic';
adminPwd='welcome1';

print 'Start Nodemanager'
startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost);

print 'Connect to the Node Manager';
nmConnect(adminUser, adminPwd, nmHost, nmPort, SOABPMDomainName, SOABPMDomainHome, nmType);

print 'Start AdminServer';
nmStart(adminServerName);

print 'Connect to the AdminServer';
connect(adminUser, adminPwd);

print 'Start ManagedServer: '+SOAServerName;
start(SOAServerName);

If you set your wls settings as follows:
. $FMW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
export PATH=$WL_HOME/common/bin/:$WL_HOME/server/bin:$PATH

Then you can start the script as follows:
wlst.sh ./startSOABPMDomain.py

Provided that you have set your $FMW_HOME and $WL_HOME correctly (probably dependent on each other as in my case) and also the environment variables used in the script. And that you saved the script above as 'startSOABPMDomain.py'.

To provide for this and to enable the script to get the settings from the environment (and have the settings shared amongst shell and wlst scripts I have the following wls_env.sh script:
#!/bin/bash
echo Setting Weblogic Environment
export ORACLE_BASE=/u01/app/oracle
export FMW_HOME=/u01/app/oracle/Middleware/11.1.1
export DOMAINS_HOME=/u01/app/work/domains
export SOABPM_DOMAIN_NAME=SOABPMDomain
export SOABPM_DOMAIN_HOME=$DOMAINS_HOME/$SOABPM_DOMAIN_NAME
export NM_HOST=darlin-vce-db
export NM_PORT=5556
export NM_TYPE=plain
export OHS_HOME=/u01/app/work/instances/ohs1
export ADMIN_SERVER_NAME=AdminServer
export ADMIN_SERVER_PORT=7001
export SOA_SERVER_NAME=soa_server1

. $FMW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
export PATH=$WL_HOME/common/bin/:$WL_HOME/server/bin:$PATH

I prefer to get my settings from the environment. This is because I already have a bash script that sets the WLS and domain paths. This keeps things centralized. Note that I also have to set the paths to wlst.sh. If you prefer to load the properties in from a file in a more java way, then an example is found here. The stop script should look like something like:

#############################################################################
# Stop SOABPM Domain 
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 0.1, 2013-04-09
#
#############################################################################
print 'Set Properties';
wlHome=os.getenv("WL_HOME")
nmHome=wlHome+'/common/nodemanager';
nmHost=os.getenv("NM_HOST");
nmPort=os.getenv("NM_PORT");
nmType=os.getenv("NM_TYPE");

domainsHome='/u01/app/work/domains';
SOABPMDomainName=os.getenv("SOABPM_DOMAIN_NAME");
SOABPMDomainHome=os.getenv("SOABPM_DOMAIN_HOME");
adminServerName=os.getenv("ADMIN_SERVER_NAME");
adminServerPort=os.getenv("ADMIN_SERVER_PORT");
SOAServerName=os.getenv("SOA_SERVER_NAME");

adminUser='weblogic';
adminPwd='welcome1';

print 'Connect to the AdminServer';
connect(adminUser, adminPwd);

print 'Stop ManagedServer: '+SOAServerName;
shutdown(name=SOAServerName, entityType='Server', force='true');

print 'Stop AdminServer';
shutdown();

print 'Connect to the Node Manager';
nmConnect(adminUser, adminPwd, nmHost, nmPort, SOABPMDomainName, SOABPMDomainHome, nmType);

print 'Stop the NodeManager';
stopNodeManager();

A few things I encountered, that got me into writing this article are the following.

It is important that you have the listen-address of the machine, that the soa_server1 is added to, is the valid host-name of the server running your SOASuite. It cannot be 'localhost' which is defaulted by the SOA/BPM Domain configurator. The value 'localhost' simply does not work, although it is perfectly pingable. So update it according to your server (it should also point to the correct host-ip-address):


Also make sure you have Type set to 'Plain' and the property SecureListener=false in the $WL_HOME/common/nodemanager/nodemanager.properties accordingly. Here's my nodemanager.properties file as an example. The commented lines (except for the first one) denote the properties that are changed by me, the rest is default

#Fri Mar 15 14:28:18 CET 2013
DomainsFile=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager/nodemanager.domains
LogLimit=0
PropertiesVersion=10.3
DomainsDirRemoteSharingEnabled=false
AuthenticationEnabled=true
NodeManagerHome=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager
JavaHome=/usr/java/jdk1.6.0_43/jre
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=darlin-vce-db
NativeVersionEnabled=true
ListenPort=5556
LogToStderr=true
#SecureListener=true
SecureListener=false
LogCount=1
DomainRegistrationEnabled=false
#StopScriptEnabled=false
StopScriptEnabled=true
QuitEnabled=true
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=false
#StartScriptEnabled=false
StartScriptEnabled=true
LogFile=/u01/app/oracle/Middleware/11.1.1/wlserver_10.3/common/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50


Then on the domain set the nodemanager's  username password correctly. I don't know the defaults, but they're probably not 'weblogic' and 'welcome1' as per my default values:

And then under Advanced:


Now ensure that you have enrolled your domain to the nodemanager.Check if it's listed in the $WL_HOME/common/nodemanager/nodemanager.domains file.

Some of my nodemanager-troubleshooting-knowledge is from this blog.

Hope this helps and at least save me some searching around the next time I have to setup a SOABPM-domain...

Oh, and of course you can split these files up to only start or stop the soaserver provided that the AdminServer and nodemanager are already started. And  to create separate start/stop for the BAM server, since I intentionally did not include that one in the scripts.

Monday, 1 April 2013

BPM Suite PS6 released

Just a moment ago I found out that BPM Suite PS6 is released for download: http://soacommunity.wordpress.com/2013/04/01/bpm-suite-ps6-11-1-1-7-available-for-download/

In a previous blog I also wrote about the OFMW Partner forum in Portugal, where I could play around with it.

This week and next week I have to teach a Tuning and Troubleshooting training on Weblogic 11g. But there after I certainly going to play with it. Hope to provide you some images then.