Running demo service testScv via ExampleRemoteClient

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

Running demo service testScv via ExampleRemoteClient

Imre András Róbert
Hi,

I've been checking the example that interacts with an ofbiz service.
I disabled ssl by commenting out lines in ofbiz-containers.xml.
(Would be great to have comments about it in the xml. My opinion is
that for using the demo service for the first time its probably not a
good idea to get the whole ssl burden. Or is it already documented
somewhere?)

However I kept getting the following error using jdk1.5.0_09 with
ofbiz rev# 496747 (around January 16th) on a Win2003 server:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.net.MalformedURLException: no protocol: Files/Java/jdk1.5.0_09/lib/tools.jar

Note that only the JDK is installed to Program Files folder,
ofbiz_home does not have any spaces in its path.
I tried changing the 'Program Files' sequence to 'Progra~1' in both
JAVA_HOME env var and the Java section of Windows registry, all to no
avail.

I was told that the most common way of solution is to use a JDK
which is installed into a directory that has no spaces in its path.

Since I like to avoid reinstalling JDK and reconfiguring everything
based on it at all cost, I came up with a solution of a quick fix
of Classpath.java based on a relevant issue in the Sun bug database:
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=a6a5e6c13fadf9ffffffffc85adbe8a70f6aa:WuuT?bug_id=4273532

In the getUrls() method I changed
  urls[i] = ((File) (_elements.get(i))).toURL()
to this
  urls[i] = ((File) (_elements.get(i))).toURI().toURL()

After this the demo service runs ok for me.

It would be great if someone could be looking at it in details.
(I'm far from seeing the whole picture, and this kind of modification may
apply to other places as well where the toURL() method is used. Also it
might turn out that this has downsides elsewhere.)

This way this simple demo would work out-of-the-box on Windows as well.
And keep up the good work guys, ofbiz is great.


Thanks,
  András


Reply | Threaded
Open this post in threaded view
|

Re: Running demo service testScv via ExampleRemoteClient

David E Jones

Thanks for your comments and research Andras. Using the toURI method  
looks like a good way to escape these characters.

I just committed some changes related to this in rev 505358. Could  
you try this on Windows and see if it works for you?

-David


On Feb 9, 2007, at 8:07 AM, Imre András Róbert wrote:

> Hi,
>
> I've been checking the example that interacts with an ofbiz service.
> I disabled ssl by commenting out lines in ofbiz-containers.xml.
> (Would be great to have comments about it in the xml. My opinion is
> that for using the demo service for the first time its probably not a
> good idea to get the whole ssl burden. Or is it already documented
> somewhere?)
>
> However I kept getting the following error using jdk1.5.0_09 with
> ofbiz rev# 496747 (around January 16th) on a Win2003 server:
>
> java.rmi.UnmarshalException: error unmarshalling return; nested  
> exception is:
> java.net.MalformedURLException: no protocol: Files/Java/jdk1.5.0_09/
> lib/tools.jar
>
> Note that only the JDK is installed to Program Files folder,
> ofbiz_home does not have any spaces in its path.
> I tried changing the 'Program Files' sequence to 'Progra~1' in both
> JAVA_HOME env var and the Java section of Windows registry, all to no
> avail.
>
> I was told that the most common way of solution is to use a JDK
> which is installed into a directory that has no spaces in its path.
>
> Since I like to avoid reinstalling JDK and reconfiguring everything
> based on it at all cost, I came up with a solution of a quick fix
> of Classpath.java based on a relevant issue in the Sun bug database:
> http://bugs.sun.com/bugdatabase/ 
> view_bug.do;jsessionid=a6a5e6c13fadf9ffffffffc85adbe8a70f6aa:WuuT?
> bug_id=4273532
>
> In the getUrls() method I changed
>   urls[i] = ((File) (_elements.get(i))).toURL()
> to this
>   urls[i] = ((File) (_elements.get(i))).toURI().toURL()
>
> After this the demo service runs ok for me.
>
> It would be great if someone could be looking at it in details.
> (I'm far from seeing the whole picture, and this kind of  
> modification may
> apply to other places as well where the toURL() method is used.  
> Also it
> might turn out that this has downsides elsewhere.)
>
> This way this simple demo would work out-of-the-box on Windows as  
> well.
> And keep up the good work guys, ofbiz is great.
>
>
> Thanks,
>   András
>
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ReRunning demo service testScv via ExampleRemoteClient

Imre András Róbert
Yes, I confirm it works ok.

And I see there's no more swallowed exception - nice.
Just one thing: you may have missed the convertToUrl() method
in OpenOfficeWorker.java

Thanks for the quick patch. Hopefully this eliminates
a whole bunch of problems.


Regards,
  András


Friday, February 9, 2007, 5:50:34 PM, you wrote:


> Thanks for your comments and research Andras. Using the toURI method
> looks like a good way to escape these characters.

> I just committed some changes related to this in rev 505358. Could  
> you try this on Windows and see if it works for you?

> -David


> On Feb 9, 2007, at 8:07 AM, Imre András Róbert wrote:

>> Hi,
>>
>> I've been checking the example that interacts with an ofbiz service.
>> I disabled ssl by commenting out lines in ofbiz-containers.xml.
>> (Would be great to have comments about it in the xml. My opinion is
>> that for using the demo service for the first time its probably not a
>> good idea to get the whole ssl burden. Or is it already documented
>> somewhere?)
>>
>> However I kept getting the following error using jdk1.5.0_09 with
>> ofbiz rev# 496747 (around January 16th) on a Win2003 server:
>>
>> java.rmi.UnmarshalException: error unmarshalling return; nested  
>> exception is:
>> java.net.MalformedURLException: no protocol: Files/Java/jdk1.5.0_09/
>> lib/tools.jar
>>
>> Note that only the JDK is installed to Program Files folder,
>> ofbiz_home does not have any spaces in its path.
>> I tried changing the 'Program Files' sequence to 'Progra~1' in both
>> JAVA_HOME env var and the Java section of Windows registry, all to no
>> avail.
>>
>> I was told that the most common way of solution is to use a JDK
>> which is installed into a directory that has no spaces in its path.
>>
>> Since I like to avoid reinstalling JDK and reconfiguring everything
>> based on it at all cost, I came up with a solution of a quick fix
>> of Classpath.java based on a relevant issue in the Sun bug database:
>> http://bugs.sun.com/bugdatabase/ 
>> view_bug.do;jsessionid=a6a5e6c13fadf9ffffffffc85adbe8a70f6aa:WuuT?
>> bug_id=4273532
>>
>> In the getUrls() method I changed
>>   urls[i] = ((File) (_elements.get(i))).toURL()
>> to this
>>   urls[i] = ((File) (_elements.get(i))).toURI().toURL()
>>
>> After this the demo service runs ok for me.
>>
>> It would be great if someone could be looking at it in details.
>> (I'm far from seeing the whole picture, and this kind of  
>> modification may
>> apply to other places as well where the toURL() method is used.  
>> Also it
>> might turn out that this has downsides elsewhere.)
>>
>> This way this simple demo would work out-of-the-box on Windows as  
>> well.
>> And keep up the good work guys, ofbiz is great.
>>
>>
>> Thanks,
>>   András
>>
>>