users@glassfish.java.net

Glassfish and ADF Faces

From: Rosario, Edwin <ERosario_at_gcb.nv.gov>
Date: Wed, 28 Oct 2009 14:16:24 -0700

Hello,

 

I want to start by saying that I enjoyed the web presentation on
Glassfish and MySql. I am convinced that this is a winning combination
and I look forward to working with them together. During the
presentation, I asked about interoperability between Oracle ADF Faces
and Glassfish. I was asked to email our story to this address. My
questions are at the end of this message.

 

We developed our last project using Netbeans 6.0.1. There were some
issues; however, we were able to overcome them. Woodstock had presented
several obstacles, so I was excited to learn that the next release of NB
would include IceFaces. Following our project, I downloaded and
installed NB 6.7 and soon discovered that the visual web development
editor was no longer available. This was not going to work for us as we
are a small shop responsible for serving a large customer base, so we
moved to JDeveloper.

 

The ADF BC/Faces framework is great! Very rich. As I read through the
Oracle documentation, it indicated that ADF Faces can deploy to any Java
EE compliant middleware solution. They cite WebLogic, WebShere, JBoss
and Tomcat as examples. Glassfish is a Java EE compliant Application
Server so I began to search for a tutorial or forum with instructions
that would explain how to deploy an ADF Faces application to Glassfish.
I could not find one. I decided to download the ADF Faces Demo and
deploy the war file to Glassfish. The demo worked without a hitch.
Very cool.

 

Next, I created a very simple Fusion app connecting to a MySql database.
I created the EAR file and deployed to Glassfish. It would not work. I
figured that I might be missing some required library files. When I
found out how many, I decided to copy them to the
C:\Sun\SDK\domains\domain1\lib directory (common library) as opposed to
packaging them into my app. I then restarted the server and two things
occurred. The admin console would not deploy and I received the
following error:

 

[#|2009-10-28T12:15:37.453-0700|SEVERE|sun-appserver2.1|javax.enterprise
.system.container.web|_ThreadID=16;_ThreadName=Timer-7;_RequestID=0f0254
ec-cbb9-4060-a621-18ca5ff4d1af;|WebModule[/FusWebApp-ViewController-cont
ext-root]PWC1275: Exception sending context initialized event to
listener instance of class com.sun.faces.config.ConfigureListener

javax.faces.FacesException: Can't parse configuration file:
jar:file:/C:/Sun/SDK/domains/domain1/lib/adf-pageflow-impl.jar!/META-INF
/faces-config.xml: Error at line 2 column 71: cvc-elt.1: Cannot find the
declaration of element 'faces-config'.

                at
com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1438
)

                at
com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListe
ner.java:348)

                at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j
ava:4632)

                at
org.apache.catalina.core.StandardContext.start(StandardContext.java:5312
)

                at
com.sun.enterprise.web.WebModule.start(WebModule.java:353)

                at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:989)

                at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:973)

                at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:704)

                at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1627
)

                at
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1232
)

                at
com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebCon
tainer.java:1159)

                at
com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicati
onLoader.java:141)

                at
com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedAppli
cationLoader.java:134)

                at
com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:238)

                at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Applica
tionManager.java:336)

                at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Applica
tionManager.java:210)

                at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(Applica
tionManager.java:645)

                at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDe
ployEventListener(AdminEventMulticaster.java:959)

                at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDe
ployEvent(AdminEventMulticaster.java:943)

                at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminE
ventMulticaster.java:467)

                at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(Admi
nEventMulticaster.java:182)

                at
com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multic
astEvent(DeploymentNotificationHelper.java:308)

                at
com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEv
ent(DeploymentServiceUtils.java:231)

                at
com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEv
ent(ServerDeploymentTarget.java:298)

                at
com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(App
licationStartPhase.java:132)

                at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(Deplo
ymentPhase.java:108)

                at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(
PEDeploymentService.java:966)

                at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:280)

                at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeplo
ymentService.java:298)

                at
com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(Applicati
onsConfigMBean.java:584)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

                at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.j
ava:381)

                at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.j
ava:364)

                at
com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.j
ava:477)

                at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBea
nServerInterceptor.java:836)

                at
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)

                at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown
Source)

                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at
com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90
)

                at $Proxy1.invoke(Unknown Source)

                at
com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(Sunone
Interceptor.java:304)

                at
com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicIntercep
tor.java:174)

                at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentSe
rvice(AutoDeployer.java:583)

                at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployJavaEEArchiv
e(AutoDeployer.java:564)

                at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeploye
r.java:495)

                at
com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDepl
oyer.java:270)

                at
com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDe
ployTask.run(AutoDeployControllerImpl.java:374)

                at java.util.TimerThread.mainLoop(Timer.java:512)

                at java.util.TimerThread.run(Timer.java:462)

|#]

                             

I cannot find a way around this error so my application will not deploy.
Therefore, I can only assume that I am doing this incorrectly. So my
questions are: How would you deploy an ADF Faces application on
GlassFish v2.1? If this is not possible, then what solution would you
recommend for visual web development of rich Java Server Faces
applications?

 

Thank you in advance for your patience and assistance.

 

Ed Rosario

Programming Supervisor

Nevada State Gaming Control Board

(775) 684-7711

erosario_at_gcb.nv.gov