Total Pageviews

Friday, November 16, 2007

Changing HTTP Listener Port on Oracle Express 10g

The oracle installer does not give you the chance to change the port of the HTTP Listener. I installed my Oracle 10g Express Edition under Windows and my Tomcat Servlet Container already uses port 8080.
So I decided to change the port of the Oracle HTTP listener doing the following with SQLPlus:
C:\>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Sep 10 18:49:14 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> exec dbms_xdb.sethttpport(8081);

PL/SQL procedure successfully completed.

SQL>

Thursday, November 15, 2007

Professional looking Java Swing Look and Feel

Digging around for an improved Look and Feel of one of my Java Swing applications I stumbled across the Substance Look And Feel project on java.net.
These skins and themes are awesome. I have never seen a better looking UI like this. Go and check it out. You will be impressed!

Sunday, November 11, 2007

JBoss 4.2.x and JSF applications

I upgraded from JBoss 4.0.4.GA to 4.2.2.GA and was not able to successfully deploy a JSF application into the container.
Various error messages were thrown by the container, one of it telling to have a closer look into the JBoss Wiki to determine the cause of deployment failure when using JSF application.
The problem was, that my application is bundled the MyFaces API and Impl core packages but JBoss uses the java.net JSF implementation.
If you still would like to use the MyFaces implementation you have to add the following lines to your web.xml file:
<context-param>
     <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
     <param-value>true</param-value>
</context-param>
The full article is available under the following URL: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5AndMyFaces

Monday, November 05, 2007

Comparison of different Repository Managers

Deng Ching wrote a good blog entry about existing repository managers. Repository managers have become a big part in software development. Maven without a good organized and well structured repository would be useless. Besides Maven, repository managers can also be used by Ant or Ivy.
Please note that Deng Ching is a developer of Maven Archiva. So his comparison might be not as neutral as you might expect.

Saturday, October 27, 2007

WLAN on Ubuntu Gutsy Gibbon (7.10) with IPW3945 and WPA encryption

I updated from Feisty to Gutsy yesterday and had massive problems making an internet connection via wlan. My Acer Aspire 5650 has an Intel IPW3945 WLAN card and the kernel modules were loaded successfully without any errors. The restricted WLAN driver was listed as "in use" in Ubuntu's restriced driver manager, so I expected to have a working driver configuration.
Somehow I assumed it had something to do with the network manager. So I completely removed the Network Manager via
apt-get remove network-manager
and configured my wlan interface (using instructions from a german ubuntu forum) manually editing /etc/network/interfaces:
iface eth1 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto eth1
My wpa_supplicant.conf looks something like this:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1

network={
        ssid="YourWlanSSID"
#        scan_ssid=1
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk=YourPSK
}
Note: I am using WPA encryption for my WLAN.
You can test your wpa_supplicant configuration using the following command:
sudo wpa_supplicant -i eth1 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf -d
Option -i defines the network interface name of your WLAN card. Option -D declares the driver to use and option -c defines the wpa_supplicant configuration file.
After this I restarted my system and I got a working wlan connection to my Access Point.

Tuesday, October 23, 2007

Finding a JAR archive where a class belongs to

Ever wondered to which JAR archive a specific Java class belongs to? Sometimes you need this information, because your application server throws a ClassNotFoundException. This can be caused by a lib or another framework that instantiates classes dynamically at runtime using a Class.forName call.
The Jarminator is a tool which helps you browsing single or multiple JAR archives and may help you in finding the correct JAR archive which contains the missing class.

Monday, October 22, 2007

Check out Scott McKeon's album "Can't Take No More"

A friend of mine told me to lend an ear to Scott McKeon. Scott who?? I asked? Scott McKeon! Well, Scott McKeon is a British Blues guitarist who recently released his debut album "Can't Take No More". This album was produced by Jesse Davey - the former guitarist of "The Hoax".
So what is it all about? This album sure is a hammer! The more I listen to it, the more I like it! Scott has a style of his own and really hits the floor. He plays hard and loud and sometimes his tone reminds me of a man now buried in Austin, Texas. On the other hand there is his ability to play slow and soft. He's not the type of guitarist who tries to play as many notes as possible.
Well, what's the bottom line?
He has passion, a great technique and yes this man can sing!

Sunday, October 07, 2007

Installation of Canon Pixma 4300 under Debian Linux using CUPS

I bought a new printer (Canon Pixma 4300) and had a few problems installing it under Debian Linux. I found a very good installation instruction and I would like to share it with you.

Install necessary packages

sudo apt-get install alien libxml1 libpng3 libtiff4

Download original drivers

wget ftp://download.canon.jp/pub/driver/bj/linux/cnijfilter-common-2.70-1.i386.rpm
wget ftp://download.canon.jp/pub/driver/bj/linux/cnijfilter-ip4300-2.70-1.i386.rpm

Convert RPMs into Debian packages

sudo alien -d cnijfilter-common-2.70-1.i386.rpm
sudo alien -d cnijfilter-ip4300-2.70-1.i386.rpm --scripts
sudo dpkg -i nijfilter-common-2.70-1.i386.deb
sudo dpkg -i cnijfilter-ip4300-2.70-1.i386.deb

Create symlinks

sudo ln -s /usr/lib/libpng12.so.0 /usr/lib/libpng.so.2
sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3

Restart CUPS

sudo ldconfig
sudo /etc/init.d/cupsys restart

Saturday, October 06, 2007

New Stevie Ray Vaughan album coming in November

Epic/Legacy is going to release a new Stevie Ray Vaughan album on November 6th, 2007. This album features duets Stevie did with various artists. Some of the songs are album versions and some of it are live versions.
More info can be found at Epic/Legacy's official site: http://www.legacyrecordings.com/Stevie-Ray-Vaughan/Solos-Sessions-and-Encores.aspx
Another new release will appear also on November 6th, 2007: A new version of the "Pride And Joy" DVD containing more material (eg. the MTV Unplugged session) in better (5.1) sound mix. More info can be found here.

Using Drupal as new blog software

Since I am moving my complete homepage to Drupal I decided to quit using Serendipity as my blog software and use Drupal's blog module.
My old Blog, available under http://quebbemann.kicks-ass.net/serendipity, will not be updated anymore and will be removed soon. I migrated all entries to Drupal. So nothing is lost.

Wednesday, September 12, 2007

Spring, JPA and using managed datasources with Tomcat

I was struggling for a few weeks now to get managed datasources in Tomcat6 to work with Spring and JPA. Well, finally it seems I have found a solution (I cannot prove it, because I did not implement it yet, but it looks good to me so far).
I have found two blogs covering this issue you might want to check out:
  1. http://turgayzengin.blogspot.com/2007/09/multiple-persistence-units-with-spring.html
  2. http://asrijaffar.blogspot.com/2007/02/spring-jpa-tomcat.html

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.

Saturday, May 12, 2007

Running Confluence and Jira in the same JBoss AppServer


I recently wanted to get rid off several Standalone distributions of web applications hosted on my server at home. Each web application is using its own Tomcat Servlet container and is consuming memory and cpu due to the fact that each container is running in its own JVM.
Jira was already running on my JBoss 4.0.4GA instance and I wanted to deploy Confluence 2.5.1 in the same instance. It turns out to be not that easy, because there are a few problems with the classloading mechanism JBoss is using.
But after a few minutes I found the solution on Confluence great documentation site. The comments from Lindsay Smith and Gerald MacKenzie in this article gave me the hints about what to do to run both software products in a single JBoss instance.
Here we go (For a complete list of tasks for upgrading or installing Confluence take a look at Atlassians Homepage. The following steps describe only the procedure to build a Confluence WAR archive that is deployable in a JBoss container next to an existing JIRA WAR archive!):
  1. Unpack the new confluence WAR version in a directory called $NEW_CONFLUENCE_INSTALL_DIR
  2. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/classes/log4j.properties
  3. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/commons-logging.jar
  4. Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/log4j.jar
  5. Create the file $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/jboss-web.xml with the following content
     <?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE jboss-web PUBLIC-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">  
     <jboss-web>  
     <class-loading java2ClassLoadingCompliance="false">  
          <loader-repository>  
               com.example:loader=unique-archive-name         
               <loader-repository-config>  
                    java2ParentDelegation=false  
               </loader-repository-config>       
          </loader-repository>  
     </class-loading>  
     <context-root>/confluence</context-root>  
     </jboss-web>  
    
  6. Build the Confluence WAR archive using the build script.

Wednesday, April 18, 2007

Release of MAIDEA 1.2.3

This is a bugfix release.

Release Notes - MAIDEA
Version 1.2.3

Bug

  • [MAIDEA-58] - Maven process exits because of classpath error when using Maven version 2.0.6
This will be the last release of the plugin because it has moved
(together with the Maven Reloaded plugin) to the Mevenide project on
Codehaus. Information can be found at: http://mevenide.codehaus.org/m2-site/mevenide2-idea/

We hope to release a version of the plugin soon.

Friday, April 06, 2007

Resource filtering in Maven2 corrupts images in Jar archive

I had a very strange problem with the Maven2 resource filtering behaviour. I have a resource directory containing XML files and PNG images. Everytime I started to build a JAR archive of my project the images in there were corrupted.
It took me some time to identify the resource filtering as the source of the problem. My configuration filtered all files in that directory. So the images were filtered as well. If the resource plugin sees a filter token in a binary file which in configured to be filtered it replaces the token with the value.
So the solution is either to move the images to a different resource folder or use inclusions/exclusions on the filtered resource directory.
If you plan to just have a single resource directory your configuration of the resource filtering may look like this:




true
${basedir}/src/main/resources

**/*.jpg
**/*.gif
**/*.png



${basedir}/src/main/resources
false

**/*.jpg
**/*.gif
**/*.png




I found the solution in the user mailing list. The interesting posts are:
http://www.nabble.com/forum/ViewPost.jtp?post=4231228&framed=y&skin=177
and this one:
http://www.nabble.com/forum/ViewPost.jtp?post=4231635&framed=y&skin=177

Sunday, April 01, 2007

Maven 2.0.6 released

The Maven Team released Version 2.0.6 of their software today, on April 1st. Let's hope it's not an April fool's joke ;-)

Friday, March 23, 2007

Do you like Dilbert?

Then you might want to check this out:
http://www.dotnetpowered.com/dailydilbertservice/dailydilbert.axd
This link gives you a daily update of the famous Dilbert comics. You can simply embed this URL in your website.


What is needed to run a X Server on Debian Linux

Today I installed a Debian (etch) system from scratch and wanted to start a X server... hm ... no X server on a fresh installation. So what packages do I have to install to get a X server running on my system?

apt-get install x11-common xserver-xorg-core xserver-xorg xfonts-base xterm

If you prefer a small and fast window manager and no desktop like KDE or Gnome try out enlightenment.

apt-get install enlightenment

Gary Moore will release new album on May 21st, 2007

Gary Moore is going to release a new Blues album in May 2007 containing a mix of Blues originals and self composed songs.
If you are interested check out this article on one of the best Gary Moore fan club sites out there. That page is not the official Gary Moore homepage!

Wednesday, March 21, 2007


In case you are using Trillian 3 Pro and want to chat with people using GoogleTalk you can configure this in Trillian via the Jabber plugin. First you have to activate the Jabber plugin (in case it is deactivated) and then go to "Connections->Manage My Connections->Add New Connection".
Choose Jabber and enter your Gmail account details: This is your complete email address, e.g. john.doe@gmail.com and your password.
After this click on Change ... and fill in the values shown in the following screenshot:




Sunday, March 18, 2007

Running Confluence behind Apache2

I decided to run my personal Confluence installation behind the Apache2 server running on my Debian Linux box using the mod_proxy configuration. I followed the instructions on Atlassians documentation pages (When using Debian it is described in the Jira docs) but ran into a problem afterwards.
Confluence was not accessible and I received a "Permission Denied" error when accessing confluence over HTTP (http://quebbemann.kicks-ass.net/confluence/).
The solution was to enable the Apache module proxy_http:
a2enmod proxy_http
After a Apache restart everything worked as expected!


Saturday, March 17, 2007

Open Source Monitoring Software

Ever heard of Hyperic (http://www.hyperic.com/)? Well, I would not be surprised if you haven't. I stumbled across this free and easy to use software a few days ago when I was searching a for a monitoring software to monitor my JBoss and Tomcat servers.
This software is able to monitor nearly everything (Application Servers, Databases, Servers, Networks, etc.) and comes free of charge. It's well designed using a JBoss Application server and written entirely in Java.
All you have to do is to install the small agent on the machine you want to monitor and install the server software to gather all informations. The GUI is completely available as a web frontend so every administrator in your company's internet can monitor the servers without installing additional software on their clients.

Linux IMAP Server using Postfix and Procmail

I switched from POP3 to IMAP on my Debian Linux box and had some problems setting up my local delivery transport using Postfix and Procmail. I use Dovecot as my IMAP server and I decided to move from mbox format to Maildir.
To make this happen I had to tell Postfix that I now use Maildir instead of mbox. Just add the following line in /etc/postfix/main.cf:
home_mailbox = Maildir/
Now you have to tell Procmail to use Maildir instead of mbox. To do this, create a file called .procmailrc in your users home directory and add the following line:
DEFAULT=$HOME/Maildir/
Now all my problems are gone and I have a working IMAP system using:
  • Dovecot (IMAP Server)
  • Postfix (MTA)
  • Procmail (LDA)

Monday, February 26, 2007

Run IntelliJ IDEA 6 with JDK6

If you want to boost your IDEA startup performance and the loading of your projects try to run IDEA with JDK6. There is an entry in Jetbrains support forum describing this under
http://support.jetbrains.com/kb/entry.jspa?externalID=222&categoryID=4
It really kicks asses!
But be aware: Please note that running IDEA under JDK 1.6 is not officially supported yet

Friday, February 23, 2007

How to install a Perl module on Debian Linux

Just in case you want to install Perl modules on a Debian Linux system:

Search for modules Tk and Curses:

apt-cache search Tk | grep perl
apt-cache search Curses | grep perl


Install the found packages:

apt-get install perl-tk
apt-get install libcurses-perl


List all Perl modules:

dpkg -l 'lib*-perl'


or:

egrep '^Package: lib[a-z-]+-perl' /var/lib/dpkg/available

Thursday, February 15, 2007

MAIDEA moving to Mevenide project

MAIDEA, a plugin that integrates the Maven2 build functionality into IntelliJ IDEA, is moving into the Mevenide project hosted on Codehaus.

The goal is to provide one plugin that supports all aspects of Maven's functionality (e.g. dependency management, repo browsing, running builds, etc.).
The code base of the Mevenide2 IDEA plugin will consist of the formerly known Maven Reloaded plugin and MAIDEA.

Wednesday, February 14, 2007

Maven 2.0.5 released

The Maven team released version 2.0.5 of their software today. Checkout the release notes at: http://maven.apache.org/release-notes.html

Sunday, February 11, 2007

Dependency Management and package architecture in Java programs


When using Maven you get a lot of reports out of the box. Version control reports, code quality reports, javadocs, etc.
This blog entry focuses on code quality reports, especially on the JDepend report and other ways of measuring and controlling code quality.

Why is dependency management so important?

This is a question that will arise sooner or later in almost every software project. Good dependency management is the key to maintainable software. In conjunction with well designed package architecture the dependency management will save lots of time and money when it comes to maintain and take care of a released software.
Maven enforces you to think about your project artifacts and dependencies before you start to implement your software. Because it follows the principle: One artifact per Maven project. Thus you are able to separate different tiers of your software into small artifacts which can be compiled, tested and released independently of the release of the full software system.
Think of a web enterprise application bundled in an EAR archive. The application usually consists of several artifacts:
  • Foundation JAR archive(s)
  • EJB JAR archive(s)
  • Web application archive (WAR)
Every artifact can be tested independently from the others. Of course integration tests are often necessary to make sure the whole thing is still working. But it lets you concentrate on one point of your software system.
Things that must be avoided at any time are cyclic dependencies between those artifacts. For example, a method from an EJB JAR calls a method from a foundation JAR, and another method from the same foundation JAR calls an EJB JAR method. This would produce a cycle between the foundation tier and the EJB (Business Logic) tier. Maven is able to detect cycles and refuses to compile a project that contains cycles.
Even harder to detect are cycles between vertical slices in the same tier or cycles between logical layers of a physical artifact. Those cycles can be detected using JDepend. But JDepend is very limited and a System Architect is not able to define a logical architecture which can be controlled and oberved through the complete life of a software system. In this case you might want to consider the use of SonarJ or Sotograph. Why using a software to detect cycles? Because it is almost impossible for a human to see when a cycle creeps in!
Maven enforces you to keep an eye on your software design by providing a JDepend report out of the box. With JDepend you can control the couplings between packages and the stability or instability of particular packages or even cyclic dependencies between packages in your artifact.
If this is not enough for you and you would like to be able to define an architecture which can be controlled and observed by a Software Architect and/or the Software Developers have a closer look at the above mentioned SonarJ. It is recommend for middle-sized or big-sized software projects and can easily help you in maintaining and controlling your software design.
With SonarJ it is easily possible to declare allowed dependencies and directions between logical layers and vertical slices and to see when those dependencies or access directions are violated.

Thursday, February 08, 2007

Timer problems in JBoss with TimerBeans


Since I updated to JBoss 4.0.4.GA I randomly receive the following execption in one of my applications:


23:22:19,812 ERROR [TimerServiceImpl] Cannot create txtimer
java.lang.IllegalStateException: Unable to persist timer
at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
Caused by: java.sql.SQLException: Unique
constraint violation: in
statement [insert into TIMERS
(TIMERID,TARGETID,INITIALDATE,TIMERINTERVAL,INSTANCEPK,INFO) values
(?,?,?,?,?,?)]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
at



It turns out to be a problem with a TimerBean.
A solution is described in the JBoss JIRA: http://jira.jboss.com/jira/browse/JBAS-3380
To make is short:
The "localDB.script" file ($JBOSS_INSTALL_DIR/server/default/data/hypersonic) must be cleaned up by deleting all (or the particular) timer entries (INSERT INTO TIMERS ...). Those entries are inserted by JBoss and represent timers which should be executed after a server crash. Unfortunately the ID generator for inserting unique timer ids doesn't generate unique ids :-(

Saturday, February 03, 2007

Creating a SSL-certificate for a server


If someone is in need of 
creating SSL certificates for his 
server (eg. at home), he might find
the following script very helpful.

#!/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

 
Update: There is a short way in generating a new SSL certificate for your home box:
sudo make-ssl-cert generate-default-snakeoil --force-overwrite
This works on my Ubuntu box.

Wednesday, January 24, 2007

Release of IntelliJ IDEA Maven-2 Integration plugin 1.2.2

This is a bugfix release. The issue tracker is now hosted on JetBrains official JIRA site.

Release Notes - Maven-2 Integration
Version 1.2.2

Bug

  • [MAIDEA-46] - Multiple values (separated with spaces) in MAVEN_OPTS env variable causes build
  • [MAIDEA-47] - No possibility to declare JVM options (eg. -Xmx128m)

New Feature

  • [MAIDEA-48] - Add "site" phase to list of filtered phases

Release of IntelliJ IDEA Maven-2 Integration plugin 1.2.1

Well, the child now has a name: MAIDEA

Release Notes - MAIDEA - IntelliJ IDEA Maven-2 Plugin - Version 1.2.1

Bug

  • Environment errror when executiong jetty:run goal
  • InvalidDataException when settings.xml contains reference to settings XSD

Improvement

  • Provide better error handling (was: NullPointerException when running any phase)
  • Maven options should be assignable for each POM
  • Integrate Maven Embedder (don't require a preinstalled Maven)

New Feature

  • Show/Edit Maven options in tool window
  • Show/Edit Maven command line options in tool window
  • Provide "Open POM" popup menu entry in Tool Window when POM is selected
  • Allow opening of POMs with double click on POM in Tool Window
  • Have option to filter out uncommonly used phases

Task

  • Update Build documentation