[jira] Created: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
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


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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-486?page=comments#action_12451640 ]
           
Jacques Le Roux commented on OFBIZ-486:
---------------------------------------

I tested, it works well : +1

I think this patch is of great value. Not because it add a great feature but because it will give us *peace* with Windows and RMI in the following years :o)

So, yes thanks Stephen !

BTW your patch was not done as it should have been. Please read http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices at this subject.

> 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
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-486?page=all ]

Jacques Le Roux updated OFBIZ-486:
----------------------------------

    Attachment: Classpath.patch

Stephen,

I attached a patch done from your contribution. You may have a look at it to see how it should be done.

Thanks again.

> 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
>         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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-486?page=all ]

David E. Jones closed OFBIZ-486.
--------------------------------

    Fix Version/s: SVN trunk
       Resolution: Fixed
         Assignee: David E. Jones

Thanks Jacques and Stephen, this patch looks good. It is now in SVN rev 477801.

> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-486?page=comments#action_12451758 ]
           
Jacques Le Roux commented on OFBIZ-486:
---------------------------------------

BTW I tried with las JDK (open JDK ;o) (build 1.6.0-rc-b104) and it seems to work well with standard install (Program files) too .

> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-486) Default JDK 5 location on Windows causes startup to abort with java.net.MalformedURLException

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ 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