Category Archives: windows

Scheduling a batch file every 10 seconds

Recently while investigating high cpu issues in an web application, I wanted to take thread dumps (through jstack) every 10 seconds. First thought was to schedule the batch file through a task scheduler, but I realized that with the task scheduler you cannot set a repetition interval lower then a minute.

An alternative approach would be to use a ping command in the batch file.

Read the rest of this entry

JMX Monitoring Support For Local Process On Windows

If you are monitoring a local jvm process using jconsole or jvisualvm and aren’t able to view the Threads tab on jvisualvm or connect to jconsole, this post should provide some troubleshooting information.

Any application that is started on the Java SE 6 platform will support the Attach API, and so will automatically be made available for local monitoring and management when needed. This out of box jmx support doesn’t work on Windows though. On Windows platforms, for security reasons, local monitoring and management is only supported if your default temporary directory is on a file system that allows the setting of permissions on files and directories (for example, on a New Technology File System (NTFS) file system). It is not supported on a File Allocation Table (FAT) file system, which provides insufficient access controls.

Read the rest of this entry

Commons HTTPClient 3.1 and 401 Unauthorized Error

Commons http client is a library provides the client-side implementation of most of the HTTP standards and recommendations. It is mainly used while building HTTP aware client applications such as web browsers, web service clients etc.

Recently while accessing the sql server reporting services, we faced an authentication error on one of the client environments. The stacktrace found was as below


2011-08-10 03:17:12,868 INFO  [http-8080-2](HTTPSender.java:192) - Unable to sendViaPost to url[http://machine-name/ReportServer/ReportService2005.asmx]
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)

Read the rest of this entry