2014年6月30日月曜日

How to Install Java 7(JDK 7u60) On RHEL 6

Step1 Download File
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
#tar xzf jdk-7u60-linux-x64.gz

Step2 Install JAVA using Alternatives
#cd /home/oracle/alice/jdk1.7.0_60
#[oracle@infbjvm1XX jdk1.7.0_60]$ sudo -i
[root@infbjvm1XX ~]# alternatives --install /usr/bin/java java /home/oracle/alice/jdk1.7.0_60/bin/java 2
[root@infbjvm1XX ~]# alternatives --config java
There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /home/oracle/alice/jdk1.7.0_60/bin/java
Enter to keep the current selection[+], or type selection number: 3
#

Now you may also required to setup javac and jar commands path using alternatives:
[root@infbjvm1XX ~]# alternatives --install /usr/bin/jar jar /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# alternatives --install /usr/bin/javac javac /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# set jar /home/oracle/alice/jdk1.7.0_60/bin/java
[root@infbjvm1XX ~]# set javac /home/oracle/alice/jdk1.7.0_60/bin/javac

Step3 Check JAVA Version
# java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Step4 Setup Environment Variables
export JAVA_HOME=/home/oracle/alice/jdk1.7.0_60/
export JRE_HOME=/home/oracle/alice/jdk1.7.0_60/jre
export PATH=$PATH:/home/oracle/alice/jdk1.7.0_60/bin:/home/oracle/alice/jdk1.7.0_60/jre/bin

Problem starting Weblogic Server 10.3.6

Error info:
<Jun 30, 2014 2:46:15 PM CST> <Critical> <Health> <BEA-310006> <Critical Subsystem PersistentStore._WLS_AdminServer has failed. Setting server state to FAILED.
Reason: weblogic.store.PersistentStoreFatalException: [Store:280105]The persistent file store "_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT.>
<Jun 30, 2014 2:46:15 PM CST> <Critical> <WebLogicServer> <BEA-000385> <Server health failed. Reason: health of critical service 'PersistentStore._WLS_AdminServer' failed>
<Jun 30, 2014 2:46:15 PM CST> <Error> <Store> <BEA-280061> <The persistent store "_WLS_AdminServer" could not be deployed: weblogic.store.PersistentStoreFatalException: [Store:280105]The persistent file store "_WLS_AdminServer" cannot open file _WLS_ADMINSERVER000000.DAT.

Workaround:
Navigating to
/user_projects/domains/<<Domain_name>>/servers/AdminServer/data/store/default/

directory and delete the _WLS_ADMINSERVER000000.DAT file.
After deleting the file, try restart the server again.
This action is detailed out in Oracle Support doc if 957377.1.

java.lang.OutOfMemoryError: PermGen space with weblogic

Error info:
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:302)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer._isAccessKeyNotOnPrompt(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer._createContentNode(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.InlineMessageRenderer.__registerMarlinRenderer(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel._registerDependentRenderers(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel.createDefaultFactory(Unknown Source)
at oracle.cabo.ui.laf.base.xhtml.XhtmlLookAndFeel.<clinit>(Unknown Source)
at oracle.cabo.ui.laf.base.desktop.BaseDesktopUtils.registerLookAndFeel(Unknown Source)
at oracle.cabo.ui.laf.LookAndFeelManager.createDefaultLookAndFeelManager(Unknown Source)
at oracle.cabo.ui.laf.LookAndFeelManager.getDefaultLookAndFeelManager(Unknown Source)
at oracle.sysman.emSDK.chart.EmChartCacheManager.init(EmChartCacheManager.java:105)
at oracle.sysman.emSDK.svc.ServiceUtil.initService(ServiceUtil.java:94)
at oracle.sysman.eml.app.ContextInitializer.contextInitialized(ContextInitializer.java:600)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1868)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3154)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:302)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at oracle.sysman.emSDK.svc.ServiceUtil.initService(ServiceUtil.java:91)

Work around:
The reference bug is listed following:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4957990

In my case the solution was to edit the DOMAIN\bin\setDomainEnv.cmd file. The following modifications were made before the server would start as intended:
The -Xms and -Xmx values were increased;
the -XX:PermSize and -XX:MaxPermSize values were increased too
and lastly, but probably most importantly
the if "%JAVA_VENDOR%"=="Sun" (conditions were changed to if "%JAVA_VENDOR%"=="Oracle" ) in order to properly recognize my JVM.

Reference Doc:
http://www.cnblogs.com/pipijiqimao/archive/2013/03/06/2946344.html

2014年6月4日水曜日

WLS: ERROR CODE 17002

Error info:
[EL Severe]: 2014-06-04 14:09:08.047--ServerSession(19793384)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLRecoverableException: IO\u30a8\u30e9\u30fc: The Network Adapter could not establish the connection
Error Code: 17002
6 04, 2014 2:09:08 \u5348\u5f8c oracle.security.jps.internal.common.config.AbstractSecurityStore getSecurityStoreVersion
\u8b66\u544a: Unable to get the Version from Store returning the default
oracle.security.jps.service.policystore.PolicyStoreConnectivityException: JPS-00027: \u5185\u90e8\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: java.net.ConnectException: \u63a5\u7d9a\u3092\u62d2\u5426\u3055\u308c\u307e\u3057\u305f
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.handleDatabaseException(JpsDBDataManager.java:2153)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.processJPAException(JpsDBDataManager.java:2708)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.existsTable(JpsDBDataManager.java:1517)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.isPrincipalAssigneeSplit(JpsDBDataManager.java:1457)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.checkFunctionSupportedInDoAs(JpsDBDataManager.java:1414)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.checkFunctionSupported(JpsDBDataManager.java:1448)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.createEMFAndSubject(JpsDBDataManager.java:1587)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.getEMFAndSubject(JpsDBDataManager.java:1549)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.init(JpsDBDataManager.java:1174)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.jpsObjectBaseQuery(JpsDBDataManager.java:3894)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.queryBaseObjects(JpsDBDataManager.java:7124)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.getSecurityStoreVersion(AbstractSecurityStore.java:169)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.getSecurityStoreVersionInternal(AbstractSecurityStore.java:152)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.getSecurityStoreVersion(AbstractSecurityStore.java:129)
at oracle.security.jps.internal.credstore.ldap.LdapCredentialStore.<init>(LdapCredentialStore.java:157)
at oracle.security.jps.internal.credstore.ldap.LdapCredentialStore.<init>(LdapCredentialStore.java:140)
at oracle.security.jps.internal.credstore.ldap.LdapCredentialStoreProvider.getInstance(LdapCredentialStoreProvider.java:130)
at oracle.security.jps.internal.credstore.rdbms.DbmsCredentialStoreProvider.getInstance(DbmsCredentialStoreProvider.java:78)
at oracle.security.jps.internal.credstore.rdbms.DbmsCredentialStoreProvider.getInstance(DbmsCredentialStoreProvider.java:60)
at oracle.security.jps.internal.credstore.rdbms.DbmsCredentialStoreProvider.getInstance(DbmsCredentialStoreProvider.java:52)
at oracle.security.jps.internal.core.runtime.ContextFactoryImpl.findServiceInstance(ContextFactoryImpl.java:139)
at oracle.security.jps.internal.core.runtime.ContextFactoryImpl.getContext(ContextFactoryImpl.java:170)
at oracle.security.jps.internal.core.runtime.ContextFactoryImpl.getContext(ContextFactoryImpl.java:206)
at oracle.security.jps.internal.core.runtime.JpsContextFactoryImpl.getContext(JpsContextFactoryImpl.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.python.core.PyReflectedFunction.__call__(Unknown Source)
at org.python.core.PyMethod.__call__(Unknown Source)
at org.python.core.PyObject.__call__(Unknown Source)
at org.python.core.PyInstance.invoke(Unknown Source)
at org.python.pycode._pyx50.isInCredStore$20(/home/oracle/mdwAlice/Oracle_IDM1/common/tools/configureSecurityStore.py:259)
at org.python.pycode._pyx50.call_function(/home/oracle/mdwAlice/Oracle_IDM1/common/tools/configureSecurityStore.py)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyFunction.__call__(Unknown Source)
at org.python.core.PyObject.__call__(Unknown Source)
at org.python.pycode._pyx50.f$0(/home/oracle/mdwAlice/Oracle_IDM1/common/tools/configureSecurityStore.py:562)
at org.python.pycode._pyx50.call_function(/home/oracle/mdwAlice/Oracle_IDM1/common/tools/configureSecurityStore.py)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyCode.call(Unknown Source)
at org.python.core.Py.runCode(Unknown Source)
at org.python.util.PythonInterpreter.execfile(Unknown Source)
at weblogic.management.scripting.WLST.main(WLST.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at weblogic.WLST.main(WLST.java:29)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLRecoverableException: IO\u30a8\u30e9\u30fc: The Network Adapter could not establish the connection
Error Code: 17002
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.existsTable(JpsDBDataManager.java:1494)
... 47 more
Caused by: java.sql.SQLRecoverableException: IO\u30a8\u30e9\u30fc: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
... 56 more

Workaround:
That is a database error code.Please check your database connection information.