Sunday, May 13, 2007

Interesting visitor statistic

It's very exciting for me that the visitor of this blog can be around the world like this. Enjoy it!

Fix AppFuse generated application that couldn't connect HSQLDB database

Step 1: Enable the hibernate show sql features. This for tracing which SQL have problem to execute. If the 1st one has problem, we can going on.

Step 2: Since, the original AppFuse 1.9.x is not well prepare for the HSQLDB. We need to prepare the table creation script for the HSQLDB. i.e., hsql-create.sql, in the metadata folder of the project generated by the AppFuse.


Step 3: Using command "ant db-prepare" or click it the "db-prepare" to execute it in the Ant view of the Eclipse.


Step 4: Using command "ant compile" or click the "compile" in the Ant view of Eclipse.

Step 5: Using command "and deploy-war" or click the "deploy-war" in the Ant view of Eclipse.

Saturday, May 12, 2007

java.net.BindException: Address already in use:8080

After several times to reload the deployed application in tomcat on Mac OSX. I found the tomcat fail to start with this exception messages.

2007/5/12 下午 01:17:44 org.apache.coyote.http11.Http11BaseProtocol start
嚴重的: Error starting endpoint
java.net.BindException: Address already in use:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:312)
at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:150)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:75)
at org.apache.catalina.connector.Connector.start(Connector.java:1089)
at org.apache.catalina.core.StandardService.start(StandardService.java:459)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2007/5/12 下午 01:17:44 org.apache.catalina.startup.Catalina start
嚴重的: Catalina.start:
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use:8080
at org.apache.catalina.connector.Connector.start(Connector.java:1096)
at org.apache.catalina.core.StandardService.start(StandardService.java:459)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2007/5/12 下午 01:17:44 org.apache.catalina.startup.Catalina start

It's obviously that there has another process occupied the port 8080 or 8009. I uses the command, "lsof -i | grep LISTEN" to check the PID of the process that using the port.

imachome:/usr/local/apache-tomcat-5.5.20/logs chanapps$ lsof -i | grep LISTEN
java 298 chanapps 11u IPv6 0x2e2e3a0 0t0 TCP *:http-alt (LISTEN)
java 298
chanapps 18u IPv6 0x2e2ec50 0t0 TCP *:8009 (LISTEN)

And then, kill the process with "kill -9 298" command. Now, the tomcat recover!

Tuesday, May 08, 2007

Eclipse plugins for HSQLDB

When I trying to compare and select between HSQLDB and Apache Derby as the database for my mini application.

I found the Apache Derby has an interesting Eclipse Plugins can help to start and stop the Derby easily.

It caused me going to check any similiar plugins for HSQLDB. Finally, i found a project in source forge web site. I'm exciting and start to try it. However, it disappointed me that the plugins seems couldn't be uses directly extract to the eclipse plugins directory.

I had to agree that i like HSQLDB much more than Derby (just feeling). So, I try to fix it and have this workable version even the official project site is not active since 2004.

This plugin is good and easy enough for development.

You can add nature of HSQLDB in your project by right click on the project and select "HSQLDB > Add Database Engine nature"


And then, start / stop the HSQLDB for your project by right click on the project like this.


If you are interesed about it, just following these procedures to install it in your Eclipse.

1. download it from here

2. cd to ECLIPSE_HOME/plugins/

3. extract the hsqldb eclipse plugins.zip contents in the directory. The "hsqldb.ui" and "hsqldb.core" directories should be extracted into the ECLIPSE_HOME/plugins/ direcotry, like this:

ECLIPSE_HOME/plugins/hsqldb.ui/
ECLIPSE_HOME/plugins/hsqldb.core/

And then, the next time you start Eclipse, everything should work.

XML Master Cert Group

Google Groups
XML Master Certification
Visit this group