2009/04/10

Glassfish+JSF 1.2+Facelets+RichFaces

Avoid java.lang.NoClassDefFoundError error

RichFaces has a "non documented" dependence of several apache commons libraries.
    Apache commons
  • commons collections (commons-collections-3.x.jar)

  • commons beanutils (commons-beanutils.jar)

  • commons digester (commons-digester-1.x.jar)

  • commons logging (commons-logging-1.x.jar, commons-logging-adapters-1.x.jar, commons-logging-api-1.x.jar)


ViewExpiredExceptions when using RichFaces with JSF 1.2
Don't even follow the link in RichFaces Developer Guide.

just add this to your web.xml
        

 <context-param>
<param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
<param-value>true</param-value>
</context-param>

2009/03/24

Glasfish Connection Pool using Sybase jConnect

copy jconn3.jar (or jconn2.jar) to $com.sun.aas.instanceRoot/domain_name/lib

configure Connection Pool

Datasource Classname: com.sybase.jdbc3.jdbc.SybDataSource
(or com.sybase.jdbc2.jdbc.SybDataSource if you are using jconn2.jar)
Resource Type: javax.sql.DataSource

Configure Additional Properties
databaseName
dataSourceName
password
portNumber
serverName
user

And guess what you got if there is more than one database running on server...
WARNING|glassfish|javax.enterprise.resource.resourceadapter_...
Connection could not be allocated because: JZ00L: Login failed.

After a bit investigating i found that it tries to connect to first database started at server. databaseName seems to be ignored.

Solution
Additional Properties -> Add
ServiceName : your database name here

Optionally you can add
BE_AS_JDBC_COMPLIANT_AS_POSSIBLE – true
FAKE_METADATA – true

UPDATE 2008/04/10
Newer versions of glassfish recognize properties from driver so you will end with ~150+ properties when creating new pool