weblogic测试JDBC数据源失败(TestConnectionsOnReserve)

环境:weblogic9
现象:新建好JDBC数据源后,进入 JDBC-数据源-监视-测试,进行测试,出现测试失败的提示。
提示信息:

Warning! Connectivity to backend database not verified. This is either because required connection pool attribute "TestConnectionsOnReserve" has not been enabled, or an invalid value has been specified for attribute "TestTableName". Please check the server log for more details..

解决方法:进入 JDBC-数据源-配置-连接缓冲池-高级,将“保留时测试连接”(TestConnectionsOnReserve)打钩即可。
注:weblogic8 解决方法类似。
TestConnectionsOnReserve说明:使 WebLogic Server 能够在将连接提供给客户端之前对连接进行测试。(要求指定“测试表名称”。)
此测试在响应客户端对缓冲池中的连接的请求时将添加短时间的延迟,但会确保客户端收到有效连接。
对于使用故障转移算法的在多数据源中使用的连接缓冲池,该测试是必需的。

weblogic9在保存JDBC时报错JDBCSystemResourceMBean cannot be null

环境:Linux+weblogic923
现象:新建一个名为“JDBC Data Source-0”的数据源后,对其进行修改,在激活更改是发生报错
报错信息:

JDBCSystemResourceMBean cannot be null.

java.lang.IllegalArgumentException: JDBCSystemResourceMBean cannot be null. at com.bea.console.utils.jdbc.JDBCUtils.getJdbcDataSourceBean(JDBCUtils.java:844) at com.bea.console.actions.jdbc.datasources.JDBCDataSourceConfigAction.execute(JDBCDataSourceConfigAction.java:62) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:95) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2042) at 
......

解决方法:删除该JDBC数据源,新建时注意JDBC名称不要带有空格。

AIX下以console方式安装weblogic11g

前提

已经安装IBM jdk:Java6_64.sdk;创建好weblogic用户。

安装包

wls1036_generic.jar

安装全过程

jhdev$[/weblogic]java -version
java version “1.6.0”
Java(TM) SE Runtime Environment (build pap6460sr9fp2-20110627_03(SR9 FP2))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110624_85526 (JIT enabled, AOT enabled)
J9VM – 20110624_085526
JIT – r9_20101028_17488ifx17
GC – 20101027_AA)
JCL – 20110530_01
jhdev$[/weblogic]which java
/usr/java6_64/bin/java
jhdev$[/weblogic]java -jar /tmp/wls1036_generic.jar -mode=console
Extracting 0%……………………………………………………………………………………….100%

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Welcome:
——–

This installer will guide you through the installation of WebLogic 10.3.6.0.
Type “Next” or enter to proceed to the next prompt. If you want to change data entered previously, type “Previous”. You may quit the installer at any time by typing “Exit”.
Enter [Exit][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Choose Middleware Home Directory:
———————————

->1|* Create a new Middleware Home
2|/weblogic/Oracle/Middleware
Enter index number to select OR [Exit][Previous][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Choose Middleware Home Directory:
———————————

“Middleware Home” = [Enter new value or use default
“/weblogic/Oracle/Middleware”]
** The product maintenance level of the current installer (WebLogic
** Server:10.3.6.0) is not compatible with the maintenance level of the
** product installed on your system (WebLogic Server:10.3.1.0) . Please
** obtain a compatible installer or perform maintenance on your current
** system to achieve the desired level.
Enter new Middleware Home OR [Exit][Previous][Next]> /weblogic/Oracle/Middleware1036

(可以默认目录,因为该机器已经安装过,故自定义目录)

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Choose Middleware Home Directory:
———————————

“Middleware Home” = [/weblogic/Oracle/Middleware1036]

Use above value or select another option:
1 – Enter new Middleware Home
2 – Change to default [/weblogic/Oracle/Middleware]
Enter option number to select OR [Exit][Previous][Next]>

(以下4个步骤是跳过Register for Security Updates)

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Register for Security Updates:
——————————

Provide your email address for security updates and to initiate configuration manager.

1|Email:[]
2|Support Password:[]
3|Receive Security Update:[Yes]
** Do you wish to bypass initiation of the configuration manager and
** remain uninformed of critical security issues in your configuration?
Enter index number to select OR [Exit][Previous][Next]> 3

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Register for Security Updates:
——————————

Provide your email address for security updates and to initiate configuration manager.

“Receive Security Update:” = [Enter new value or use default “Yes”]

Enter [Yes][No]? no

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Register for Security Updates:
——————————

Provide your email address for security updates and to initiate configuration manager.

“Receive Security Update:” = [Enter new value or use default “Yes”]
** Do you wish to bypass initiation of the configuration manager and
** remain uninformed of critical security issues in your configuration?
Enter [Yes][No]? yes

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Register for Security Updates:
——————————

Provide your email address for security updates and to initiate configuration manager.

1|Email:[]
2|Support Password:[]
3|Receive Security Update:[No]

Enter index number to select OR [Exit][Previous][Next]> n

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Choose Install Type:
——————–

Select the type of installation you wish to perform.

->1|Typical
| Install the following product(s) and component(s):
| – WebLogic Server
| – Oracle Coherence

2|Custom
| Choose software products and components to install and perform optional
|configuration.

Enter index number to select OR [Exit][Previous][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

JDK Selection (Any * indicates Oracle Supplied VM):
—————————————————

JDK(s) chosen will be installed. Defaults will be used in script string-substitution if installed.

1|Add Local Jdk
2|/usr/java6_64[x]

*Estimated size of installation: 750.9 MB
Enter 1 to add or >= 2 to toggle selection OR [Exit][Previous][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Choose Product Installation Directories:
—————————————-

Middleware Home Directory: [/weblogic/Oracle/Middleware1036]

Product Installation Directories:
1|WebLogic Server: [/weblogic/Oracle/Middleware1036/wlserver_10.3]
2|Oracle Coherence: [/weblogic/Oracle/Middleware1036/coherence_3.7]
Enter index number to select OR [Exit][Previous][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

The following Products and JDKs will be installed:
————————————————–

WebLogic Platform 10.3.6.0
|_____WebLogic Server
| |_____Core Application Server
| |_____Administration Console
| |_____Configuration Wizard and Upgrade Framework
| |_____Web 2.0 HTTP Pub-Sub Server
| |_____WebLogic SCA
| |_____WebLogic JDBC Drivers
| |_____Third Party JDBC Drivers
| |_____WebLogic Server Clients
| |_____WebLogic Web Server Plugins
| |_____UDDI and Xquery Support
| |_____Evaluation Database
|_____Oracle Coherence
|_____Coherence Product Files

*Estimated size of installation: 751.1 MB
Enter [Exit][Previous][Next]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Installing files..

0% 25% 50% 75% 100%
[————|————|————|————]
[***************************************************]
Performing String Substitutions…

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Configuring OCM…

0% 25% 50% 75% 100%
[————|————|————|————]
[***************************************************]
Creating Domains…

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Installation Complete
Congratulations! Installation is complete.
Press [Enter] to continue or type [Exit]>

<——————– Oracle Installer – WebLogic 10.3.6.0 ——————->

Clean up process in progress …
jhdev$[/weblogic]

weblogic报java.lang.AssertionError: Could not obtain the localhost address

情况:
weblogic所在虚拟机是其他地方克隆过来的。
启动报错:

<Nov 5, 2014 7:39:07 PM CST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine.
java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine.
at weblogic.server.channels.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:40)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:35)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:98)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
at weblogic.cluster.ClusterService.start(ClusterService.java:95)
Truncated. see log file for complete stacktrace
java.net.UnknownHostException: dyapp1: dyapp1
at java.net.InetAddress.getLocalHost(InetAddress.java:1308)
at weblogic.server.channels.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:38)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:35)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:98)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
Truncated. see log file for complete stacktrace

检查发现/etc/hosts下的名字与主机名不一致。

解决方案:
修改hosts或者主机名

临时修改主机名(重启失效):
hostname newname
完全修改:
修改/etc/sysconfig/network中的hostname