Skip navigation

When i was developing an application for a large group of users it is a question how it performs in real production situations.

To measure it i found a very nice tool. It is AppDynamics and it has a lite version witch is free for downloading and using it !!!  ( http://www.appdynamics.com http://www.codecentric.nl )

When i downloaded it doesn't work when i followed the manual. I can measure my Eclipse an SoapUI but not my JBoss 7.0.2

Finaly it works with a little configuration :

 

- unzip AppDynamicsLite.zip and all zips in it in the directory /opt/java/AppDynamicsLite

- Go to your JBoss directory and edit standalone.conf

Add the following line to it :

# APPDynamics

JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/java/AppDynamicsLite/javaagent.jar -Djboss.modules.system.pkgs=com.singularity"

 

After that you can start JBoss ( standalone ) and the AppDynamicsLite tool to measure and improve your application.

 

 

 


 

I am working with JAX-RS webservices.

When an unexpected occures in the application the webservice must not expose the error to the users of the webservices.

Therefore i made an exceptionhandler fot cathing al unsigned an signed exceptions.

When an error occures the server respose nice with error message 500 conform the HTTP 1.1 protocol

 

 

package com.narrowconnect.prototype.webservices;

 

import java.util.Date;

 

import javax.ws.rs.core.Response;

import javax.ws.rs.core.Response.ResponseBuilder;

import javax.ws.rs.ext.ExceptionMapper;

import javax.ws.rs.ext.Provider;

 

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

 

/**

* Class die de foutafhandeling regelt.

* Alle fouten worden opgevangen en

*

* @author jeroen

*

*/

@Provider

public class ExceptionHandling implements ExceptionMapper<Exception> {

 

    Logger logger = LoggerFactory.getLogger(ExceptionHandling.class);

   

    /* (non-Javadoc)

     * @see javax.ws.rs.ext.ExceptionMapper#toResponse(java.lang.Throwable)

     */

    @Override

    public Response toResponse(Exception arg0) {

       

        logger.error(arg0.getLocalizedMessage());

       

        ResponseBuilder builder = Response.serverError();

        builder.lastModified(new Date());

        builder.entity("Server Error, A server error occurred.");

        return builder.build();

    }

 

}

Filter Blog