How to have managed servers on different java JDK versions - java-7

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

Related

I need to find whether my Websphere servers are running on version 6 or version 8 currently?

I have got two versions installed in WebSphere Application Server ( version 6 and version 8 ). I need to find whether my Websphere servers are active on version 6 or version 8 currently from backend ( UNIX ) ?
Please don't suggest ps -ef | grep java, because it does not show the processes of servers in case the servers are not running. I want a solution that works irrespective of whether servers is running or not.
Both releases have bin/bersionInfo.sh (or .bat on Windows).
Is the issue here that you know where the separate v6 and v8 installations are on the file system, but you simply want to know which of them is active? If so, use the serverStatus.sh|bat script - call it against your WAS 6 server, then call it against your WAS 8 server, and you'll know which is active.
Alternately, you could use ps -ef|grep java and check the PID against the pid file in your server's logs directory.
Consult `/properties/version/profile.version. Since you seem to know the location of the profile on disk but not whether it will be running or not, this file will indicate what version of WAS it was created by. Profiles can only be owned by the version of WebSphere they were created by, so this should be the version the profile will run with when started.

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.

Running Tomcat from windows 10 bash shell

I installed tomcat server on windows10 bash shell. Though it says apache is running.. its not opening admin panel in browser. Browser says 'Connection can't be reached'
Have someone tried this ever before? Please share your inputs.
Thank you
I am assuming you are referring to Bash for Windows (Ubuntu) on Windows 10. Yes Tomcat server can be installed and run from Bash for Windows with no need to install Tomcat in the Windows environment.
First, you may want to check if any local server is running on Windows 10 port 8080 - the default port for Tomcat, or whatever port you are configuring Tomcat for.
Second, open BASH for Windows and install Java. I used Oracle Java JDK 8 (http://www.oracle.com/technetwork/java/javase/downloads/index.html) and downloaded the tar.gz file.
Extract the tar.gz and copy to a standard directory like /usr/local/java or in the /opt/ directory for easy access.
Create JAVA_HOME and JRE_HOME environment variables that link to your java location.
I also updated the alternatives to map java, javac, and javaws. You can use this link to assist (http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre)
Then download the tar.gz of Tomcat. Again, I used Tomcat 8.5 for my scenario and extract the files to your chosen directory.
Last, run the startup script located in the bin folder of the tomcat extracted folder. You should have a working Tomcat version.
Use the curl command to validate - curl localhost:8080
If you want to change the admin privileges, edit the tomcat-users.xml file located in the conf folder within the extracted tomcat directory.
Access to the tomcat server can also be done through the Windows system and not just through the Bash for Windows CLI.
Hope this helps!

Changing the SDK in WebSphere Application Server 8.5

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!

How do I upgrade Apache Tomcat from 6.0.20 to 6.0.24?

Our security team has scanned our production server and identified vulnerabilities with Apache Tomcat server v 6.0.20.
They have recommended that Apache be upgraded to 6.0.24. Reading through the forums, I believe this is the process to do so
Take a backup of httpd.conf file
Using add remove programs, uninstall version 6.0.20
Install 6.0.24
But, I have some questions depending on a quick test I did to install 6.0.20 and upgrade it to 6.0.24
Where do I get Tomcat administrator login information?
Is it enough just to backup the HTTPD.CONF file? I was thinking to back up everything in the Apache folder instead.
Is it possible not to upgrade 6.0.20 to 6.0.24 by running the MSI installer over the same Apache folder? Is it due to the HTTP/1.1 Connector Port being busy/used that doesn't allow an update of Tomcat on the same port?
Is a restart of the server required after upgrade?
Last but not the least, I am using these executables to test the upgrade. 6.0.20 gets installed fine but when I run 6.0.24, it prompts me for the JRE path and directing it to 6.0.20 JVM Path gives me a message that "JVM is not found". The JVM info on the Apache manager is in this directory
What am I missing here?
I need your thoughts and advice to make this as easy as possible since this is a production server.

Resources