users@glassfish.java.net

Re: Glassfish and ADF Faces

From: Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 29 Oct 2009 16:17:42 +0530

Rosario, Edwin wrote:
>
>
>
> 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=0f0254ec-cbb9-4060-a621-18ca5ff4d1af;|WebModule[/FusWebApp-ViewController-context-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:
>
I don't know very well how you can deploy ADF enabled apps in GF, but I
can imagine why admin console started behaving badly after you copied
some libraries to domain1/lib. Admin console is like any other app and
any jar placed in domain1/lib is visible to it as well. I think there
is some incompatibility etween what it expects and what you added. In
order to make some library available in the server and yet make them
available to some apps in an isolated manner is possible by doing this:

Move all your libraries out domain1/lib to domain1/applibs
Add an empty jar (say adf.jar) with a MANIFEST.MF that has following entry:
Class-Path: space-separated-list-of-all-jars-in-applibs

Now specify a dependency on this library while deploying your apps like
this:

asadmin deploy --library=adf.ajr foo.ear
asadmin deploy --library=adf.ajr bar.war

Only foo and bar will be sharing the library foo.jar. No other apps will
see this library.

Try this and let me know.

I also hope our JSF exerts will guide you how to use ADF in GlassFish.

Thanks,
Sahoo