0
votes

java.lang.IllegalArgumentException: Illegal character in path at index 8: My Program.war at java.net.URI.create(URI.java:859) at java.net.URI.resolve(URI.java:1043) at org.glassfish.admin.payload.PayloadFilesManager.getOutputFileURI(PayloadFilesManager.java:413) at org.glassfish.admin.payload.PayloadFilesManager.extractFile(PayloadFilesManager.java:502) at org.glassfish.admin.payload.PayloadFilesManager.access$600(PayloadFilesManager.java:93) at org.glassfish.admin.payload.PayloadFilesManager$DataRequestType$1.processPart(PayloadFilesManager.java:753) at org.glassfish.admin.payload.PayloadFilesManager.processPartsExtended(PayloadFilesManager.java:622) at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.extractFiles(CommandRunnerImpl.java:1990) at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.(CommandRunnerImpl.java:1962) at com.sun.enterprise.v3.admin.CommandRunnerImpl$UploadedFilesManager.(CommandRunnerImpl.java:1941) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1119) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534) at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224) at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.URISyntaxException: Illegal character in path at index 8: My Program.war at java.net.URI$Parser.fail(URI.java:2829) at java.net.URI$Parser.checkChars(URI.java:3002) at java.net.URI$Parser.parseHierarchical(URI.java:3086) at java.net.URI$Parser.parse(URI.java:3044) at java.net.URI.(URI.java:595) at java.net.URI.create(URI.java:857) ... 34 more

I know that the issue is there is a space in "My Program.war", I just don't know how to get rid of it. Originally, my Java project was called "My Program", but since I've been getting this error I renamed it to "My-Program". This has changed the folder name and project name, but for some reason when I deploy my Glassfish application, it tries to use the old name. How can I update this information?

2
show us your code at PayloadFilesManager.java:413Scary Wombat

2 Answers

1
votes

The space in the file name will be caused by misconfiguration of your IDE.

A workaround would be to:

  1. Build, rather than deploy, your project which will create a WAR file called My Program.war. The output log in your IDE should tell you the location where it is built

  2. Rename the file to MyProgram.war

  3. Deploy the file to GlassFish manually. There are instructions in this blog post. The easiest way is probably just to copy it to the autodeploy folder: glassfish/domains/domain1/autodeploy

0
votes

Also you can use asadmin undeploy <appname> (without the .war extension), but that is also assuming that it was deployed. I am not sure that it was in your case but you can check with asadmin list-applications.