≡ Menu

JBoss

Top 4 Java Heap related issues and how to fix them

Java heap related issues can cause severe damage to your application that will directly result in poor end user experience. Care must be taken to tune the Heap related parameters that suit your application. Out of the box default parameters are not enough.

Quick overview:

Java Heap is the memory used by your application to create and store objects. You define the maximum memory that can be for the Heap by specifying ‘-Xmx<size>’ java command line option (Example: ‘-Xmx1024m‘, where m stands for Mega bytes). As your application runs, it will gradually fill up Heap. JVM periodically runs a process called ‘Garbage collection’ (GC) which will scan the heap and clear objects that are no longer referenced by your application.One cannot request Garbage Collection on demand. Only JVM can decide when to run GC.

Let me walk you through four of the most common Java Heap related issues and how to fix them.

Read More

When the user cannot access your web application and instead sees a generic (and ugly) ‘Page cannot be displayed’, the root cause could range from simple typo in the URL to having exhausted the Thread Pool in the Application Web Container. The key to resolving this type of problem is asking the right questions well in the beginning of troubleshooting.

pagecannotbedisplayed

Pull up your sleeves, here are the top 8 reasons for this problem.

Read More

Cannot add Jboss Windows Service

You are trying to add Jboss Windows Service i.e the Service that you can use to start/stop Jboss Application Server. Jboss comes with the command <JBOSS Home>/bin/service.bat to create the Windows Service.

service.bat install

You need to edit service.bat before you run the command above to suit your environment. Specifically, you should update the following lines:

SVCNAME

SVCDISP

SVCDESC

call run.bat <arguments>

Here is one issue you may encounter that can be mysterious. When you run service.bat install, you may not see the service installed. You may not see any errors from the command either.

The most probable cause of this issue is the SVCNAME could have ‘spaces’ in it. Make sure the SVCNAME does not have any spaces. You can use underscore.

WRONG: JBASSOASVC_SERVER_UAT_5 Member2

RIGHT: JBASSOASVC_SERVER_UAT_5_Member2

 

 

 

How to enable ssl debugging in Java ?

Dealing with SSL issues is no fun, especially when you have no debug logs and all you see is an ugly ‘Page Cannot be displayed’ in your browser.

Thankfully you can easily enable SSL debug on your Application to start seeing verbose logs that will clearly show the SSL handshake process. Here is how to do it:

Add the following JVM command line parameter and restart the Application Server:

-Djavax.net.debug=all

Note that since it is a Java System Property ( used by JSSE – Java Secure Sockets Extension), it will work on any JEE ApplicationServer such as WebSphere, WebLogic, Jboss, Tomcat etc.

How to do this in WebSphere ?

Depending on your WAS version, adding the above parameter is typically done by navigating to WAS Admin Console > Servers > Application Servers > YourServer > Process Management > Java Virtual Machine > Generic JVM arguments

The verbose logs will usually go to SystemOut.log

Note: If you are unable to update System Property via the java command line above for whatever reason, try OS level network packet monitoring tool first. Now what exactly are they? If you are running on Unix/Linux, try ‘snoop/tcpdump’. On windows, you are in luck – use Microsoft Network Monitor, a very powerful tool. You can also try wireshark (etheral) on Windows.