Erro no upload de arquivo

10 views
Skip to first unread message

Adriano Aguiar

unread,
Nov 26, 2018, 11:43:12 PM11/26/18
to livro-springmvc
Boa noite, estou com problema em fazer upload de arquivo com Java usando servidor Wildlfy e Spring MVC, segue o código e o erro que está ocorrendo:

if (files != null && files.length > 0) {
MultipartFile arquivo = files[0];

novoNome = renomearArquivo(arquivo.getOriginalFilename());

try {

arquivo.transferTo(
new File(this.local.toAbsolutePath().toString() + getDefault().getSeparator() + novoNome));
} catch (IOException e) {
throw new RuntimeException("Erro salvando a foto", e);
                      }
}


 Caused by: java.nio.file.NoSuchFileException: E:\wildfly-10.1.0.Final\standalone\tmp\aguiar.war\undertow5878953598132789423upload

01:15:51,899 ERROR [stderr] (Thread-102) at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)

01:15:51,902 ERROR [stderr] (Thread-102) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)

01:15:51,902 ERROR [stderr] (Thread-102) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)

01:15:51,903 ERROR [stderr] (Thread-102) at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:99)

01:15:51,903 ERROR [stderr] (Thread-102) at sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)

01:15:51,903 ERROR [stderr] (Thread-102) at java.nio.file.Files.copy(Files.java:1274)

01:15:51,904 ERROR [stderr] (Thread-102) at io.undertow.servlet.spec.PartImpl.write(PartImpl.java:110)

grato,


Reply all
Reply to author
Forward
0 new messages