Friday, February 26, 2016

FFDC Exception:com.ibm.db2.jcc.c.SqlException

[2/26/10 7:34:18:98 IST]     FFDC Exception:com.ibm.db2.jcc.c.SqlException SourceId:com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledCon ProbeId:1298
com.ibm.db2.jcc.c.SqlException: [ibm][db2][jcc] No license was found. An appropriate license file db2jcc_license_*.jar must be provided in the CLASSPATH setting.


This exception is seen when you have not defined the db2jcc_license_cisuz.jar file path in the class path.

Resolution:

Navigate to Application servers > AppNodeName01 > Process definition > Java Virtual Machine

Under general properties, Add the path of the license file in the Classpath field. and the paths can be separated by ":"

Restart the servers once done and the error should be missing. 

Tuesday, February 16, 2016

ws_common: websphereHandleRequest: Failed to handle request rc=4

Following error is seen in WAS 8.5.5:

[15/Feb/2016:23:30:06.56633] 0011dbd46 ads3asd00 - ERROR: ESI: getResponse: failed to get response: rc = 4
[15/Feb/2016:23:30:06.56636] 0011dbd46 asdfdsaf - ERROR: [hostname://url] ws_common: websphereHandleRequest: Failed to handle request rc=4
[15/Feb/2016:23:30:07.3555539] 0000db46 1adsf789 - ERROR: ws_common: websphereFindTransport: Nosecure transports available
[15/Feb/2016:23:30:07.344546] 0000db46 1sdf9f8700 - ERROR: ws_common: websphereWriteRequestReadResponse: Failed to find a transport


Analysis:

This error is seen when you are using both the http and https, i.e, Both the secure and non secure transports in your plugin-cfg.xml file as following. By default, This configuration is seen.

         <Transport Hostname="hostname" Port="9080" Protocol="http"/>
         <Transport Hostname="hostname" Port="9443" Protocol="https">

In the above situation, When the incoming traffic is secure then the webserver chooses secure transport(https) to connect to the backend application server. However, If the incoming traffic is not secure, Then the webserver chooses unsecure transport (http) to establish a connection to the backend server.

Now, If the plugin receives secure connection request (https) and if it is not able to create a secure connection to the backend application server, It would use the non secure connection to the backend application server. and If the http transport is not defined then the request will fail.

However, In WAS 8.5.5, If the plugin is unable to establish a secure connection to the backend applcation server, It will not create a non secure connection to backend and is treated as security threat and the above error marked in red will be displayed in the http_plugin.log file.

Solution: 

To solve this issue, Navigate to Webserver-> instance name -> Plug-in properties -> custom properties.


and create the variable Unsecure and value as true. Save in custom properties.

Generate and propagate the plugin and restart the webservers.

Or

You can remove the http transport from the plugin-cfg.xml file and propagate it and restart the webservers.

Thursday, November 26, 2015

Unable to start the deployment manager due to (No space left on device).

The above error is seen in particular in the following two formats:

SystemErrR java.io.FileNotFoundException:  /websphere/profiles/Dmgr01/wstemp/common/XmlLocale.class (No space left on device)

SystemErr     R java.io.FileNotFoundException: /websphere/profiles/Dmgr01/wstemp/778788/prefs.xml (No such file or directory)

For the above two errors, You need to do the following preliminary check:

Step 1: df -kh /webspehre (or the filesystem on which the wstemp is mounted)

To check the filesystem usage. If the filesystem is 100%, Then clear the unwanted files and try restarting the server.

If, The file system is free and you still see the error, Move to the following step.

Step 2: Try creating a directory in the wstemp folder with any name and see if you are able to create a directory. Most probably you would be getting the following error.

[root@ wstemp]# mkdir test
mkdir: cannot create directory `test': No space left on device

Step 3: df -i /websphere

This must be listing 100% usage of inodes.

Filesystem             Inodes   IUsed    IFree IUse% Mounted on

/filesystem
                      2293760 2293757        3  100% /websphere

It is very rear to run out of inodes before the disk space is full.

For this you need to do a little manual work. Use the following command to check the number of files and directories for the particular file system.

for i in /*; do echo $i; find $i |wc -l; done

The directory with the highest number of files will probably the culprit. Move to that directory and execute the command again. Keep doing that until you are able to figure out the folder with max files and delete the ones that are not in use.

This will temporarily solve the issue. However, The permanent solution would be to check why the files are piling up. The inodes can be increased only during the filesystem creation, It can not be changed dynamically. 

Thursday, November 12, 2015

How to change the master configuration in websphere 8.5.5 dynamic clusters

In the dynamic cluster environment, You should not change the configuration like java parameters to the individual cluster members, If it is changed in individual server level, The master configuration will overwrite the server level configuration. Hence to avoid this, For any configuration related changes on the dynamic clusters need to changed @ Master configuration.

Step 1: Login to the Dmgr console.

Step 2: Navigate to the dynamic clusters as shown below and click on the corresponding dynamic cluster.



Step 3: On the left hand side the server template is seen. Click on that.

Step 4: Then you can click on the JVM process definition or any other configuration required.

Step 5: Save the changes and restart the cluster members. This should replicate the changes at cluster member level.

Friday, October 30, 2015

How to configure sticky sessions between Apache web server and Tomcat application server

Why sticky sessions?

Imagine you have a Apache server which load balances between two tomcat servers(tomcat1 and tomcat2) in the backend, With the use of sticky sessions, When the user sends the first request, If apache routes it to tomcat1, It will keep on sending the other requests made by the same user to the same server. If the tomcat1 is down, Then the user will be forwared to tomcat2 and will be asked to login again as the session information is lost in the tomcat1.

When you use sticky session with session replication, This issue will be solved. Considering the above scenario, When the tomcat1 is down, The session will be carried over to the tomcat2 and the user will still be able to continue the work with out any disruption.

Implementation :

Sticky sessions can be implemented in many ways, out of which I am listing the configuration with proxy and configuration with worker.properties.

Configuration with mod_proxy:

After the installation of apache, Open the http.conf file, Enable the mod_proxy.so, mod_proxy_http.so and proxy_balancer_module.

LoadModule proxy_module mod_proxy.so
LoadModule proxy_http_module mod_proxy_http.so
LoadModule proxy_balancer_module 

<IfModule mod_proxy_balancer.c>
    ProxyPass /context balancer://tomcatcluster/context stickysession=JSESSIONID|jsessionid
    <Proxy balancer://tomcatcluster>
        BalancerMember http://tomcatlocalhost:9080 route=tomcatroute1
        BalancerMember http://tomcatlocalhost:9081 route=tomcatroute2
    </Proxy>
</IfModule>


Once this configuration is done in apache, Save the httpd.conf and restart the server.

After tomcat server installation, open the server.xml and ensure http connector port is same as the port that is defined in the cluster properties of apache configuration file. For sticky sessions, Ensure that the jvm route value is same as the route value in the httpd.conf file.


tomcatroute1 worker:


<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcatroute1">
</Engine>
<Connector port="9080" protocol="org.apache.coyote.http11.Http11Protocol" ... />

tomcatroute2 worker:


<Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcatroute2">

</Engine>
<Connector port="9081" protocol="org.apache.coyote.http11.Http11Protocol" ... />


Save the configuration, Now the sticky sessions are configured.

Configuration with worker.properties:

The tomcat configuration will be same as above, Only the apache configuration would differ.

add the following configuration in httpd.conf.

LoadModule jk_module mod_jk.so
<IfModule mod_jk.c>
JkLogFile logs/mod_jk.log
JkLogLevel debug
JkShmFile logs/jk-runtime-status
JkWorkersFile conf/workers.properties

JkMount /context loadbalancer
JkMount /context/* loadbalancer
</IfModule>

In the worker.properties file, Add the following configuration:

worker.list=loadbalancerworker.tomcatroute1.port=9080worker.tomcatroute1.host=localhostworker.tomcatroute1.type=ajp13worker.tomcatroute1.lbfactor=1worker.tomcatroute2.port=9081worker.tomcatroute2.host=localhostworker.tomcatroute2.type=ajp13worker.tomcatroute2.lbfactor=1worker.loadbalancer.type=lbworker.loadbalancer.balanced_workers=tomcatroute1,tomcatroute2

Thursday, September 24, 2015

Caused by: java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;

Issue:

This error is seen when the JAX-WS libraries are missing.

Solution:

When deploying webservice project to the tomcat server, Tomcat do not implement the entire java EE sepcifications and it needs the JAX-WS libraries deployed to support the project.

add the jars in the endorsed directory.

By default the endorsed directory will be taken as $CATALINA_HOME/endorsed.

If you want to force use a different path, Use the following in the setenv.sh or the catalina.sh file.

-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS

Friday, September 11, 2015

PHP Fatal error: Call to undefined function mysqli_connect() in index.php on line 8

Situation: This error is seen when trying to start the Apache server after configuring the php files in the htdocs.

Indicators: This can be due to the following possible reasons.

-> The php module is not added in the httpd.conf.
-> The php5-mysql is not loaded.

Solution: Check on the server, if the php-mysql is loaded by using the following command.

yum list php-mysql

incase if the o/p as following:



This means that the package needs to be installed using the following command.

yum install php-mysql

Once done, Apache needs to be restarted and the above error will disappear from the logs.