myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "simon.kitching@chello.at" <simon.kitch...@chello.at>
Subject Re: myfaces 1.2.2 - Java Servlet 2.5 implementation doesnt work
Date Tue, 11 Mar 2008 09:43:09 GMT
markus.pfeiffer@procon.co.at schrieb:
>
> Hi!
>
> I use:
>
> myfaces-api 1.2.2
>
> myfaces-impl 1.2.2
>
> tomahawk 1.1.6
>
> jstl 1.2
>
> servlet-api 2.5
>
> tomcat 6
>
> sysdeo plugin for eclipse
>
> I need following:
>
>
> FacesContext fc = FacesContext./getCurrentInstance/();
>
> ServletContext sc = (ServletContext) fc.getExternalContext().getContext();
>
> FileInputStream propOutFile = *new*
> FileInputStream(sc.getRealPath(Globals./RULES_CONFIG_FILE/));
>
> But for “ServletContext” I need the servlet-api and if I include the
> JAR in my project, I always get an exception while starting the server:
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext
> addApplicationListener
>
> INFO: The listener
> "org.apache.myfaces.webapp.StartupServletContextListener" is already
> configured for this context. The duplicate definition has been ignored.
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext
> addApplicationListener
>
> INFO: The listener
> "org.apache.myfaces.webapp.StartupServletContextListener" is already
> configured for this context. The duplicate definition has been ignored.
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext filterStart
>
> SCHWERWIEGEND: Exception starting filter extensionsFilter
>
> _java.lang.ClassCastException_:
> org.apache.myfaces.webapp.filter.ExtensionsFilter cannot be cast to
> javax.servlet.Filter
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(_ApplicationFilterConfig.java:255_)
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(_ApplicationFilterConfig.java:397_)
>
> at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(_ApplicationFilterConfig.java:108_)
>
> at
> org.apache.catalina.core.StandardContext.filterStart(_StandardContext.java:3709_)
>
> at
> org.apache.catalina.core.StandardContext.start(_StandardContext.java:4356_)
>
> at org.apache.catalina.core.ContainerBase.start(_ContainerBase.java:1045_)
>
> at org.apache.catalina.core.StandardHost.start(_StandardHost.java:719_)
>
> at org.apache.catalina.core.ContainerBase.start(_ContainerBase.java:1045_)
>
> at
> org.apache.catalina.core.StandardEngine.start(_StandardEngine.java:443_)
>
> at
> org.apache.catalina.core.StandardService.start(_StandardService.java:516_)
>
> at
> org.apache.catalina.core.StandardServer.start(_StandardServer.java:710_)
>
> at org.apache.catalina.startup.Catalina.start(_Catalina.java:578_)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:39_)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_)
>
> at java.lang.reflect.Method.invoke(_Method.java:597_)
>
> at org.apache.catalina.startup.Bootstrap.start(_Bootstrap.java:288_)
>
> at org.apache.catalina.startup.Bootstrap.main(_Bootstrap.java:413_)
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext start
>
> SCHWERWIEGEND: Error filterStart
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext start
>
> SCHWERWIEGEND: Context [/TMCWeb] startup failed due to previous errors
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext
> addApplicationListener
>
> INFO: The listener "listeners.ContextListener" is already configured
> for this context. The duplicate definition has been ignored.
>
> 11.03.2008 10:01:50 org.apache.catalina.core.StandardContext
> addApplicationListener
>
> INFO: The listener "listeners.SessionListener" is already configured
> for this context. The duplicate definition has been ignored.
>
> 11.03.2008 10:01:50 org.apache.catalina.core.ApplicationContext log
>
> INFO: ContextListener: contextInitialized()
>
> 11.03.2008 10:01:50 org.apache.catalina.core.ApplicationContext log
>
> INFO: SessionListener: contextInitialized()
>
> 11.03.2008 10:01:51 org.apache.coyote.http11.Http11Protocol start
>
> INFO: Starting Coyote HTTP/1.1 on http-8080
>
> 11.03.2008 10:01:51 org.apache.jk.common.ChannelSocket init
>
> INFO: JK: ajp13 listening on /0.0.0.0:8009
>
> 11.03.2008 10:01:51 org.apache.jk.server.JkMain start
>
> INFO: Jk running ID=0 time=0/31 config=null
>
> 11.03.2008 10:01:51 org.apache.catalina.startup.Catalina start
>
> INFO: Server startup in 2102 ms
>
> Whats going wrong?
>
> Do I forgot a JAR?
>
Tomcat already provides the servlet-api.jar.

You do need this jar in your classpath when compiling. However you must
*not* include that in your .war file, as this means it is present twice,
and will cause these ClassCastException problems.

If you are using maven to build, then you should be specifying scope of
"provided" for the servlet-api.jar file.

Regards,
Simon


Mime
View raw message