eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 144 forks source link

Deployment of a war file fails if path to GlassFish directory includes spaces #17242

Closed glassfishrobot closed 13 years ago

glassfishrobot commented 13 years ago

This appears to be a regression of #5806.

I'm getting the following Exception when I attempt to deploy a war file using asadmin. I execute the command:

asadmin deploy myproject.war

and get the following Exception in the log file:

java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/GlassFish/glassfishv3/glassfish/domains/domain1/applications/myproject/WEB-INF/lib/myresoure-1.0.2-SNAPSHOT.jar
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.checkChars(URI.java:2982)
    at java.net.URI$Parser.parseHierarchical(URI.java:3066)
    at java.net.URI$Parser.parse(URI.java:3014)
    at java.net.URI.<init>(URI.java:578)
    at java.net.URL.toURI(URL.java:918)
    at com.sun.enterprise.v3.server.SnifferManagerImpl.getURIs(SnifferManagerImpl.java:268)
    at com.sun.enterprise.v3.server.SnifferManagerImpl.getApplicableSniffers(SnifferManagerImpl.java:202)
    at com.sun.enterprise.v3.server.SnifferManagerImpl.getSniffers(SnifferManagerImpl.java:150)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:606)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:619)

Notice the space in "Program Files". I assume that is the problem.

If I deploy the application using the "Run" command in Netbeans 7.0.1 then I don't get the error. Note: I'm using a Netbeans maven project to build the application (and usually to deploy the application). Therefore it seems in-place deployments work fine; it is just the scenario where you provide a war file that doesn't work.

Environment

Windows 7 64-bit

Affected Versions

[3.1.1]

glassfishrobot commented 6 years ago
glassfishrobot commented 13 years ago

@glassfishrobot Commented slominskir said: Note: the project had the following "sniffers" (excerpt from domain.xml):

<module name="myproject">
    <engine sniffer="ejb"></engine>
    <engine sniffer="security"></engine>
    <engine sniffer="jpa"></engine>
    <engine sniffer="web"></engine>
    <engine sniffer="weld"></engine>
</module>
glassfishrobot commented 13 years ago

@glassfishrobot Commented @honghzzhang said: Yes, it's probably the space. As a workaround, please don't use directory with space for now.

glassfishrobot commented 13 years ago

@glassfishrobot Commented @honghzzhang said: Fixed in both trunk and 3.1.2. Encode the space in the path before converting a URL or a String to a URI.

glassfishrobot commented 13 years ago

@glassfishrobot Commented Issue-Links: is duplicated by GLASSFISH-17440 is related to GLASSFISH-16333

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-17242

glassfishrobot commented 13 years ago

@glassfishrobot Commented Reported by slominskir

glassfishrobot commented 13 years ago

@glassfishrobot Commented Marked as fixed on Friday, October 21st 2011, 6:22:09 pm