I'm not sure how to check that but I don't think the URI has any
spaces and it can't be empty. After all, the file Was saved to the
action without problems (at least the setFile method was executed and
others after that).

And this can't be about that specific file, since I've used that file
in testing earlier when I was using Struts 1 and then the uploading of
the file worked. It can't be that Struts 2 is worse than Struts 1 at
file uploading, can it?

What other reasons could there be for this error?

/Ylva

On Tue, Aug 12, 2008 at 6:49 PM, Jim Kiley <[EMAIL PROTECTED]> wrote:
> The javadoc for java.io.File mentions a constructor that accepts a URI as
> its parameter.  It has the following note:
>
> uri - An absolute, hierarchical URI with a scheme equal to "file", a
> non-empty path component, and undefined authority, query, and fragment
> components
>
> So:
> * Does the URI's path have any spaces in it?
> * Is the URI's path empty?
>
> jk
>
> On Tue, Aug 12, 2008 at 12:41 PM, Ylva Degerfeldt <[EMAIL PROTECTED]
>> wrote:
>
>> Hi,
>>
>> I'm trying to upload a file (and some text values) from a
>> multipart/form-data form. I'm also trying to use the validation
>> framework (I have created a -validation.xml file) but when the action
>> is receiving the values I get this exception:
>>
>> Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
>>        at java.io.File.<init>(File.java:363)
>>        at
>> com.opensymphony.xwork2.validator.ValidatorFactory.parseValidators(ValidatorFactory.java:323)...
>>
>> I'm not sure if this is a validation error or a file uploading error.
>> But I can tell you this:
>> My action that is called by the multipart form (NameAndCvAction) has
>> get and set methods for some text values from the form, for the file
>> (like ...setCvFile(File cvFile)  ) and for the filename. I've tried
>> stepping through these methods and I found that the file is received
>> in the setCvFile method, like a File object, the way it should..
>> The filename is correctly instantiated too..
>> After that I receive the value of a text field, called firstName (not
>> empty) which works..
>> Then I receive the last value, lastName (which in my test case is
>> empty) and that seems to work.
>> But then my HibernateSessionRequestFilter (meant to close the
>> Hibernate session for every request) is called and does the closing of
>> the Hibernate session.
>> After that I get the error.
>>
>> I also have a validate() method in my action but I don't seem to get that
>> far.
>>
>> This is not a Hibernate issue or is it?
>>
>> Is there anyone who can give me a hint at what this error is about?
>> I'd be very grateful!
>>
>> /Ylva
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to