glassfish

Struts2 i18n where application default locale doesn't match app server locale

I have a struts2 (2.1.6) based webapp which has two languages - english and norwegian. The default language for the app is norwegian - the application server (glassfish 2.1) is running under the english locale.

It didn't seem to matter what value I passed in to the request_locale parameter - I always got english.

There are two language files:

  • global_messages.properties (norwegian)
  • global_messages_en.properties (english)

The struts constant struts.custom.i18n.resources was set to "global_messages" in struts.xml.

Hudson CI testing for grails from git

After running continuous integration with continuum for a long while (which works great for maven projects) I decided to take a look at Hudson. It can also do maven - but seems to have a larger range of plugins available. Of interest to me was grails.

Installation

This was extremely simple - I just grabbed the hudson.war file from the hudson site and deployed it in a running glassfish.

LDAP configuration

Glassfish and Too many open files - monitoring with munin

One of the systems that can be used for monitoring trends on a system is munin. It turns out that adding a graph to munin is reasonably simple.

There is a good guide on the munin site.

So - I need a plugin that will return the number of open files.

lsof -u glassfish | wc -l

Increasing max number of open files for glassfish user on debian

My glassfish process kept dying with "Too many open files" in the log.

I'm not surprised that it has too many - it has quite a few large applications running - but how to increase this?

ulimit -n shows that the user has a default of 1024.

But ulimit -n 2048 gives -su: ulimit: open files: cannot modify limit: Operation not permitted

Some digging leads to /etc/security/limits.conf

Here we added:

Installing a CA signed certificate for glassfish

Instead of using a self-signed certificate with glassfish (see Creating new SSL keys with keytool for glassfish) - we want to use one that is signed by a certificate authority.

Based on http://blogs.sun.com/enterprisetechtips/entry/using_ssl_with_glassfish_v2

For this entire post - the keystore.jks file is the one found in the glassfish domain config - e.g. glassfish/domains/domain1/config/keystore.jks

Creating new SSL keys with keytool for glassfish

I needed to generate a new certificate for glassfish's admin pages.

Instead of using the normal OpenSSL self-signed certificate it was easier just to use the java keystore keytool

keytool -genkey -keyalg RSA -alias
<alias_referred_to_in_glassfish>
-keystore glassfish/domains/domain1/config/keystore.jks
-storepass changeit

Note the -keyalg RSA - keytool by default uses DSA and firefox 3.0 will not accept this even with an added security exception.

Migrating Jira and Confluence from Tomcat to Glassfish

I have had jira and confluence running under tomcat 5.5.23 (behind apache over AJP13/mod_jk) for a while now. The aim is to migrate them over to glassfish (behind the same apache but with mod_proxy).

Software versions:

  • Atlassian Jira 3.12.2
  • Atlassian Confluence 2.8.0
  • Apache Tomcat 5.5.23
  • Glassfish 2.1 build 39

First - some links I found useful:

Subscribe to RSS - glassfish