Sep 22

If you’re Java process (eg. Tomcat) is running out of PermGen space then you can increase the available space with the following JVM command line option

-XX:MaxPermSize=512m

That would for example increase the amount of PermGen space to 512 MB.

written by objects \\ tags: , , , ,

Jul 18

The default logging configuration that ships with Tomcat 6.0 logs to both catalina.out and also a daily log catalina.yyyy-mm-dd.log. The daily log starts a new file everyday, but catalina.out just continues to grow until your disk fills up.

To make things worse if you want to purge catalina.out you need to restart tomcat to free up the disk space used as tomcat holds the file open.

To avoid this situation what you can do is remove the logging to catalina.out (by removing the handler). This can be achieved by editting conf/logging.properties and changing:

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

to

.handlers = 1catalina.org.apache.juli.FileHandler

written by objects \\ tags: , ,

Dec 07

There is a problem with the embedded Tomcat server used by GWT in Hosted Mode resulting in the status code in the response always being 200, and the location reference being null.

To workaround this bug you need to add a dummy entity to the response on the server side. This ensures the correct status code and location are received by the client.

On the server side:


getResponse().setStatus(Status.SUCCESS_CREATED, "Widget added");
getResponse().setLocationRef("/widgets/"+widget.getId());

// add the following workaround
getResponse().setEntity(
   new StringRepresentation(
      "http://helpdesk.objects.com.au/java/how-to-get-the-correct-status-and-location-from-response-when-using-restlet-and-gwt-in-hosted-mode"));

written by objects \\ tags: , , , ,