gpt4 book ai didi

java - Wicket 口表格 : ERROR - Unable to write file

转载 作者:行者123 更新时间:2023-11-28 23:41:00 25 4
gpt4 key购买 nike

我在 wicket 中上传文件时遇到问题。我无法将任何文件上传到在线服务器。

这个脚本已经可以运行了,但是有一段时间它停止了。

所以我搜索答案,但我遇到了同样的错误。

我的代码等于:http://www.mkyong.com/wicket/wicket-file-upload-example/区别在于文件夹路径不是示例中的本地路径,而是通过 https 指向远程 url。

附加信息:

  • 服务器
    • 操作系统:Debian GNU/Linux 7 (wheezy)
    • Tomcat : Tomcat 7
    • 目标文件夹中的权限:777
  • 本地:
    • Tomcat : Tomcat 7
    • JDK:1.7
    • 三柱门:6

测试

  1. 打开上传网站
  2. 选择文件aa.png(服务器中不存在)
  3. 点击上传

结果:

28 10 13 18:19:31:630 - ERROR - Unable to write file


java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.createFileExclusively(Native Method)

28 10 13 18:27:02:370 - ERROR - Unexpected error occurred
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface

org.apache.wicket.markup.html.form.IFormSubmitListener
targeted at [Form [Component id = form]] on component [Form [Component id = form]] `threw an exception`

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.wicket.RequestListenerInterface.
internalInvoke(RequestListenerInterface.java:258)
... 30 more
Caused by: java.lang.IllegalStateException: Error
at com.myproject.presentation.utils.examples.FileUploadPage$1.onSubmit(FileUploadPage.java:51)
at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1246)
at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1240)
at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:274)
at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:245)
at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1239)
at org.apache.wicket.markup.html.form.Form.process(Form.java:921)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:767)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:700)
... 35 more

最佳答案

来自JavaDoc文件:

public File(URI uri)

Creates a new File instance by converting the given file: URI into an abstract pathname.

The exact form of a file: URI is system-dependent, hence the transformation performed by this constructor is also system-dependent.

For a given abstract pathname f it is guaranteed that

new File( f.toURI()).equals( f.getAbsoluteFile()) 

so long as the original abstract pathname, the URI, and the new abstract pathname are all created in (possibly different invocations of) the same Java virtual machine. This relationship typically does not hold, however, when a file: URI that is created in a virtual machine on one operating system is converted into an abstract pathname in a virtual machine on a different operating system.

Parameters:

uri - An absolute, hierarchical URI with a scheme equal to "file", a non-empty path component, and undefined authority, query, and fragment components

Throws:

NullPointerException - If uri is null

IllegalArgumentException - If the preconditions on the parameter do not hold

Since: 1.4

没有人提到 http 或 https。

关于java - Wicket 口表格 : ERROR - Unable to write file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19642224/

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