facebook

[Closed] MyFaces 1.1.3 ExtensionsFilter missing

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #255617 Reply

    I am using Eclipse 3.2, MyEclipseIDE 5.0M2. Tomcat 5.5 is my container.

    When I deploy a web app with faces I get the following error when Tomcat starts:

    SCHWERWIEGEND: Exception starting filter MyFacesExtensionsFilter
    java.lang.ClassNotFoundException: org.apache.myfaces.component.html.util.ExtensionsFilter
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:211)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3563)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4133)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:910)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:873)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
    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:680)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
    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:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    27.07.2006 15:54:08 org.apache.catalina.core.StandardContext start
    SCHWERWIEGEND: Error filterStart
    27.07.2006 15:54:08 org.apache.catalina.core.StandardContext start
    SCHWERWIEGEND: Context [/JSF1] startup failed due to previous errors

    I use MyFaces 1.1.3! In the MyEclips configuration I changed the MyFaces 1.1 Libraries as follows:

    – Removed myfaces-all.jar
    – added myfaces-impl-1.1.3.jar and myfaces-core-1.1.3.jar

    the class org.apache.myfaces.component.html.util.ExtensionsFilter is part of myfaces-core-1.1.3.jar and gets correctly deployed. But somehow it looks like it would be missing in the classpath variable!

    Any idea what the problem could be?

    Tom

    #255670 Reply

    Riyad Kalla
    Member

    Tom,
    Good detailed report. First thing to check is to look at your deployed application folder under Tomcat/webapps directory. Check the WEB-INF/lib directory and see if the myfaces libraries are in there. For kicks, open them up and verify just for sanity sake that “org.apache.myfaces.component.html.util.ExtensionsFilter ” is in there.

    Now go into your TOmcat/common/lib folder and make sure there are not either more MyFaces libs or Sun-RI libs there, they shouldn’t be.

    #255703 Reply

    Riyad,

    Thanks a lot for your reply. I checked both and there seem to be no duplicates. With ‘correctly deployed’ I meant that the correct libs are copied to the lib dir of my Tomcat/webapps/JSF1 directory.

    Directory of C:\Apache\Tomcat5.5\webapps\JSF1\WEB-INF\lib

    27.07.2006 17:32 <DIR> .
    27.07.2006 17:32 <DIR> ..
    27.07.2006 17:32 188’671 commons-beanutils-1.7.0.jar
    27.07.2006 17:32 46’725 commons-codec-1.3.jar
    27.07.2006 17:32 559’366 commons-collections-3.1.jar
    27.07.2006 17:32 168’446 commons-digester-1.6.jar
    27.07.2006 17:32 112’341 commons-el-1.0.jar
    27.07.2006 17:32 207’723 commons-lang-2.1.jar
    27.07.2006 17:32 38’015 commons-logging-1.0.4.jar
    27.07.2006 17:32 16’923 jstl-1.1.0.jar
    27.07.2006 17:32 20’682 jstl.jar
    27.07.2006 17:32 252’043 myfaces-api-1.1.3.jar
    27.07.2006 17:32 524’026 myfaces-impl-1.1.3.jar
    27.07.2006 17:32 393’259 standard.jar
    12 File(s) 2’528’220 bytes
    2 Dir(s) 11’241’476’096 bytes free

    and

    Directory of C:\Apache\Tomcat5.5\common\lib

    22.12.2005 16:40 <DIR> .
    22.12.2005 16:40 <DIR> ..
    23.09.2005 15:42 112’341 commons-el.jar
    23.09.2005 15:42 1’204’569 jasper-compiler-jdt.jar
    23.09.2005 15:42 405’086 jasper-compiler.jar
    23.09.2005 15:42 76’698 jasper-runtime.jar
    23.09.2005 15:42 50’501 jsp-api.jar
    23.09.2005 15:42 154’109 naming-factory-dbcp.jar
    23.09.2005 15:42 36’341 naming-factory.jar
    23.09.2005 15:42 47’233 naming-resources.jar
    23.09.2005 15:42 97’701 servlet-api.jar
    9 File(s) 2’184’579 bytes
    2 Dir(s) 11’241’476’096 bytes free

    A temporary workaround is to comment out these filters. I do not know whether I do need them at all. I must say, that I am new to JSF, I am writing Struts apps for many years now, but I am looking for a better and faster way to write web apps. Thats why I am looking at JSF.

    Here is my web.xml where you can see the commented-out filters. With this configuration Tomcat and my WebApp starts. However this seems not to be a real solution to the problem but a cut in functionality!

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <!–
    <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>maxFileSize</param-name>
    <param-value>20m</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
    </filter-mapping>
    –>
    </web-app>

    Do you have any other idea, what the problem could be?? Do you know how I can find out, what the classpath of Tomcat is, when it is starting my webapp? ClassNotFoundException means that it does not find it even though it is in the WEB-INF\lib directory.

    Tom

    #255704 Reply

    Riyad,

    I think I found it! The package myfaces-api-1.1.3.jar does not contain a util package under javax.faces.component.html! It only has

    javax\faces\component\html !

    The interesting thing is, that when looking at the API doc at SUN, there is NO util sub-package either in Version 1.1 nor 1.2. Have a look at http://java.sun.com/javaee/javaserverfaces/reference/api/index.html

    I did some more research and looked at your original file ‘myfaces-all.jar’ which is in
    …\MyEclipse5.0M2\eclipse\plugins\com.genuitec.eclipse.jsf_4.9.200\data\1.1\MyFaces1.1\lib and there is also NO util sub-package either!

    So the question is definitely:

    – What are these filters ?
    – Who adds them to web.xml ?

    Just for your information: I did simply the exemple of your ‘JSF Quickstart’ which can be found in your Help File. I guess these filter entries are made in web.xml, when you add JSF capability to a project. Is this a bug in MyEclipse 5 ??

    Could you please check this? Thanks a lot!

    Tom

    #255715 Reply

    Riyad Kalla
    Member

    Tom,
    Ok I did some more testing. When you create your project and deploy it with MyEclipse using the version of MyFaces we ship, everything works fine. When you manually upgrade it to 1.1.3, the ExtensionFilter seems to no longer exsit in that download. I pulled that version of MyFaces apart in a separate directory and didn’t find that Filter ANYWHERE. So this looks like a simple case of incompatible libraries.

    I checked the other MyFaces libraries and it seems that this filter moved to the Tomahawk library and into the org.apache.webapp.filter package. So try grabbing that and adding it to your project and updating the class name in your web.xml file to the right one and see if it wokrs.

    #255728 Reply

    Hello Riyad,

    OK the solution is, that the missing library is in tomahawk. So I simply added the tomahawk-1.1.3.jar to my manual MyFaces 1.1.3 configuration. In version 1.1.3 of tomahawk the package names are identical which means org.apache.myfaces.component.html.util. No change in web.xml is required though.

    So if you like to integrate MyFaces 1.1.3 into MyEclipse5 GA it would only mean to integrate tomahawk-1.1.3.jar in your myfaces-all.jar.

    Thanks for your support!

    Tom

    #255736 Reply

    Riyad Kalla
    Member

    Tom,
    Thanks for the heads up. It seems there are two different ExtensionsFilter classes in that package now, but you are correct that the one with the same package is probably the right one.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [Closed] MyFaces 1.1.3 ExtensionsFilter missing

You must be logged in to post in the forum log in