Hi!

Perhaps these are some silly questions, but i struggled to get this 
File-uploader to work as well, and I sorted out some issues (not saying that 
you have these problems.)

- What version of myfaces' jars are you using?
At first I tried to use this with tomahawk.1.1.3.jar and myfaces-all.jar, but 
experienced problems since the extension filter class is included in both of 
them, resulting in that the class loader doesn't know which one to use, and you 
get a class not found exception. This also leads to another question:

- Are you sure that the extension filter class exist in only the tomahawk.jar?

- When upgrading from my-faces.1.1.1 to 1.1.3 they moved the Extension filter 
from org.apache.myfaces.component.html.util.ExtensionsFilter to 
org.apache.myfaces.webapp.filter.ExtensionsFilter.

Please check that org.apache.myfaces.component.html.util.ExtensionsFilter 
doesn't exist anymore.

This http://wiki.apache.org/myfaces/From_1%2e1%2e1_to_1%2e1%2e3_with_Jboss is a 
note I made when upgrading, perhaps you can get something useful out of it.

I also include some parts of my web.xml, as this what I have done to get it 
working, perhaps you have missed something. :)

------------------ WEB.XML ---------------------------------------------------


<filter>

        <filter-name>extensionsFilter</filter-name>

        
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <description>Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB
            </description>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>

        </init-param>
        <init-param>
            <description>Set the threshold size - files
                    below this limit are stored in memory, files above
                    this limit are stored on disk.

                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB
            </description>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>

    </filter>
    
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

<filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
    
    
    <filter-mapping>
     <filter-name>extensionsFilter</filter-name>
     <url-pattern>*.faces</url-pattern>
    </filter-mapping>   
    
     <filter-mapping>
     <filter-name>extensionsFilter</filter-name>
     <url-pattern>*.jsf</url-pattern>
    </filter-mapping>   
    
    <filter-mapping>
         <filter-name>extensionsFilter</filter-name>
          <url-pattern>*.jsp</url-pattern>
        </filter-mapping>
    
    <filter-mapping>
     <filter-name>extensionsFilter</filter-name>
     <url-pattern>/faces/*</url-pattern>
    </filter-mapping>     

  
    <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>1</load-on-startup>
    </servlet>
    
     <servlet>
        <servlet-name>SourceCodeServlet</servlet-name>
        
<servlet-class>org.apache.myfaces.shared_tomahawk.util.servlet.SourceCodeServlet</servlet-class>
        </servlet> 
   
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>



Regards, 

Eivind

-----Original Message-----
From: JBuilderDoug [mailto:[EMAIL PROTECTED] 
Sent: 21. september 2006 15:06
To: users@myfaces.apache.org
Subject: Re: tomahawk 1.1.3


I also added this to my faces-config.xml file


  <component>
    <component-type>org.apache.myfaces.HtmlInputFileUpload</component-type>
   
<component-class>org.apache.myfaces.custom.fileupload.HtmlInputFileUpload</component-class>
  </component>

with the effect that my exception message is now...



javax.servlet.ServletException
        at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:132)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)

The original first line...

 at
org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:297)

... is gone.

It still appears the ExtensionsFilter is not actually working.




Gert Vanthienen wrote:
> 
> L.S.,
> 
> Do you have a <context-param> with
> <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name> in your 
> web.xml?  If so, it probably contains an invalid class name.
> 
> Regards,
> 
> Gert Vanthienen
> [EMAIL PROTECTED]
> 
> JBuilderDoug wrote:
>> BTW, Here's a more definitive read on the error I'm getting when I 
>> try to submit the form
>>
>> root cause
>>
>> java.lang.NoClassDefFoundError
>>      at
>> org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance(AddResourceFactory.java:297)
>>      at
>> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(Extensions
>> Filter.java:123)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
>>      at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
>>      at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
>>      at
>> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
>> t.invokeNext(StandardPipeline.java:596)
>>
>>
>>
>> JBuilderDoug wrote:
>>   
>>> Has ANYONE been able to get tomahawk 1.1.3 inputFileUpload to work 
>>> properly?  I've tried in both JBuilder and JDeveloper without success.
>>>
>>> Here's what I've tried:
>>>
>>> 1) Configured libraries for tomahawk-1.1.3.jar and Framework for the t:
>>> taglib (The JBuilder IDE recognizes/displays the t: taglab elements 
>>> so does Oracle's JDeveloper)
>>> 2) Included this .jar with my project
>>> 3) Made the .jsp <h:form enctype="multipart/form-data"
>>> 4) Included in the .jsp
>>> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t" %>
>>> 5) Entered the <t:inputFileUpload statement.... />
>>> 6) in my backing bean 
>>>   a) import org.apache.myfaces.custom.fileupload.UploadedFile;
>>>   b) UploadedFile theFile
>>>   c) get and set methods for the File.
>>> 7) Placed the ExtensionsFilter in my web.xml file.
>>>
>>> <filter>
>>> <filter-name>MyFacesExtensionsFilter</filter-name>
>>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</fil
>>> ter-class>
>>> <init-param>
>>> <param-name>maxFileSize</param-name>
>>> <param-value>20m</param-value>
>>> <description>Set the size limit for uploaded files.
>>> Format: 10 - 10 bytes
>>> 10k - 10 KB
>>> 10m - 10 MB
>>> 1g - 1 GB
>>> </description>
>>> </init-param>
>>> </filter>
>>>
>>> <!-- extension mapping for adding <script/>, <link/>, and other 
>>> resource tags to JSF-pages --> <filter-mapping> 
>>> <filter-name>MyFacesExtensionsFilter</filter-name>
>>> <!-- servlet-name must match the name of your 
>>> javax.faces.webapp.FacesServlet entry --> <servlet-name>Faces 
>>> Servlet</servlet-name> </filter-mapping>
>>>
>>> <!-- extension mapping for serving page-independent resources 
>>> (javascript, stylesheets, images, etc.) --> <filter-mapping> 
>>> <filter-name>MyFacesExtensionsFilter</filter-name>
>>> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
>>> </filter-mapping>
>>>
>>> It all compiles and runs fine but when my page comes up and I enter 
>>> a file [Browse] and submit the form
>>>
>>> NoClassDefFoundError
>>>
>>> org.apache.myfaces.renderkit.html.util.AddResourceFactory.getInstance()...
>>> org.apache.myfaces.webapp.filter.ExtensionsFilder.doFilter
>>>
>>> I'm not getting any complaints from the IDE for syntax and there are 
>>> no errors in the build, but it appears that I'm not able to 
>>> instantiate the filter... at least that's what I'm reading from above.
>>>
>>>     
>>
>>   
> 
> 
> 

--
View this message in context: 
http://www.nabble.com/tomahawk-1.1.3-tf2307269.html#a6427664
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to