Question

How to set up jdbc-login-timeout-seconds before I start the server. On Weblogic server startup, if a database is unreachable for a data source, Weblogic Server threads hang inside the JDBC driver code waiting for a reply from the database server.

The schema domain xmlns="http://xmlns.oracle.com/weblogic/domain" has this attribute jdbc-login-timeout-seconds but I am unable to figure out how to set this? Below is the details from 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">

Below are the documentation for setting this up from 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

Also if this can be done my setting JDBCLoginTimeoutSeconds attribute on the ServerMBean, please share the steps to set it up through admin console.

Below is my 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>
Était-ce utile?

La solution

1) Open a command prompt

2) Go to: domain-name/bin

3) Run:

. ./setDomainEnv.sh

java weblogicWLST

4) Once WLST is started, execute the following commands:

prompt>connect('username','password','t3://ip:port')

prompt>edit()

prompt>startEdit()

prompt>cd('Servers/server-name')

prompt>ls()

NOTE: this will list all the MBeans available. Please make sure "JDBCLoginTimeoutSeconds" is there

prompt>cmo.setJDBCLoginTimeoutSeconds(10)

prompt>save()

prompt>activate()

5) Restart the server

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top