views:

31

answers:

1

I am trying to compile and run WebDav example project supplied as part of examples of Apache Wink project. I have successfully deployed the project into JBoss and can reach it throw http. However, when i try to use Total Commander with WebDav plug in, i get the following exception:

15:13:41,595 ERROR [[restSdkService]] Servlet.service() for servlet restSdkService threw exception java.io.UnsupportedEncodingException: "utf-8" at java.lang.StringCoding.decode(StringCoding.java:170) at java.lang.String.(String.java:443) at java.lang.String.(String.java:515)
etc...

Using windows WebDav network folders, produces no results at all. Jboss server version 5.1.0 GA.

Does anybody succeeded in running this example using WebDav client?

A: 

I believe that the encoding name should be uppercase; i.e. "UTF-8".

Stephen C
Yep, I also though of that and changed it in the debbuger, however the result was same exception only with uppercase "UTF-8".
Oleg
That is really weird. What does `Charset.isSupported("UTF-8")` give you?
Stephen C
The canonical name for UTF-8 in `java.io` and `java.lang` is "UTF8". However, I haven't come across a JRE implementation that didn't accept "UTF-8" as an alias.
McDowell
@McDowell - are you sure about that? See the list of standard names in http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html
Stephen C
@Stephen C - `java.nio` uses a different set of canonical names (from the IANA list); the APIs that predate `java.nio` do not. See http://java.sun.com/javase/6/docs/technotes/guides/intl/encoding.doc.html
McDowell
Ok, this is really strange, but when i use Total Commander's WebDav plugin, i get this exception. Using Windows WebDav folders, i succeed in getting to the point where i can see the list of files. I would like to see the HTTP headers to compare them, but unfortunately Feddler2 can't capture them. Can you suggest the way to see it? In Java debug it all seems to be very bulky and complicated... thanks.
Oleg
@Oleg - I don't know much about Wink, but you can probably dump the HTTP headers with a servlet filter: http://download.oracle.com/docs/cd/E17477_01/javaee/5/tutorial/doc/bnagb.html I'd suggest Wireshark, but I believe it is limited on Windows if you're using loopbacks.
McDowell
@StephenC _Charset.isSupported("UTF-8")_ gives true in expressions, but while debugging i can't see any of the variables values and get an exception. @McDowell - thanks, i will try that.
Oleg