admin@glassfish.java.net

Re: Fwd: Urgent: Need help with a bug

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Fri, 19 Dec 2008 15:34:57 +0530

> Siva, can you take this?

Yes, Tim. I will fix this. I shall work with Harpreet/Prasad on
getting this into GFv2.1

Thanks
--Siva.

Tim Quinn wrote:
> All,
>
> The underlying problem is that the ASClassLoaderUtil.getLibraries method
> uses this construct
>
> URL url = f.toURL();
>
> (where f is a File) and this is not safe. The correct construct is
>
> URL url = f.toURI().toURL();
>
> because toURL does not encode special characters while toURI does.
>
> I suspect that the reason the CR was marked as Windows-only is because
> we do not officially supported installations of GlassFish into paths
> that contain a space except on Windows. The non-Windows installer
> checks for and rejects such paths. (At least it used to from what I
> recall.)
>
> The obvious workaround is to not install into a path containing a space
> (or any other character that requires URL encoding). But that causes
> trouble even on Windows for the default \Program Files\ location plus on
> systems across the world where special national characters appear in paths.
>
> Siva, can you take this?
>
> - Tim
>
> Jason Lee wrote:
>> Tim, could you look at the issue linked below? It looks like an issue
>> in the deployer code. Here's the stack trace I get:
>>
>> [#|2008-12-18T13:07:34.792-0600|SEVERE|sun-appserver2.1|javax.enterprise.system.tools.deployment|_ThreadID=17;_ThreadName=Thread-97;_RequestID=1590fcff-6d75-47df-ae6c-44df9a3680ad;|Exception
>> occured in J2EEC Phasejava.net.URISyntaxException: Illegal character
>> in path at index 30: file:/Users/jasonlee/GlassFish
>> Test/glassfish/domains/domain1/lib/applibs/
>> com.sun.enterprise.deployment.backend.IASDeploymentException: Error
>> loading deployment descriptors for module [mojarra-scales-demo] --
>> Illegal character in path at index 30: file:/Users/jasonlee/GlassFish
>> Test/glassfish/domains/domain1/lib/applibs/
>> at
>> com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:406)
>> at
>> com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:426)
>> at
>> com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java:160)
>> at
>> com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:182)
>> at
>> com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:208)
>> at
>> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
>> at
>> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
>> at
>> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:283)
>> at
>> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:835)
>> at
>> com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
>> at
>> com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)
>> Caused by: java.net.URISyntaxException: Illegal character in path at
>> index 30: file:/Users/jasonlee/GlassFish
>> Test/glassfish/domains/domain1/lib/applibs/
>> at java.net.URI$Parser.fail(URI.java:2816)
>> at java.net.URI$Parser.checkChars(URI.java:2989)
>> at java.net.URI$Parser.parseHierarchical(URI.java:3073)
>> at java.net.URI$Parser.parse(URI.java:3021)
>> at java.net.URI.<init>(URI.java:578)
>> at java.net.URL.toURI(URL.java:916)
>> at
>> com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:324)
>> ... 10 more
>>
>> Ken and I tracked it down in the source, and it looks like it's dying
>> in lines 324-325 in Deployer.java:
>>
>> String libs = request.getLibraries();
>> URL[] deployTimeLibraries =
>> ASClassLoaderUtil.getLibraries(libs);
>> if (deployTimeLibraries != null) {
>> for (int i=0; i< deployTimeLibraries.length; i++) {
>> String libPath = new File(
>> // <-- These two lines
>> deployTimeLibraries[i].toURI()).getPath();
>> moduleClasspath.add(libPath);
>> }
>> }
>>
>> For what it's worth, I was able to reproduce on my Mac, so it's not a
>> Windows-only issue.
>>
>> I'm online (IRC, instant messenger) if you want to chat.
>>
>> Thanks.
>>
>> Begin forwarded message:
>>> Deployment of a war file that has space in the name fails.
>>> 9 nazrul.islam <mailto:nazrul.islam@sun.com> ana.caballero <mailto:ana.caballero@sun.com> sunone_app/admi 2 6771464 <http://monaco.sfbay.sun.com/detail.jsf?cr=6771464> 4W dis SDK5U7: Windows only:Unable to deploy a web app using AdminGUI if install-dir has space char in path
>>>
>>> The fixes will go into two branches - FCS and 2.1 branch. Harpreet can give you exact details.
>>> The issue need to be resolved by this week. GFv2.1 is already in release candidate build.
>>>
>> <http://www.java.com> * Jason Lee *
>> Senior Java Developer
>> GlassFish Administration Console
>>
>> *Sun Microsystems, Inc.*
>> Phone x31197/+1 405-343-1964
>> Email jasondlee_at_sun.com <mailto:jasondlee_at_sun.com>
>> Blog http://blogs.sun.com/jasondlee
>> Blog http://blogs.steeplesoft.com
>>
>>
>