Sunday, July 31, 2011

Install Oracle Database 11.2.0.1 on Linux

I had to Install Oracle Identity Manager for SSO which needs Oracle Database for MetaData Repository Storage.

I followed the Below steps to Install the Database.

Version used: Oracle 11.2.0.1

OS Used : Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)

Created one OS user : oracle .

Created two OS group : dba, oinstall.

Added the OS user : Oracle to Group dba and oinstall.

How to change default JAVA of linux to lastet version

How to change default JAVA of linux to lastet version:
----------------------------------------------------------------

First check all the executables as mentioned below:

cd /usr/bin
ls -l |grep ja

lrwxrwxrwx 1 root root           25 Jul 31 11:33 jar -> /usr/java/default/bin/jar
lrwxrwxrwx 1 root root           34 Jul 31 12:00 java -> /usr/java/java-1.4/jre/bin/java
lrwxrwxrwx 1 root root           27 Jul 31 11:33 javac -> /usr/java/default/bin/javac
lrwxrwxrwx 1 root root           29 Jul 31 11:33 javadoc -> /usr/java/default/bin/javadoc
lrwxrwxrwx 1 root root           28 Jul 31 11:33 javaws -> /usr/java/default/bin/javaws
lrwxrwxrwx 1 root root           30 Jul 31 11:33 jcontrol -> /usr/java/default/bin/jcontrol

So here you can see all the java components are pointing to /usr/java/default but the "java" component is pointing to java-1.4 :

ls -l /usr/java/default
/usr/java/default ->  /usr/java/jdk1.6.0_26

So, all the components are pointing to the latest version of JDK installed except : java

So when I check : which java
/usr/bin/java
java -version
java 1.4

So , I have to change the "java" executable to point to the latest version that is java-1.6_26 which is installed at location: /usr/java/jdk1.6.0_26

mv /usr/bin/java /usr/bin/java1.4
ln -s /usr/java/jdk1.6.0_26/jre/bin/java /usr/bin/java

Now check :
cd /usr/bin
ls -l |grep ja
lrwxrwxrwx 1 root root           25 Jul 31 11:33 jar -> /usr/java/default/bin/jar
lrwxrwxrwx 1 root root           34 Jul 31 12:00 java -> /usr/java/jdk1.6.0_26/jre/bin/java
lrwxrwxrwx 1 root root           22 Jun 20 15:39 java1.4 -> /usr/java/java-1.4/jre/bin/java
lrwxrwxrwx 1 root root           27 Jul 31 11:33 javac -> /usr/java/default/bin/javac
lrwxrwxrwx 1 root root           29 Jul 31 11:33 javadoc -> /usr/java/default/bin/javadoc
lrwxrwxrwx 1 root root           28 Jul 31 11:33 javaws -> /usr/java/default/bin/javaws
lrwxrwxrwx 1 root root           30 Jul 31 11:33 jcontrol -> /usr/java/default/bin/jcontrol

Thursday, July 7, 2011

Error related to OPSS security failing while starting weblogic servers

I was installing the Weblogic Server ( 10.3.2.0) with SOA Suite 11.1.1.2.0 on a AIX machine (6.1 TL6) .

After installation when I created the domain with default configuration and tried starting the Admin Server I started receiving the following error:

-------------------------------------------------------

weblogic@ABC[/user_projects/domains/base_domain/bin]# ./startWebLogic.sh
*****************************************************
** Setting up SOA specific environment...
*****************************************************
LIBPATH=/oracle/app/Middleware1032/patch_wls1032/profiles/default/native:/oracle/app/Middleware1032/wlserver_10.3/server/native/aix/ppc64:/oracle/app/Middleware1032/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin
.
EXTRA_JAVA_PROPERTIES= -da:org.apache.xmlbeans... -Djavax.xml.datatype.DatatypeFactory=org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl -Djava.endorsed.dirs=/bam/modules/org.apache.xalan_2.7.1 -da:org.apache.xmlbeans... -Djavax.xml.datatype.DatatypeFactory=org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl -Djava.endorsed.dirs=/oracle/app/Middleware1032/Oracle_SOA1/bam/modules/org.apache.xalan_2.7.1
.
LD_LIBRARY_PATH=:/oracle/app/Middleware1032/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin
.
USER_MEM_ARGS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
.
*****************************************************
** End SOA specific environment setup
*****************************************************
.
.
JAVA Memory arguments: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
.
WLS Start Mode=Production
.
CLASSPATH=/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/user-patch.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/soa-startup.jar::/oracle/app/Middleware1032/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/java6_64/lib/tools.jar:/oracle/app/Middleware1032/utils/config/10.3/config-launch.jar:/oracle/app/Middleware1032/wlserver_10.3/server/lib/weblogic_sp.jar:/oracle/app/Middleware1032/wlserver_10.3/server/lib/weblogic.jar:/oracle/app/Middleware1032/modules/features/weblogic.server.modules_10.3.2.0.jar:/oracle/app/Middleware1032/wlserver_10.3/server/lib/webservices.jar:/oracle/app/Middleware1032/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/oracle/app/Middleware1032/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/oracle.soa.common.adapters_11.1.1/oracle.soa.common.adapters.jar:/oracle/app/Middleware1032/oracle_common/soa/modules/commons-cli-1.1.jar:/oracle/app/Middleware1032/oracle_common/soa/modules/oracle.soa.mgmt_11.1.1/soa-infra-mgmt.jar:/oracle/app/Middleware1032/oracle_common/modules/oracle.xdk_11.1.0/xsu12.jar:/oracle/app/Middleware1032/modules/features/weblogic.server.modules.xquery_10.3.1.0.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/db2jcc4.jar:/oracle/app/Middleware1032/user_projects/domains/base_domain/config/soa-infra:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/fabric-url-handler_11.1.1.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/quartz-all-1.6.5.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/oracle.soa.fabric_11.1.1/oracle.soa.fabric.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/oracle.soa.adapter_11.1.1/oracle.soa.adapter.jar:/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/oracle.soa.b2b_11.1.1/oracle.soa.b2b.jar:/oracle/app/Middleware1032/oracle_common/modules/oracle.jrf_11.1.1/jrf.jar::/oracle/app/Middleware1032/Oracle_SOA1/soa/modules/soa-ibm-addon.jar:/oracle/app/Middleware1032/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/oracle/app/Middleware1032/wlserver_10.3/server/lib/xqrl.jar
.
PATH=/oracle/app/Middleware1032/wlserver_10.3/server/bin:/oracle/app/Middleware1032/modules/org.apache.ant_1.7.0/bin:/usr/java6_64/jre/bin:/usr/java6_64/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/weblogic/bin:/usr/bin/X11:/sbin:.:/usr/java6_64/bin:/usr/java6_64/jre/bin:/usr/bin/X11/vncserver:.
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
starting weblogic with Java version:
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr9fp1-20110208_03(SR9 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110203_74623 (JIT enabled, AOT enabled)
J9VM - 20110203_074623
JIT - r9_20101028_17488ifx3
GC - 20101027_AA)
JCL - 20110203_01
Starting WLS with line:
/usr/java6_64/bin/java -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Dweblogic.Name=AdminServer -Djava.security.policy=/oracle/app/Middleware1032/wlserver_10.3/server/lib/weblogic.policy -da -Dplatform.home=/oracle/app/Middleware1032/wlserver_10.3 -Dwls.home=/oracle/app/Middleware1032/wlserver_10.3/server -Dweblogic.home=/oracle/app/Middleware1032/wlserver_10.3/server -Ddomain.home=/oracle/app/Middleware1032/user_projects/domains/base_domain -Dcommon.components.home=/oracle/app/Middleware1032/oracle_common -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Djrockit.optfile=/oracle/app/Middleware1032/oracle_common/modules/oracle.jrf_11.1.1/jrocket_optfile.txt -Doracle.domain.config.dir=/oracle/app/Middleware1032/user_projects/domains/base_domain/config/fmwconfig -Doracle.server.config.dir=/oracle/app/Middleware1032/user_projects/domains/base_domain/config/fmwconfig/servers/AdminServer -Doracle.security.jps.config=/oracle/app/Middleware1032/user_projects/domains/base_domain/config/fmwconfig/jps-config.xml -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Digf.arisidbeans.carmlloc=/oracle/app/Middleware1032/user_projects/domains/base_domain/config/fmwconfig/carml -Digf.arisidstack.home=/oracle/app/Middleware1032/user_projects/domains/base_domain/config/fmwconfig/arisidprovider -Dweblogic.alternateTypesDirectory=/modules/oracle.ossoiap_11.1.1,/modules/oracle.oamprovider_11.1.1 -Dweblogic.jdbc.remoteEnabled=false -da:org.apache.xmlbeans... -Djavax.xml.datatype.DatatypeFactory=org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl -Djava.endorsed.dirs=/bam/modules/org.apache.xalan_2.7.1 -da:org.apache.xmlbeans... -Djavax.xml.datatype.DatatypeFactory=org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl -Djava.endorsed.dirs=/oracle/app/Middleware1032/Oracle_SOA1/bam/modules/org.apache.xalan_2.7.1 -Dsoa.archives.dir=/oracle/app/Middleware1032/Oracle_SOA1/soa -Dsoa.oracle.home=/oracle/app/Middleware1032/Oracle_SOA1 -Dsoa.instance.home=/oracle/app/Middleware1032/user_projects/domains/base_domain -Dtangosol.coherence.clusteraddress=227.7.7.8 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dcom.sun.management.jmxremote -Djava.protocol.handler.pkgs=oracle.mds.net.protocol|oracle.fabric.common.classloaderurl.handler|oracle.fabric.common.uddiurl.handler|oracle.bpm.io.fs.protocol -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=/oracle/app/Middleware1032/wlserver_10.3/server/lib/DemoTrust.jks -Dem.oracle.home=/oracle/app/Middleware1032/oracle_common -Djava.awt.headless=true -Dums.oracle.home=/oracle/app/Middleware1032/Oracle_SOA1 -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole=false -Dweblogic.ext.dirs=/oracle/app/Middleware1032/patch_wls1032/profiles/default/sysext_manifest_classpath weblogic.Server
Jul 2, 2011 4:12:28 PM AST Info WebLogicServer BEA-000377 Starting WebLogic Server with IBM J9 VM Version 2.4 from IBM Corporation
Jul 2, 2011 4:12:29 PM AST Info Management BEA-141107 Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925
Jul 2, 2011 4:12:31 PM AST Info Security BEA-090065 Getting boot identity from user.
Enter username to boot WebLogic server:XXXXXXXX
Enter password to boot WebLogic server:XXXXXXXX
Jul 2, 2011 4:12:41 PM AST Notice WebLogicServer BEA-000365 Server state changed to STARTING
Jul 2, 2011 4:12:41 PM AST Info WorkManager BEA-002900 Initializing self-tuning thread pool
Jul 2, 2011 4:12:41 PM AST Notice Log Management BEA-170019 The server log file /oracle/app/Middleware1032/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.
Jul 2, 2011 4:12:43 PM AST Error Security BEA-090892 The dynamic loading of the OPSS java security policy provider class oracle.security.jps.internal.policystore.JavaPolicyProvider failed due to problem inside OPSS java security policy provider. Exception was thrown when loading or setting the JPSS policy provider. Enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: null
Jul 2, 2011 4:12:43 PM AST Critical WebLogicServer BEA-000386 Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: The dynamic loading of the OPSS java security policy provider class oracle.security.jps.internal.policystore.JavaPolicyProvider failed due to problem inside OPSS java security policy provider. Exception was thrown when loading or setting the JPSS policy provider. Enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: null
weblogic.security.SecurityInitializationException: The dynamic loading of the OPSS java security policy provider class oracle.security.jps.internal.policystore.JavaPolicyProvider failed due to problem inside OPSS java security policy provider. Exception was thrown when loading or setting the JPSS policy provider. Enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: null
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadOPSSPolicy(CommonSecurityServiceManagerDelegateImpl.java:1394)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1018)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:875)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
Truncated. see log file for complete stacktrace

Caused By: java.lang.NullPointerException
at org.apache.harmony.security.Util.equalsIgnoreCase(Util.java:46)
at org.apache.harmony.security.fortress.PolicyUtils.getPolicyURLs(PolicyUtils.java:429)
at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:324)
at org.apache.harmony.security.fortress.DefaultPolicy$1.run(DefaultPolicy.java:317)
at java.security.AccessController.doPrivileged(AccessController.java:202)
Truncated. see log file for complete stacktrace

Jul 2, 2011 4:12:43 PM AST Notice WebLogicServer BEA-000365 Server state changed to FAILED
Jul 2, 2011 4:12:43 PM AST Error WebLogicServer BEA-000383 A critical service failed. The server will shut itself down
Jul 2, 2011 4:12:43 PM AST Notice WebLogicServer BEA-000365 Server state changed to FORCE_SHUTTING_DOWN


----------------------------------------------------------------------------------------------------

Debug Steps:
1: Use the -Djava.security.debug=jpspolicy flag in the weblogic server start-up script as a JAVA_OPTION and try restarting the Server.
2: Found the same error with lots of debug message.
3: Tried creating the Domain with basic Weblogic Server domain only ( without SOA Domain) and then tried starting the Weblogic Admin Server .
4: This time the weblogic Admin Server Started successfully.
5: Checked the permissions for the /tmp directory and changed the permissions to 777 .
6: I tried connecting to the Weblogic Admin Server( from Basic Domain) using WLST connect() command and it throws the below error:

WLST detected that the RuntimeMBeanServer is not enabled. This might happen if the RuntimeMBeanServer is disabled via the JMXMBean.
Please ensure that this MBeanServer is enabled. Online WLST cannot function without this MBeanServer.

This gave me the idea that there is something wrong with the JAVA I am using with weblogic.

7: So, I removed the JAVA directory ( /usr/java6_64 --- in my case ).
8: Reinstalled the IBM JDK ( As my machine was AIX).
9: Now , I tried starting the Weblogic Admin Server from the SOA Domain and it started successfully.

So, the basic idea is to re-install the JAVA in case you encountered any one the below errors:

<Jul 2, 2011 4:12:43 PM AST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: The dynamic loading of the OPSS java security policy provider class oracle.security.jps.internal.policystore.JavaPolicyProvider failed due to problem inside OPSS java security policy provider. Exception was thrown when loading or setting the JPSS policy provider. Enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message: null
weblogic.security.SecurityInitializationException: The dynamic loading of the OPSS java security policy provider class oracle.security.jps.internal.policystore.JavaPolicyProvider failed due to

OR

WLST detected that the RuntimeMBeanServer is not enabled. This might happen if the RuntimeMBeanServer is disabled via the JMXMBean.
Please ensure that this MBeanServer is enabled. Online WLST cannot function without this MBeanServer.