Total Pageviews

Monday, August 27, 2007

Tomcat not removing files when using undeploy task

I am using Tomcat 6.0.14 for a new project and Maven2 for build management. Recently I wanted to deploy and undeploy my webapp using the Maven2 cargo plugin. Deploy works fine, but undeploy does not remove all JARs in the webapp and work directory of my Tomcat installation.
This seems to be a general issue with the Tomcat Manager component. To avoid these problems simply put the following attributes into your context.xml

antiJARLocking="true"
antiResourceLocking="true"








Tuesday, August 07, 2007

Gathering System Information on Solaris

Sometimes it is necessary to gather informations about a Solaris system one is working on, but there is no guy around to tell you the details. Here are a few commands you might want to try.


Processors
The psrinfo utility displays processor information. When run in verbose mode, it lists the speed of each processor
and when the processor was last placed on-line (generally the time the system was started unless
it was manually taken off-line).


/usr/sbin/psrinfo -pv


Status of processor 1 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:09.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.
Status of processor 3 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:11.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.



RAM
The prtconf utility will display the system configuration, including the amount of physical memory.

To display the amount of RAM:
/usr/sbin/prtconf | grep Memory
Memory size: 3072 Megabytes

Monday, July 30, 2007

OpenOffice opens nfs files only in read-only mode on Linux

If you ever encounter the problem to open an OpenOffice document from a NFS file server and this document will be opened only in read-only mode try this fix:
  1. Locate the file /usr/lib/openoffice/program/soffice
  2. Comment out all lines containing the following code:
    export SAL_ENABLE_FILE_LOCKING

Note: I have experienced this problem under Ubuntu Linux (Feisty).


Continue reading "OpenOffice opens nfs files only in read-only mode on Linux"

Thursday, July 26, 2007

Howto configure SSL for Apache2

To enable SSL support in Apache2 the first step is to create a SSL certificate. If you are not among the lucky ones having apache2-ssl-certificate installed you can use the Linux shell script below to create a SSL certificate

#!/bin/bash
SERVER=your.server.com
PRIVATE_KEY=$SERVER.private.key
CERTIFICATE_FILE=$SERVER.crt
VALID_DAYS=365

echo Delete old private key
rm $PRIVATE_KEY
echo Create new private/public-keys without passphrase for server
openssl genrsa -out $PRIVATE_KEY 1024

echo Create selfsigned certificate
rm $CERTIFICATE_FILE
# From man req:
#  -x509
#    this option outputs a self signed certificate instead
#    of a certificate request. This is typically used to
#    generate a test certificate or a self signed root CA.
#    The extensions added to the certificate (if any) are
#    specified in the configuration file.

openssl req -new         -days $VALID_DAYS         -key $PRIVATE_KEY         -x509         -out $CERTIFICATE_FILE

echo private-keyfile is $PRIVATE_KEY
echo server-certificate-file is $CERTIFICATE_FILE

ls -l $PRIVATE_KEY $CERTIFICATE_FILE

The SERVER variable is very important. Please name your fully qualified server name there. After executing the script and answering the questions you've got two files: the certificate file (suffix .crt) and the key file (suffix .key).
Copy those two files into the directory /etc/apache2/ssl.
Now install the Apache2 ssl module: a2enmod ssl
The next step is to create a new virtual host for our https sites. Simply copy the default site to a new site called default-ssl:

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default-ssl


Replace the first two lines in the file with the following lines:

NameVirtualHost :443
:443>
# SSL (START)

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/my.apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/my.apache.key

SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
# SSL (ENDE)


After this edit the file /etc/apache2/ports.conf and add the following line:

Listen 443


The last thing is to enable the site calling a2ensite default-ssl
Finally restart your Apache2: /etc/init.d/apache2 restart

Tuesday, July 24, 2007

Javolution - Real-Time Java and Fastutil

Boost your application performance (in particular when using collections) with the Javolution API and the Fastutil API.

Java template engine - StringTemplate

I used to use Freemarker as my favorite template engine but I may switch to StringTemplate. The documentation looks very good and the architecture seems to be very clean (enforcing model-view separation).

Sunday, July 22, 2007

Discovering JSF tutorials

If you are interested in learning JSF or just want a quick overview over JSF features and available JSF tutorials have a look at this site: http://www.roseindia.net/jsf/.
Looks like a great collection of JSF tutorials.

Monday, July 09, 2007

Connecting to a Microsoft SQLServer Express 2005 database via JDBC

I discovered a few stepstones when connecting via JDBC to a locally installed SQLSever Express 2005 database. Here are my observations:
  • Activate "Accepting TCP/IP" connections in the SQL Server Configuration Manager. Otherwise the SQLServer Express database won't accept any JDBC connections. This option was disabled in my configuration. Also make sure to use a static TCP/IP port, otherwise (when choosing a dynamic) the port might change on every start of the SQLServer database.
  • When using Microsofts JDBC driver (not recommended) the following two steps should be considered:
  • Copy the file sqljdbc_auth.dll that is packaged within the JDBC driver archive to a location that is part of you PATH variable, e.g. c:/winnt/system32.
  • Open the Microsoft SQL Server Management Studio application and create a new database user account. Be careful not to choose an existing windows account name, but to create a new SQLServer account. Otherwise you might have a chance to run into an error when trying to login via JDBC. Possible error messages and their status codes are described under http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx.

Monday, June 25, 2007

Gnome Keyring without password

Everytime I login into my Ubuntu (Feisty) system the Gnome Keyring Manager asks for the password I already provided when logging into the system (via gdm).
This can be skipped by doing the following steps:
  1. apt-get install libpam-keyring
  2. Edit file /etc/pam.d/gdm and insert the following snippet

@include common-pamkeyring

Note: This does not work if you have enabled automatic or timed login!


Monday, May 28, 2007

MySQL Server only accessible from localhost

Yesterday I spent some time figuring out why my MySQL Server doesn't accept remote connections anymore. I was not able to connect from any other machines in my local network except from the machine running the server (localhost).
It turns out to be a problem in the MySQL configuration file. The option bind-address was set to 127.0.0.1, which means the server was only listening locally.
The solution is to comment out the "bind-address" line and restart the server. This may be a security risk, because the server is now accessible from any host.
I assume this modification in the MySQL config file was made during a Debian update process.