gpt4 book ai didi

java - 使用 Spring Data Hadoop 类路径资源的 IOException

转载 作者:可可西里 更新时间:2023-11-01 16:34:36 26 4
gpt4 key购买 nike

每当我使用 Spring Data Hadoop 命名空间指定资源时,应用程序都会在加载指定文件时抛出 IOException。该文件确实存在并且格式有效。

Spring Data Hadoop XML 配置:

启动时的堆栈跟踪:

Caused by: java.lang.RuntimeException: java.io.IOException: Stream closed
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1231)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1103)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1037)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:415)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:860)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1380)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
at com.mendeley.swets.config.HdfsConfig.fileSystem(HdfsConfig.java:28)
at com.mendeley.swets.config.HdfsConfig$$EnhancerByCGLIB$$38b1feb7.CGLIB$fileSystem$0(<generated>)
at com.mendeley.swets.config.HdfsConfig$$EnhancerByCGLIB$$38b1feb7$$FastClassByCGLIB$$3c3c119d.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280)
at com.mendeley.swets.config.HdfsConfig$$EnhancerByCGLIB$$38b1feb7.fileSystem(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)
... 41 more
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:189)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2932)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:704)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1162)
... 61 more

最佳答案

这已在主干中修复,将在下一个里程碑中提供。有关详细信息,请参阅 spring 论坛帖子 [1]。

[1] http://forum.springsource.org/showthread.php?123777-IOException-when-using-lt-hadoop-configuration-resources-quot

关于java - 使用 Spring Data Hadoop 类路径资源的 IOException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9567671/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com