作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下问题:
这段代码...
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)
奇怪的是,它可以与通常的本地文件系统一起正常工作。那里也不异常(exception)。
只有当我想在存储桶下创建第二个 S3Object(文件夹或文件)时,NFSv4 才会出现此错误。似乎它只能在一个桶下面创建一个 S3Object。正如我已经说过的,它在普通文件系统上运行良好。
文件锁定可能会导致该问题吗?有人已经在这里获得经验了吗?
非常感谢!
最佳答案
错误信息提示文件为空。
关于java - NFSv4 - EOFException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12491343/
我是一名优秀的程序员,十分优秀!