These are my today experiences (really my today headaches) porting a couple of applications from GlassFish v1 running with JDK5 to GlassFish v2 running with JDK6.
The applications was developed with NetBeans 5 and consist of a couple of EJB modules and a couple of web applications using the VisualWebPack in the NetBeans 5 (JSF).
First, I downloaded and installed JDK6 and GlassFish v2.
Before deploying the application you must take into account that my JDBC driver in GF1 (running JDK5) was a JDBC3 PostgreSQL driver. This driver is compiled for JDK5, thus I need to download and install (in the GF2 server) the JDBC4 version (not completed yet).
Next, I have created some database resources using the JDBC4 drivers. This works but generates a lot of warnings when application runs. To avoid them you need to put this option in your resources JDBC30DataSource=true.
Finally I have developed the applications. I this step I found strange behaviors and some server crashing problems. After trying 1000 thing I found that the problem was in a hyperlink in a JSF page. For an unknown reason, changing the hyperlink by a button (mantaining the same action) resolve the problem.
If you are working, like me, with PostgreSQL I would like to point this link about sequences:
http://wiki.glassfish.java.net/Wiki.jsp?page=FaqPostgresSequences
Tuesday, January 22, 2008
Some notes on GlassFish v2, JDK6 and JDBC4 (PostgreSQL)
Thursday, November 29, 2007
Beyond the JPA and the possible cache problems
Yesterday I detect an strange behavior in a little JEE5 application: queried JPA data doesn't reflect the real state of the data when I was made changes on database through an external database client program.
Looking at google I found this very interesting post:
Understanding the cache of TopLink Essentials(GlassFish JPA)
Summarizing, the persistence provider, in this case TopLink maintains data in a session cache, maintaining it synchronized only if is modified through an EntityManager and it doesn't if you modify through an external tool. To avoid use the cache, with all its implication, you need to specify it explicitly.
Thursday, November 23, 2006
Glassfish and socket problems
I was trying use gnu.hylafax libraries (a libraries that implement the HylaFAX protocol, similar to the FTP) to comunicate with a HylaFAX server.
I had created an EJB module with a class containig all the necessary code. I had been tested it in a simple java application and works fine, but when I put it into the EJB class, it fails. See the post at: Hylafax connection into an EJB module to see the error.
To resume the error was in the socket implementation. Looking for help I saw that many people has the same problem, and the solution was to do (see Unable to launch the Java AppServer or Timeout waiting for domain1 to start):
- cd
\domains\domain1 - edit config\domain.xml
- search for elements like
- add
-Dcom.sun.enterprise.server.ss.ASQuickStartup=false - save the file.
Friday, October 06, 2006
Glassfish and PostgreSQL problems
If you are working with Glassfish v1_ur1_b14, PostgreSQL and NetBeans 5.5 probably you had experienced some dificulties with entity class.
(1) you develop the code.
(2) you compile and build your code (an .ear or .war file)
(3) you can't deploy your application :(, Glassfish says you there is an error (with a null desciption) but if you chech your app with the verifier utility it is right.
Well, here are acouple of links describing the problem (related with the @GeneratedValue annotation) and describing a solution: