我有以下问题:

此代码...

    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服务器实现(在第474行的http://code.google.com/p/littles3/source/browse/trunk/modules/filesystem/src/main/java/com/jpeterson/littles3/dao/filesystem/FileS3ObjectDao.java)在已安装的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。正如我已经说过的,它在普通文件系统上可以正常工作。

文件锁定是否可能导致该问题?有人已经在这里获得经验了吗?

提前谢谢了!

最佳答案

该错误信息表明该文件为空。

07-24 22:08