我有以下问题:
这段代码...
try {
fis = new FileInputStream(serializedKeyIndex);
in = new ObjectInputStream(fis); // this line throws the EOFException (and IOException)
keys = (HashMap<String, String>) in.readObject();
in.close();
} catch (FileNotFoundException e) {
// create the key index
keys = new HashMap<String, String>();
storeKeyIndex(bucket, keys);
} catch (IOException e) {
throw new DataAccessResourceFailureException(
"Unable to store Bucket: " + bucket, e);
} catch (ClassNotFoundException e) {
throw new DataAccessResourceFailureException(
"Unable to store Bucket: " + bucket, e);
}
... littles3 服务器实现(http://code.google.com/p/littles3/source/browse/trunk/modules/filesystem/src/main/java/com/jpeterson/littles3/dao/filesystem/FileS3ObjectDao .java,在第 474 行)在已安装的 NFS 版本 4 驱动器上引发 EOFException。
Glassfish 的报告告诉我:
[#|2012-09-19T10:46:00.277+0200|WARNING|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2298)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
at com.jpeterson.littles3.dao.filesystem.FileS3ObjectDao.retrieveKeyIndex(FileS3ObjectDao.java:474)
at com.jpeterson.littles3.dao.filesystem.FileS3ObjectDao.loadS3Object(FileS3ObjectDao.java:63)
at com.jpeterson.littles3.service.impl.FileStorageServiceImpl.load(FileStorageServiceImpl.java:89)
at com.jpeterson.littles3.StorageEngine.methodPut(StorageEngine.java:823)
at com.jpeterson.littles3.StorageEngine.doService(StorageEngine.java:233)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:450)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:691)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
奇怪的是,它可以在通常的本地文件系统中正常工作。那里也不例外。
如果我想在存储桶下创建第二个 S3Object(文件夹或文件),NFSv4 只会出现该错误。似乎它只能在一个桶下面创建一个 S3Object 。正如我已经说过的,它在通常的文件系统上运行良好。
文件锁可能会导致该问题吗?有人已经在这里获得了经验吗?
提前谢谢了!