gpt4 book ai didi

java - Glassfish 索引 8 处的路径中存在非法字符 : My Program. war

转载 作者:行者123 更新时间:2023-12-01 10:26:09 25 4
gpt4 key购买 nike

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

我知道问题是“My Program.war”中有一个空格,我只是不知道如何摆脱它。最初,我的 Java 项目称为“我的程序”,但由于出现此错误,我将其重命名为“我的程序”。这更改了文件夹名称和项目名称,但由于某种原因,当我部署 Glassfish 应用程序时,它尝试使用旧名称。我如何更新此信息?

最佳答案

文件名中的空格是由于您的 IDE 配置错误造成的。

解决方法是:

  1. 构建(而不是部署)您的项目,这将创建一个名为 My Program.war 的 WAR 文件。 IDE 中的输出日志应该告诉您它的构建位置

  2. 将文件重命名为 MyProgram.war

  3. 手动将文件部署到 GlassFish。有instructions in this blog post 。最简单的方法可能是将其复制到 autodeploy 文件夹:glassfish/domains/domain1/autodeploy

关于java - Glassfish 索引 8 处的路径中存在非法字符 : My Program. war,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35352697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com