如何在启动服务器前设置jdbc登录超时秒。在Weblogic服务器启动时,如果数据源无法访问数据库,则Weblogic服务器线程会挂在JDBC驱动程序代码中,等待数据库服务器的回复。
模式domain xmlns="http://xmlns.oracle.com/weblogic/domain"
有这个属性jdbc登录超时秒,但我不知道如何设置它?以下是domain.xsd 的详细信息
<xs:complexType name="serverType">
<xs:complexContent>
<xs:extension base="dom:kernelType">
<xs:element default="0" minOccurs="0" name="jdbc-login-timeout-seconds" nillable="false">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="kernelType">
以下是从oracle进行设置的文档
1)http://docs.oracle.com/cd/E11035_01/wls100/schemaref/config/http.www.bea.com.ns.weblogic.920.domain/types/servertype.jdbc-login-timeout-seconds.html
2)http://docs.oracle.com/cd/E15523_01/web.1111/e13737/jdbc_datasources.htm#i1203054
此外,如果我在ServerMBean上设置JDBCLoginTimeoutSeconds属性可以做到这一点,请通过管理控制台分享设置步骤。
下面是我的config.xml
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd">
<name>base_domain</name>
<domain-version>10.3.5.0</domain-version>
<security-configuration>
<name>base_domain</name>
<realm>
<sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:active-type>AuthenticatedUser</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
<sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
<sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
<sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:name>myrealm</sec:name>
<sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
<sec:name>SystemPasswordValidator</sec:name>
<pas:min-password-length>8</pas:min-password-length>
<pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
</sec:password-validator>
</realm>
<default-realm>myrealm</default-realm>
<credential-encrypted>{AES}QEVyKcPXSLI3fJ4+E7+vZXSCAyCiqKRCgZ+g3VG/6bg0+5W2aeZ/RvvdpY09+wFqyjSSENtW7uuPii8I5VcdAx6fXTLp5LabMTmVMKWU5ionHtVOvCbDCYHebmPnC6ky</credential-encrypted>
<node-manager-username>weblogic</node-manager-username>
<node-manager-password-encrypted>{AES}RFTA5Jc8EDK/SQOKxSJLcyEwWprM6bmtefX4yPgaNjs=</node-manager-password-encrypted>
</security-configuration>
<server>
<name>AdminServer</name>
<listen-address></listen-address>
</server>
<embedded-ldap>
<name>base_domain</name>
<credential-encrypted>{AES}WFD4gnix1Q8sUzcFWhXtZf/bWE2C4qu7lokJGxmRn23fwSi1o8EzZx0TW9QqxnVm</credential-encrypted>
</embedded-ldap>
<configuration-version>10.3.5.0</configuration-version>
<admin-server-name>AdminServer</admin-server-name>
<jdbc-system-resource>
<name>appDS</name>
<target>AdminServer</target>
<descriptor-file-name>jdbc/appDS-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
</domain>
1)打开命令提示符
2) 转到:域名/bin
3) 运行:
/setDomainEnv.sh
java weblogicWLST
4) WLST启动后,执行以下命令:
提示>连接('用户名','密码','3://ip:port')
提示>编辑()
prompt>startEdit()
prompt>cd("服务器/服务器名称")
prompt>ls()
注意:这将列出所有可用的MBean。请确保存在"JDBCLoginTimeoutSeconds"
prompt>cmo.setJDBCLoginTimeoutSeconds(10)
提示>保存()
提示>激活()
5) 重新启动服务器