AxisFault faultString: java.io.IOException: 设备未就绪。

最近工作中使用Axis时,遇到一个问题:

主要异常如下:

Caused by: java.io.IOException: 设备未就绪。
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(Unknown Source)
at java.io.File.createTempFile(Unknown Source)
at org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk(ManagedMemoryDataSource.java:386)
at org.apache.axis.attachments.ManagedMemoryDataSource.write(ManagedMemoryDataSource.java:276)
at org.apache.axis.attachments.ManagedMemoryDataSource.(ManagedMemoryDataSource.java:149)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:557)
... 36 more

 

 

或者

 

Caused by: java.io.IOException: 系统找不到指定的路径。
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1705)
at java.io.File.createTempFile0(File.java:1726)
at java.io.File.createTempFile(File.java:1803)
at org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk(ManagedMemoryDataSource.java:386)
at org.apache.axis.attachments.ManagedMemoryDataSource.write(ManagedMemoryDataSource.java:276)
at org.apache.axis.attachments.ManagedMemoryDataSource.(ManagedMemoryDataSource.java:149)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:557)
... 36 more

 

解决办法:

检查server-config.wsdd文件,查看:



value="D:\attachments"/>

 

 

路径,是否正确。

 

原因:

Axis上传附件时如果单个附件的大小小于13K,则将保存在内存

否则,会将上述配置"attachments.Directory"中的目录,作为附件的临时存储目录

所以一定要保证该路径的正确性,在项目发布,部署到服务器上更应该注意该路径的配置。

你可能感兴趣的:(Axis)