Changing the SDK in WebSphere Application Server 8.5 - websphere

When I try to start the the deployment manager in WebSphere Application Server I'm getting the following error:
00000001 SDKUtils
A ADML0004E: An exception occurred when attempting to expand variable $(JAVA_HOME) com.ibm.wsspi.runtime.variable.
UndefinedVariableException: Undefined variable JAVA_HOME
at com.ibm.ws.runtime.component.VariableMapImpl.expand(VariableMapImpl.j

First of all you cannot set third party Java SDK for traditional WebSphere Application Server. For WAS 8.5.5.x you can only select from IBM Java 6 and IBM Java 7 which must be downloaded from IBM and installed via Installation Manager. So don't play with JAVA_HOME variable manually.
Once you install Java 7 for WAS, you can use managesdk command line tool to switch Java for given profile and server.
See also:
Java 7.1 in IBM Websphere
managesdk command

since we can not start the deployment manger or default server, there is a way to solve this problem that is add the JAVA_HOME into varibles.xml file which is under server folder. path : Installserver/profile/config/node/cell/server

Please give some more information like OS, windows, or linux, or what.
If I understand correctly you'll use the jdk of the WAS installation elsewhere?
Under Windows set JAVA_HOME accordingly within the System environment properties. logout / login after this may be a good idea.
Under linux use: export JAVA_HOME=/opt/ibm/pathtoWAS/java
I would do this within .profile and maybe it's helpful to set the PATH to the jdk too!

Related

Unable to Install WebSphere Developer Tools (WDT)

I've downloaded https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/pot/LibertyPoT_17.0.0.1_WIN.zip but I'm stuck at step 1 of section "0.5 Install WebSphere Developer Tools (WDT)" in setup.pdf where I see
Am I doing something wrong?
Double-check paragraph at 0.3 Installing Liberty and the Java Runtime and its note:
To install for windows or linux,
a. Liberty is already installed for you {LAB_HOME)/wlp
b. The IBM JRE is already installed for you
{LAB_HOME)/wlp/java [...]
c. The IBM_JRE is set to default Java in
the {LAB_HOME)/wlp/etc/server.env
If you want to override this for a specific server create a server.env
file in the usr/servers/ directory.
*Note: If JAVA_HOME is already set in your shell, then you will need to “unset JAVA_HOME”. To check, execute “env| grep –i java_home”. If
it returns with a value, then execute “unset JAVA_HOME”
Then remind that Eclipse looks for jre/jdk based on vm parameter in eclipse.ini.
In the zip file downloaded it should be
-vm ..\wlp\java\bin\javaw.exe
It should be correct, anyway you could try setting an absolute path so you are sure it doesn't care about working directory.

How to have managed servers on different java JDK versions

I have multiple domains installed on a Windows Server 2008 R2 instance running WebLogic 12.1.2.
When I created the domains I set the runtime JDK to 1.7.
In each domain, I have an admin server (with no deployed applications) and 6-20 managed servers.
For the 2-10 managed servers that have a specific application deployed,
I want to change the JDK to 1.6.
How do I do this?
Note: we are trying to isolate a performance issue and want to know if the recent upgrade from 1.6 to 1.7 is causing issues. Once we know if it is, then we can try to find the code that 1.7 doesn't like. So we rebuilt (with 1.6) the one service application that has the issue and are re-running the (long running) tests to compare run times.
I tested this with Weblogic 12c today.
Update /u01/oracle/middleware/user_projects/domains/{DOMAIN_NAME}/bin/setDomainEnv.sh (Find setDomainEnv.sh under your {domain directory}/bin).
Change BEA_JAVA_HOME="" to BEA_JAVA_HOME="/u01/oracle/java/jdk1.8.0_51" (jdk1.8.0_51 is the new jdk home directory, your version may be different).
Update your managed server's "Server Start" configuration on the Weblogic admin console specifying the new Java Home:/u01/oracle/java/jdk1.8.0_51 and Java Vendor: Oracle.
Restart managed server.
ps -ef | grep {managed server name} from your *nix console to confirm the java version running your managed server.
Following these steps I could run other managed servers with the original jdk, while switching selected managed servers to run with jdk1.8.0_51.
Good luck!
I AM NOT SURE IF WLS 12.1.2 supports JDK1.6.
Go to your setDomainEnv.cmd file under DOMAIN_HOME/bin
BEA_JAVA_HOME="/path/to/jdk1.6"
export BEA_JAVA_HOME
SUN_JAVA_HOME="/path/to/jdk1.8"
export SUN_JAVA_HOME
if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
JAVA_HOME="${BEA_JAVA_HOME}"
export JAVA_HOME
else
if [ "${JAVA_VENDOR}" = "Sun" ] ; then
JAVA_HOME="${SUN_JAVA_HOME}"
export JAVA_HOME
else
JAVA_VENDOR="Sun"
export JAVA_VENDOR
JAVA_HOME="${SUN_JAVA_HOME}"
export JAVA_HOME
fi
fi
Then go to your Admin Console, go to Managed_server > Configuration > Server Start
Set JAVA_HOME and JAVA_VENDOR as you defined in setDomainEnv.cmd
You may set as many JAVA_HOME as you want by defining JAVA_HOME and JAVA_VENDOR in setDomainEnv.cmd. I myself have 4 different JDKs configured to be used by the same domain.
You may check the current JDK version that the managed server is running on by using admin console:
Go to managed_server > Monitoring > General

Weblogic domain is not getting created because of jrockit error

I am creating a Basic Weblogic server domain(11g, version 10.3.5.0 ). And in the JDK selection Window, in Available JDKs , ' JRockit SDK 1.7.0_55 # C:\Program Files\Java\jdk1.7.0_55' is selected..
The domain gets created, now i check the 'Start Admin Server' checkbox and click 'Done' . The process of starting server runs in the cmd, but it halts with the following error::
starting weblogic with Java version:
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
My Jdk(64-bit) is installed correctly according to me, JAVA_HOME and those things are correct. jrockit comes bundled with JDK , so why this error, any leads will be very helpful..
Thanks :)
I believe that WebLogic 10.3.5 only supports Suns Java JDK 1.6.0_24+ OR JRockit R28.1.3-1.6.0_24+.
It appears as though Weblogic 10.3.5 is not compatible with Java 7, try re-installing/configurring with a Java 6 version installed.
Source: Oracle Installation Docs

Is it possible to use Java 7 with IBM WebSphere Application Server 8.5 Trial

I have installed WAS 8.5 Trial version on Windows 7. I would like to deploy and run Java 7 application. Is it possible to do it?
I can not see "IBM WebSphere SDK for Java Technology Edition 7" in the IBM Installation Manager's feature list and there is no SDK 7 installed, yet.
>managesdk.bat -listAvailable
CWSDK1003I: Available SDKs :
CWSDK1005I: SDK name: 1.6_64
CWSDK1001I: Successfully performed the requested managesdk task.
>
Has somebody managed to make WAS 8.5 Trial and Java 7 work together on Windows 7?
Thanks in advance!
I've just found one of the possible solutions...
Select the method "Download Director or HTTP" instead of "Installation Manager (Recommended)" at the download page of Evaluate: IBM WebSphere Application Server. Then you get a list of products to download which contains "IBM WebSphere SDK Java 7, Installation Manager repository".
Select and Download all parts of the product and extract the three part to the same directory.
Start your previously installed Installation Manager and add the directory as a new repository under File > Preferences > Repositories, then press OK.
Now you can choose Install and you can select IBM WebSphere SDK Java Technology Edition (Optional) from the list of available packages.
After the installation is completed you can check if everything went well.
>managesdk.bat -listAvailable
CWSDK1003I: Available SDKs :
CWSDK1005I: SDK name: 1.6_64
CWSDK1005I: SDK name: 1.7_64
CWSDK1001I: Successfully performed the requested managesdk task.
>
The Java SDK 1.7 is installed and you can set it as the default SDK in the Administrative Console of your server.
Server > WebSphere application servers > server > Server Infrastructure > Java SDKs
Sorry for the stupid question, I wasn't careful enough...
Firstly install the JDK 1.7 or any required version supported.(find the available using the command - managesdk.bat -listAvailable)
Then Go to the Installed WAS Server DIR and then navigate to bin folder
C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv02\bin
For ALL Profiles
managesdk -enableProfileAll -sdkname SDK_Name -enableServers
From there execute this command(In Windows)
C:\Program Files (x86)\IBM\WebSphere\AppServer_2\profiles\AppSrv02\bin>managesdk
.bat -enableProfile -profileName AppSrv02 -sdkname 1.7_64
It gives this message to confirm.
CWSDK1017I: Profile AppSrv02 now enabled to use SDK 1.7_64.
CWSDK1001I: Successfully performed the requested managesdk task.
(In Linux)
/opt/IBM/WebSphere/WSRR/v8.5/bin/managesdk.sh -enableProfile -profileName AppSrv02 -sdkname 1.7_64
Note: AppSrv02 is the server name used in my local. Replace the name with your actual thing.

Websphere MQ Client installation

I am working on a project where MQ client (Support PAC 7) is installed on one 64-bit Linux machine and it sends messages to server.
On client machine we are using 64-bit linux JDK 1.6.25
java -version
java version "1.6.0_25"
I have following environment variable set up
MQSERVER='my_channel/tcp/SRVD10995(1414)'
MQ_INSTALL_ROOT=/var/mqm/
MQ_JAVA_DATA_PATH=/var/mqm/
MQ_JAVA_INSTALL_PATH=/opt/mqm/java/
MQ_JAVA_LIB_PATH=/opt/mqm/java/lib64
LD_LIBRARY_PATH=/opt/mqm/java/lib64
CLASSPATH= /opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mqjms.jar:/opt/mqm/samp/jms/samples:/opt/mqm/samp/wmqjava/samples
but when I run following command
dspmqver -p 6
For native libraries I am seeing following message:
Name: IBM WebSphere MQ
Version: 7.0.1.6
CMVC Level: k701-106-110721 mqjbnd=CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]::no mqjbnd in java.library.path
Build Type: Production
I am also getting same error message when I execute JMS code to connect to server. I do not have libmqjbnd.so is not in the /opt/mqm/java/lib64 folder, and not even in 32 bit folder.
I have couple of questions :
1) How do I fix this problem for client installation?
2) Does the library file (.so) need to be there in that directory ?
I will be thankful if anyone provides me answer to above questions, I have already invested many hours in this but no joy.
There's a Technote on this specific question here. Let us know if the solution presented there does not resolve your problem.
Update: I noticed a mismatch between your CLASSPATH which is pointing to the 32-bit libs and the other variables pointing to the 64-bit libs. WMQ provides scripts that set the variables for you as described in the Infocenter:
On a UNIX system, you can use the script setjmsenv (if you are using a 32-bit
JVM) or setjmsenv64 (if you are using a 64-bit JVM) to set the environment
variables. On AIX, these scripts are in the /usr/mqm/java/bin directory and,
on HP-UX, Linux, and Solaris, they are in the /opt/mqm/java/bin directory.
Many people source the scripts in their .profile. Have you tried running these? Remember that simply running the script...
/opt/mqm/java/bin/setjmsenv64
...does not result in the env vars being set in the current shell. The script must be sourced using the dot syntax as follows:
. /opt/mqm/java/bin/setjmsenv64
What results do you get after sourcing the appropriate setjmsenv or setjmsenv64 script?
Whether you need the libraries depends how you want to send messages to the server. WebSphere MQ allows you to choose between bindings mode and client mode. Bindings mode uses the libraries with some IPC while client mode is purely Java and TCP based.
If your programming language is Java then i would choose client mode.
This message occurs also when you forget to set properties for host, port, ...
This is in case of standalone MQ client.
MQEnvironment.hostname = "mqm.onZos.myCompany.com";
MQEnvironment.port = 1234;
MQEnvironment.channel = "SYSTEM.MYCH.NAME";

Resources