Saturday, October 4, 2008

Glassfish: Application Deployment (Myfaces 1.1)

Deploy Application on Glassfish Server


Environment:

Myfaces

Hibernate

JSP

Servlet

Java

Version:1.1

myfaces-impl.jar,

myfaces-jsf-api.jar,

myfaces-extensions.jar)

Hibernate 3.0

Hibernate3.jar

1.2

2.1

1.5



Deployment:


1) Edit WEB-INF/web.xml

Remove the DOCTYPE declaration to avoid the WebXml java.sun.com connectionTimeout exception


2> Additional jars


+ Following standard jars required for hibernate and commons anm

- antlr-2.7.6rc1.jar

- asm.jar.jar

- asm-attrs.jar

- cglib-2.1.3.jar

- commons-discovery-0.4.jar (extra required by axis)

- commons-el.jar (required by hibernate)

- commons-pool-1.1.jar (required by hibernate)

- commons-validator.jar (required by myfaces - optional)

- jstl.jar


3) Copy log4j.properties to WEB-INF/classes



4) Add WEB-INF/sun-web.xml


<?xml version="1.0" encoding="UTF-8"?>


<!--

Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.

Use is subject to license terms.

-->


<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">

<sun-web-app>

<class-loader delegate="false"/>

<property name="useMyFaces" value="true"/>



5) add javax.faces to <glassfih>\lib\processLauncher.xml (2 places)

<sysproperty key="com.sun.enterprise.overrideablejavaxpackages"

value="javax.help,javax.portlet,javax.faces"/>


7) Add database driver jar to <glassfish>\lib (mysql-drivers.jar)


6) Workaround for "#{...} problem"

add following to the top of jsp


<%@ page isELIgnored ="true" %>

Permanent solution will be made available. Research is on.




1 comment:

Unknown said...

For Point 6 i.e #{...} not allowed in template text:
Solution
Edit web.xml add version attribute to web-app element
version="2.3"