Am 19.10.10 06:27, schrieb Alan:
On Mon, Oct 18, 2010 at 12:53 PM, Jakob Korherr<[email protected]>wrote:
You need to have myfaces-api and myfaces-impl dependencies in your
project like this:
OK, thanks to Jakob's hints I got MyFaces-2 running under GlassFish. One
thing that is essential (I am putting it here for reference) is the format
of the sun-web.xml entry has to be:
<property name="useMyFaces" value="true"/>
Also you have to set:
<class-loader delegate="false"/>
I encountered something very disturbing when experimenting with this. In
many cases something actually over-writes the sun-web.xml file when I try to
run the application. It seems to happen somewhere in the deployment
process. I don't know if this is a bug in netbeans or the MyFaces servlet
is doing something. Has anyone else seen this?
Actually myfaces does not alter anything...
Another thing I discovered is that when using MyFaces, the CDI services no
longer work for managed beans. You have to use the
@java.faces.bean.ManagedBean annotation. The @javax.enterprise.inject.Model
annotation will not work. This is sort of a show-stopper for me since I
have a fair amount of code that uses CDI now and I read that the faces
annotations may end up deprecated. Is there any workaround on this or any
word if this is going to be fixed?
Ok I am doing a wild guessing here, maybe you have to add an el resolver
entry for weld, I assume weld/cdi comes from the container and since
myfaces is hosted in your ear, some kind of auto configuration which
otherwise would be picked up is not in this case, due to the
classloading order and different jar locations.
It might either resolve itself by adding weld to your application as
dependency or even better try to locate the el resolver entry and add it
to your faces-config.xml