Skip to main content

A little checklist JBoss->Glassfish

No replies
tashtego
Offline
Joined: 2009-05-12

My app includes JPA, EJB3, JSF and RichFaces. If you´rs is about the same, you will possibly have to take care of the following things when moving your app from JBoss 5 to Glassfish v2:

- Create a domain (asadmin > create-domain --adminport 4848 yourapp)
- Copy postgres/mysql...whatever jdbc.jar to yourdomain\lib\ext
(if using postgres, use JDBC4)
- Create a conectionPool in JSF admin dialogue from Glassfish (try the ping!)
- Create a JDBC connection using your connectionPool (jdbc/yourapp)
- If using log4j, include a log4j.dtd and log4j.xml* in your app (JBoss didnt need it, Glassfish does)
- Change your lookups to looking up the Remote interfaces or use @EJB as dependency injection
- Edit your persistence.xml like mentioned a bit later...
- If you used @mappedsuperclass, remove the annotation and change to @Entity, because its buggy in Toplink
- Correct your ejbqueries, if compiler complaints about it. Hibernate takes it a bit easier to handle them. Correct query is i.E.: SELECT entity FROM ENTITY entity...
- Drop your schema possibly generated in JBoss/Hibernate and let it be generated through Toplink

* = not needed in JBoss because of its default jar files included to the server

There is no "datasource" needed , the connection pool is the datasource. There is also no jndi.properties needed and no includation of appserv-rt.jar...

Persistence.xml:

</p>
<p>		oracle.toplink.essentials.PersistenceProvider<br />
		jdbc/yourappdb<br />
		false</p>
<p>		org.hibernate.ejb.HibernatePersistence<br />
		java:/yourappdb</p>
<p>

Thats it. My app works. Only have to change in persistence.xml and my lookup method when changing from JBoss to Glassfish or back. Hope your app is running now, too Good luck ;)

Message was edited by: tashtego