Issue 93769 - Java based application not starting when special character in path
Summary: Java based application not starting when special character in path
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOO300m5
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: joerg.skottke
QA Contact: issues@framework
URL:
Keywords:
: 95162 (view as issue list)
Depends on:
Blocks:
 
Reported: 2008-09-11 12:58 UTC by Olaf Felka
Modified: 2009-03-20 11:27 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Olaf Felka 2008-09-11 12:58:26 UTC
- install OOo e.g. in c:\program files\büro\
- start File | Wizards | Letter
- nothing happens
- no Java based application will start in this case
Comment 1 Stephan Bergmann 2008-09-12 08:18:30 UTC
My understanding always was that Java interprets file URLs in "system encoding"
(what OOo calls osl_getThreadTextEncoding(); i.e., as "external" URLs in OOo's
jargon).  However, it appears that, at least on Windows, at least Java 5 and
later, at least in certain cases interprets file URLs in UTF-8:  The "ü" in the
filepath being represented as MS1252 "%FC" causes the JNI call to
ClassLoader.loadClass at stoc/source/javavm/javavm.cxx:1.78 l. 1769 to throw a

java.lang.IllegalArgumentException
	at sun.net.www.ParseUtil.decode(ParseUtil.java:185)
	at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:563)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:331)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:320)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:297)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:167)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

where sun.net.www.ParseUtil.decode obviously expects UTF-8.  This issue needs
further investigation.
Comment 2 milek_pl 2008-11-04 00:31:23 UTC
This is a possible duplicate of issue 95162.
Comment 3 Stephan Bergmann 2008-11-13 08:40:31 UTC
*** Issue 95162 has been marked as a duplicate of this issue. ***
Comment 4 Stephan Bergmann 2008-11-13 08:53:06 UTC
It appears that Java nowadays expects file URIs in UTF-8 (i.e., what OOo calls
"internal" URIs) instead of locale-specific encoding (i.e., what OOo calls
"external" URIs), see for example the section "Escaped octets, quotation,
encoding, and decoding" of
<http://java.sun.com/javase/6/docs/api/java/net/URI.html> and also
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6522294>.

That means that all places that map URIs between OOo and Java must no longer use
com.sun.star.uri.ExternalUriReferenceTranslator to do so.  Those places at least
include tags/DEV300_m35/stoc/source/javavm/javavm.cxx@261996 l. 1640 and
jvmaccess::ClassPath::translateToUrls in
tags/DEV300_m35/jvmaccess/inc/jvmaccess/classpath.hxx@246305.
Comment 5 Stephan Bergmann 2008-12-15 10:25:38 UTC
fixed as
cws/sb103/jvmaccess/source/classpath.cxx@265468
cws/sb103/stoc/source/javavm/javavm.cxx@265468
Comment 6 Stephan Bergmann 2009-01-16 09:44:45 UTC
@jsk: please verify
Comment 7 joerg.skottke 2009-01-27 14:44:13 UTC
Verified, the wizard works even with umlauts and other stuff in the path.
Comment 8 joerg.skottke 2009-03-20 11:27:26 UTC
Verified on MWS ooo310m6 for both Windows and Linux, closing