[ http://issues.apache.org/jira/browse/OFBIZ-486?page=comments#action_12451823 ] Stephen Parry commented on OFBIZ-486: -------------------------------------
Thanks guys for the positive feedback and the 'heads up' on the patching! > Default JDK 5 location on Windows causes startup to abort with > java.net.MalformedURLException > --------------------------------------------------------------------------------------------- > > Key: OFBIZ-486 > URL: http://issues.apache.org/jira/browse/OFBIZ-486 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: Windows XP SP 2 JDK 5.0 Update 7 > Reporter: Stephen Parry > Assigned To: David E. Jones > Fix For: SVN trunk > > Attachments: Classpath.patch > > > Sun's default install location for JDK 5 is under the acursed Program Files > folder i.e. it includes a space in the path. Startup places tools.jar from > the SDK on the class path. This puts an unescaped space in the classpath, > which breaks class loading. > org.ofbiz.base.start.StartupException: Cannot start() > org.ofbiz.service.rmi.RmiServiceContainer (Unable to bind RMIDispatcher to > RMI (RemoteException occurred in server thread; nested exception is: > java.rmi.UnmarshalException: error unmarshalling arguments; nested > exception is: > java.net.MalformedURLException: no protocol: > Files/Java/jdk1.5.0_07/lib/tools.jar)) > at > org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:79) > at org.ofbiz.base.start.Start.startStartLoaders(Start.java:260) > at org.ofbiz.base.start.Start.startServer(Start.java:311) > at org.ofbiz.base.start.Start.start(Start.java:315) > at org.ofbiz.base.start.Start.main(Start.java:401) > Suggested patch below escapes any spaces in the startup class path. > Index: Classpath.java > =================================================================== > --- Classpath.java (revision 477351) > +++ Classpath.java (working copy) > @@ -81,16 +81,28 @@ > } > return added; > } > + > + private void appendPath(StringBuffer cp, String path) > + { > + if(path.indexOf(' ') >= 0) > + { > + cp.append('\"'); > + cp.append(path); > + cp.append('"'); > + } > + else > + cp.append(path); > + } > > public String toString() { > StringBuffer cp = new StringBuffer(1024); > int cnt = _elements.size(); > if (cnt >= 1) { > - cp.append(((File) (_elements.get(0))).getPath()); > + appendPath(cp, ((File) (_elements.get(0))).getPath()); > } > for (int i = 1; i < cnt; i++) { > cp.append(File.pathSeparatorChar); > - cp.append(((File) (_elements.get(i))).getPath()); > + appendPath(cp, ((File) (_elements.get(i))).getPath()); > } > return cp.toString(); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
