Pages

Sunday, 13 April 2014

wsadmin or management scripts can’t access server


 

We are trying to use wsadmin to manage your system, but you are unable to connect to an application server process or are getting no response from wsadmin.

You have this problem when trying to use the supplied management scripts, such as stopServer.bat or serverStatus.bat.

You experience this problem immediately after installing WebSphere Application Server, after enabling security, after adding a node to the deployment manager, or after restarting the WebSphere Application Server server.

àData to collect:

The following logs can be helpful in determining why you cannot administer WebSphere Application Server with wsadmin:

Application server logs,

wsadmin trace log, 

Management script log files if appropriate,

Trace from the management script if appropriate.

If you are trying to manage a service using a management script, such as stopServer.bat, then you need the log file from that script (stopServer.log) and possibly a trace of that script.

 

 

 

àWhat to look for:

This problem can occur because the application server to which you are trying to connect is not running, or you are trying to connect to the wrong port number.

The wsadmin utility connects to an application server in a stand-alone environment or deployment manager in a distributed environment. The following error shows that no connection could be established:

WASX7023E: Error creating “SOAP” connection to host “hostname”

Make sure that the application server is running and that you are using the correct port number to connect to the application server or deployment manager.

àVerify the port number

You can determine to which server wsadmin is trying to connect and on what port by looking at the wsadmin.properties file. This file is in the profile directory structure:

<WAS_install_root>/profiles/<profile>/properties/wsadmin.properties

Below Example shows the host name and port number that wsadmin uses by default.

SOAP host and port for a stand-alone server:

com.ibm.ws.scripting.host=localhost
com.ibm.ws.scripting.port=8879

You can compare this to the entry in the SystemOut.log from the application server that tells you on which port the application server is actually listening for SOAP connections, as shown in Example :

Ex SOAP connector port number from the SystemOut.log

[7/8/05 14:19:55:445 EDT] 0000000a JMXSoapAdapte A ADMC0013I: The SOAP connector is available at port 8880.

If the host and port are different, then your wsadmin.properties file is out of sync with the server. This can happen if you change the SOAP port after the profile has been created. When you create a profile, the SOAP port is hard coded into wsadmin.properties. If you later change the SOAP port, the administrative console updates the file that contains the port assignments for the server process (serverindex.xml) but does not update the wsadmin.properties file. You must do this manually.

Alternatively, you can pass the port number to wsadmin with the -port parameter:
wsadmin -host     kll6571    -port     8880

In a Network Deployment installation, wsadmin attempts to send requests to the deployment manager. Again, the wsadmin.properties file contains the host name and port number of the deployment manager process. Using the -host and -port
parameters, you can use wsadmin to connect directly to a process other than the deployment manager. For example you could connect directly to a node agent or remote application server. Example below shows a connection to a node agent and then issuing a stopServer command.

Ex: Connecting directly to a node agent using wsadmin:

$ ./wsadmin.bat -host m23vnx60.itso.ral.ibm.com -port 8881
WASX7209I: Connected to process “nodeagent” on node m23vnx60Node01 using SOAP
connector; The type of process is: NodeAgent
WASX7029I: For help, enter: “$Help help”
wsadmin>$AdminControl stopServer nodeagent
WASX7337I: Invoked stop for server “nodeagent” Waiting for stop completion.


Note: In above Example, you will not receive any further response because the server shuts down. Use Ctrl+c to exit the utility.

àVerify that the application server is running

You can use the netstat command to ensure that a process is listening on the port. Example 4-7 shows the output of the netstat command that has been filtered with the grep tool to only show lines containing the string 8880.

Ex 4-7    netstat output:

C:\IBM\WAS6\AppServer\profiles\StandAlone\bin>netstat -an|grep 8880
TCP 0.0.0.0:8880 0.0.0.0:0 LISTENING
TCP 9.42.171.145:8880 9.42.171.145:1114 CLOSE_WAIT
TCP 127.0.0.1:8880 127.0.0.1:1122 CLOSE_WAIT
TCP 127.0.0.1:8880 127.0.0.1:1161 CLOSE_WAIT


Note: The netstat command is available on both UNIX and Windows. The grep command is available on UNIX by default, and you can download free copies of grep for Windows.

You can also use the telnet command to try and get a connection to the host name and port as shown in Example 4-8.

Ex 4-8 Using  to  telnet  to test a port:

C:\IBM\WAS6\AppServer\profiles\StandAlone\bin>telnet localhost 8880
Connecting To localhost…Could not open a connection to host on port 8880 : Connect failed


Note that even if you can connect, you will not be able to do anything because WebSphere Application Server does not respond to telnet commands. You can close your telnet session by pressing Ctrl+c.

If telnet is not able to connect, then the server is not started or not accepting any form of connection. Try restarting the application server. You probably need to kill the Java process because it will not accept the stopServer command.

àVerify the security configuration

If security is enabled, then you need to pass a user name and password to wsadmin in order to connect. If you do not pass a user name or password, or get them wrong, you get an error connecting, as shown in Example 4-9

Example 4-9 Incorrect user name or password

———————————————————————–
WASX7246E: Cannot establish “SOAP” connection to host “localhost” because of an authentication failure. Ensure that user and password are correct on the command line or in a properties file.
Exception message (if any): “ADMN0022E: Access is denied for the getProcessType
operation on Server MBean because of insufficient or empty credentials.”


——————————————————————————–

You might not be able to connect to the application server or deployment manager if security is enabled, due to a problem with the digital certificates that are used to setup an SSL communication.

If your problem is not resolved by fixing invalid certificates, you can confirm that it is related to security by turning security off and retesting. If you cannot access the administrative console, you can turn security off by editing the security.xml

No comments:

Post a Comment