Skip to main content

Mixed contexts in EAR ?

5 replies [Last post]
rafaeltc
Offline
Joined: 2010-05-25

Hello everybody!
I have 3 applications: 2 web modules and 1 EJB module, inside a EAR.

describing the apps:
WebApp1 - jsf 1.2 + facelets + richfaces + postgres
WebApp2 - jsf 1.2 + facelets + richfaces + postgres + pretty-faces

both use the EJB module for accessing data and the business logic.

PROBLEM:

only WebApp2 uses the pretty-faces which has a filter (PrettyFilter) mapped in its web.xml. However, when I try to access the WebApp1, it asks for this filter and throws nullPointerException. Also, it "breaks" some styles (CSS) in WebApp1. PS.: WebApp2 loads successfully.

Does anyone know what is happening? I'm stuck in this issue for weeks and I do not know what to do anymore.

I've tried removing the framework and both apps loaded. But WebApp1 still got the css issue. When I remove the WebApp2 it loads OK.

I've created another web app (WebApp3) and added it to EAR in place of WebApp2, and the problem appear again.

It's like GlashFish is mixing the root contexts...

I am using GlashFish v2

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rafaeltc
Offline
Joined: 2010-05-25

I could "fix" the CSS issue putting the same version of RichFaces in both applications. However, it still asks for the filter.
This is weird.

I wonder if a lib is causing that.

swchan2
Offline
Joined: 2005-03-29

I have tried a simple ear file containing two simple war files. It is working fine for me.
Do you specify the context-root in application.xml?

rafaeltc
Offline
Joined: 2010-05-25

That's the issue.
I've created new projects and they work fine.
But I need to put the web app that i am creating, with another webapp which is already running.
When I put both together in a EAR. I get those issues.

It's like they are sharing the contexts.

I'd like to know if there is any kind of configuration settings that can make it possible; because this is really strange.

And yes, I've specified the context-root in application.xml.



EARApp


WebApp1.war
WebApp1




WebApp2.war
WebApp2



EJB.jar

swchan2
Offline
Joined: 2005-03-29

Can you show us a snapshot of web.xml related to PrettyFilter?

rafaeltc
Offline
Joined: 2010-05-25

Do you mean the filter-mapping?


Pretty Filter
com.ocpsoft.pretty.PrettyFilter


Pretty Filter
/*
REQUEST
FORWARD
ERROR