You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bailey Peng <ba...@yahoo.com> on 2007/04/25 01:51:14 UTC
Unable to setup MyFaces without jsf-api.jar and jsf-impl.jar
Hi all,
I'm new to JSF and would like a few pointers to get started. After downloading the examples, I saw no reference to jsf-api.jar and jsf-impl.jar in WEB-INF/lib, which is what the myfaces website tutorial suggests. However, I'm unable to use myfaces-api-1.1.5.jar and myfaces-impl-1.1.5.jar in my web application without jsf-api.jar and jsf-impl.jar. I'm currently using Eclipse with Tomcat 5.5.x integrated into the development environment. When jsf-api.jar and jsf-impl.jar are not in my WEB-INF/lib, starting Tomcat would get me this error:
pr 24, 2007 7:23:27 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3711)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
With both of them in WEB-INF/lib, I don't get any problems. What do I need to do to make this work solely with myfaces libraries?
Bailey
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Unable to setup MyFaces without jsf-api.jar and jsf-impl.jar
Posted by Simon Kitching <si...@rhe.co.nz>.
Just to clarify: "jsf-api.jar" and "jsf-impl.jar" are the Sun
implementation of JSF. You must EITHER use these (the Sun RI
implementation) OR the "myfaces-api.jar"/"myfaces-impl.jar" pair.
Mixing the Sun and MyFaces jars does not work.
J2EE appservers typically bundle one or the other implementation in
their "shared" dirs which can cause problems. If you're using an
appserver that bundles the Sun implementation then either:
(a) remove the sun jars and replace with the myfaces ones instead, or
(b) set "child first" classloading then put the myfaces jars into your
webapp so that they override the "shared" ones for that particular webapp.
Option (a) is the least error-prone...
And as Mike says the web.xml config stuff needs to refer to the right
implementation...
Regards,
Simon
Mike Kienenberger wrote:
> Remove the web.xml listener line pointing to the Sun JSF RI.
>
> It probably looks something like this:
>
> <listener>
> <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
> </listener>
>
> If there's no "<listener-class>com.sun.faces..." line in your web.xml
> file, that means you've somewhere got the JSF RI jar files in your
> classpath and it's picking up the listener entry from the jar file
> tld's listener configuration.
>
>
> On 4/24/07, Bailey Peng <ba...@yahoo.com> wrote:
>>
>> Hi all,
>>
>> I'm new to JSF and would like a few pointers to get started. After
>> downloading the examples, I saw no reference to jsf-api.jar and
>> jsf-impl.jar
>> in WEB-INF/lib, which is what the myfaces website tutorial suggests.
>> However, I'm unable to use myfaces-api-1.1.5.jar and
>> myfaces-impl-1.1.5.jar
>> in my web application without jsf-api.jar and jsf-impl.jar. I'm currently
>> using Eclipse with Tomcat 5.5.x integrated into the development
>> environment.
>> When jsf-api.jar and jsf-impl.jar are not in my WEB-INF/lib, starting
>> Tomcat
>> would get me this error:
>>
>> pr 24, 2007 7:23:27 PM
>> org.apache.catalina.core.StandardContext listenerStart
>> SEVERE: Error configuring application listener of class
>> com.sun.faces.config.ConfigureListener
>> java.lang.ClassNotFoundException:
>> com.sun.faces.config.ConfigureListener
>> at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)
>>
>> at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
>>
>> With both of them in WEB-INF/lib, I don't get any problems. What do I
>> need
>> to do to make this work solely with myfaces libraries?
>>
>> Bailey
Re: Unable to setup MyFaces without jsf-api.jar and jsf-impl.jar
Posted by Mike Kienenberger <mk...@gmail.com>.
Remove the web.xml listener line pointing to the Sun JSF RI.
It probably looks something like this:
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
If there's no "<listener-class>com.sun.faces..." line in your web.xml
file, that means you've somewhere got the JSF RI jar files in your
classpath and it's picking up the listener entry from the jar file
tld's listener configuration.
On 4/24/07, Bailey Peng <ba...@yahoo.com> wrote:
>
> Hi all,
>
> I'm new to JSF and would like a few pointers to get started. After
> downloading the examples, I saw no reference to jsf-api.jar and jsf-impl.jar
> in WEB-INF/lib, which is what the myfaces website tutorial suggests.
> However, I'm unable to use myfaces-api-1.1.5.jar and myfaces-impl-1.1.5.jar
> in my web application without jsf-api.jar and jsf-impl.jar. I'm currently
> using Eclipse with Tomcat 5.5.x integrated into the development environment.
> When jsf-api.jar and jsf-impl.jar are not in my WEB-INF/lib, starting Tomcat
> would get me this error:
>
> pr 24, 2007 7:23:27 PM
> org.apache.catalina.core.StandardContext listenerStart
> SEVERE: Error configuring application listener of class
> com.sun.faces.config.ConfigureListener
> java.lang.ClassNotFoundException:
> com.sun.faces.config.ConfigureListener
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3711)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
> at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
> at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
> at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
> at
> org.apache.catalina.core.StandardService.start(StandardService.java:450)
> at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
> at
> org.apache.catalina.startup.Catalina.start(Catalina.java:551)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
> Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
> at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
>
> With both of them in WEB-INF/lib, I don't get any problems. What do I need
> to do to make this work solely with myfaces libraries?
>
> Bailey
>
> ________________________________
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.