本文介绍了camel-hdfs2没有FileSystem for scheme:hdfs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的OSGI项目中使用camel-hdfs2时遇到了一些错误(基于karaf)
我的环境:
Apache Karaf v4.0.4
Apache Camel v2.15.2
Apache Camel hdfs2 v2 .15.2
错误是:
没有FileSystem for scheme:hdfs
错误详情:
2016-07-07 15:59:52,141 |错误| pool-14-thread-1 | BlueprintCamelContext | 36 - org.apache.camel.camel-blueprint - 2.15.2 |在启动Camel:CamelContext(intelligenceCollectorWorkCamelContext)期间发生错误未能为端点创建生产者:Endpoint [hdfs2:// server01:9000 / test-camel-byte?fileType = SEQUENCE_FILE& valueType = BYTE]。原因:java.io.IOException:否方案的文件系统:hdfs
org.apache.camel.FailedToCreateProducerException:无法为端点创建生产者:端点[hdfs2:// server01:9000 / test-camel-byte?fileType = SEQUENCE_FILE&安培; VALUETYPE = BYTE]。原因:java.io.IOException:无方案的文件系统:hdfs
位于org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:407)
位于org.apache.camel.impl。 ProducerCache.acquireProducer(ProducerCache.java:123)
at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:219)
at org.apache.camel.support.ServiceSupport.start( ServiceSupport.java:61)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java: 59)
在org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
在org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org .apache.camel.util.ServiceHelper.startService(ServiceHelper.j ava:74)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
在org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1272)
在org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:44)
在org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:31)
在org.apache .camel.util.ServiceHelper.startService(ServiceHelper.java:74)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
在org.apache.camel.util .ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.interceptor.DefaultChannel .doStart(DefaultChannel.java:155)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
在org.apache。 camel.util.ServiceHelper.startService(ServiceHelper.java:59)
在org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
在org.apache.camel.util。 ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start( ServiceSupport.java:61)
在org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
在org.apache.camel.impl.RouteService.startChildService(RouteService.java: 340)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:182)
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)
在org.apache.camel.impl.DefaultCamelContext.saf在org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes elyStartRouteServices(DefaultCamelContext.java:3020)
(DefaultCamelContext.java:2797)
在org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext。
at org.apache.camel.impl.DefaultCamelContext.access $ 000(DefaultCamelContext.java:167)
at org.apache.camel.impl.DefaultCamelContext $ 2.call(DefaultCamelContext.java: 2467)
在org.apache.camel.impl.DefaultCamelContext $ 2.call(DefaultCamelContext.java:2463)
在org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContex t.java:180)美元,org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:212 B $ B)
在org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java: 150)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)[org.apache.felix.framework-5.4.0.jar:]
at org。 apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher .fireServiceEvent(EventDispatcher.java:546)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)[org .apache.felix.framework-5.4.0.jar:]
在org.apache.felix.framework.Felix.registerService(Felix.java:3549)[org.apache.felix.framework-5.4.0。 jar:]
在org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:34 8)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:355)
at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_74]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_74]
at $:$ b $在java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_74]
在org.apache.aries上的org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)[28:org.apache.aries.blueprint.core:1.5.0]
。 blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit( BeanRecipe.java:736)[28:org.apache.aries.blueprint.core:1.5.0]
在org.apache.aries .blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:848)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate (BeanRecipe.java:811)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.di.AbstractRecipe $ 1.call(AbstractRecipe.java:79) [28:org.apache.aries.blueprint.core:1.5.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_74]
at org .apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[28:org.apache.aries.blueprint.core:1.5.0]
在org.apache.aries.blueprint.container .BlueprintRepository.createInstances(BlueprintRepository.java:255)[28:org.apache.aries.blueprint.core:1.5.0]
。在org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java :186)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(Blue printContainerImpl.java:712)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:399)[28 :org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:273)[28:org.apache.aries.blueprint .core:1.5.0]
在org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[28:org.apache.aries.blueprint.core:1.5.0] $在org.apache上使用org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[28:org.apache.aries.blueprint.core:1.5.0]
获得b $ b。 aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.util.tracker.hook。 BundleHookBundleTracker $ Tracked.customizerModified(BundleHookBundleTracker.java:500)[35:org.apache.aries.util:1.1.1]
在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ Tracked.customizerModified(BundleHookBundleTracker.java:433)[35:org.apache.aries.util:1.1.1]
at org.apache。 aries.util.tracker.hook.BundleHookBundleTracker $ AbstractTracked.track(BundleHookBundleTracker.java:725)[35:org.apache.aries.util:1.1.1]
在org.apache.aries.util.tracker。 hook.BundleHookBundleTracker $ Tracked.bundleChanged(BundleHookBundleTracker.java:463)[35:org.apache.aries.util:1.1.1]在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ BundleEventHook
。事件(BundleHookBundleTracker.java:422)[35:org.apache.aries.util:1.1.1]
在org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)[org .apache.felix.framework-5.4.0.jar:]在org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks
(EventDispatcher.java:731)[org.apache.felix.framework-5.4。 0.jar:]
在org.apache.felix.framework.util.EventDispatcher.fireBundle事件(EventDispatcher.java:486)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)[org。 apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2172)[org.apache.felix.framework-5.4.0.jar :]
在org.apache的org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)[org.apache.felix.framework-5.4.0.jar:]
。 felix.framework.BundleImpl.start(BundleImpl.java:984)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle (FeaturesServiceImpl.java:1199)[10:org.apache.karaf.features.core:4.0.4]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:840 )[10:org.apache.karaf.features.core:4.0.4]
在org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1089)[10:org。 apache.karaf.features.core:4.0.4]
在org.ap ache.karaf.features.internal.service.FeaturesServiceImpl $ 1.call(FeaturesServiceImpl.java:985)[10:org.apache.karaf.features.core:4.0.4]
在java.util.concurrent.FutureTask .run(FutureTask.java:266)[:1.8.0_74]
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_74]
位于java.util .concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_74]
在java.lang.Thread.run(Thread.java:745)[:1.8.0_74]
由:java.io.IOException:No FileSystem for scheme:hdfs
Blueprint.xml
< cm:property-placeholder id =intelligence.collector.workpersistent-id =wbg.space.intelligence.collector。工作>
< cm:default-properties>
<! - 默认属性 - >
< / cm:default-properties>
< / cm:property-placeholder>
< bean id =hdfsWriterclass =wbg.space.intelligence.collector.work.HdfsWriteProcessor/>
< bean id =hdfsOsgiHelperclass =org.apache.camel.component.hdfs2.HdfsOsgiHelper>
<参数>
< map>
< entry key =hdfs:// server01:9000value =org.apache.hadoop.hdfs.DistributedFileSystem/>
< entry key =file://value =org.apache.hadoop.fs.LocalFileSystem/>
< / map>
< / argument>
< / bean>
< bean id =hdfs2class =org.apache.camel.component.hdfs2.HdfsComponentdepends-on =hdfsOsgiHelper/>
< camelContext id =intelligenceCollectorWorkCamelContextxmlns =http://camel.apache.org/schema/blueprint>
< package> wbg.space.intelligence.collector.work< / package>
< / camelContext>
RoutBuild.java
@Override
public void configure()throws Exception(
from(direct:write_byte )。为了( ?hdfs2:// SERVER01:9000 /测试骆驼字节VALUETYPE = BYTE&安培;的fileType = SEQUENCE_FILE); $(quartz2:// myGroup / myTimerName?trigger.repeatInterval = 2000& trigger.repeatCount = 10)。
解决方案
一样的问题。
这是生成正确jar的pom。
<?xml version =1.0encoding = UTF-8 >?;
< project xmlns =http://maven.apache.org/POM/4.0.0
xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId>示例< / groupId>
< artifactId`enter code here`> XXXXXX< / artifactId>
< version> 1.0-SNAPSHOT< / version>
<属性>
< org.apache.camel> 2.12.1< /org.apache.camel>
< / properties>
<依赖关系>
< dependency>
< groupId> org.apache.hadoop< / groupId>
< artifactId> hadoop-client< / artifactId>
< version> 2.6.0< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.hive< / groupId>
< artifactId> hive-jdbc< / artifactId>
< version> 1.1.0< / version>
< /依赖关系>
< dependency>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.17< / version>
< /依赖关系>
<! - https://mvnrepository.com/artifact/org.apache.camel/camel-core - >
< dependency>
< groupId> org.apache.camel< / groupId>
< artifactId> camel-core< / artifactId>
< version> 2.20.2< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.camel< / groupId>
< artifactId> camel-hdfs2< / artifactId>
< version> 2.20.2< / version>
< /依赖关系>
< /依赖关系>
< distributionManagement>
< repository>
< id> artifactory-utn< / id>
< url> http://artifactory.incubator.com.ar/artifactory/utn< / url>
< / repository>
< / distributionManagement>
< build>
< plugins>
< plugin>
< artifactId> maven-assembly-plugin< / artifactId>
<配置>
<档案>
< manifest>
< mainClass> main.Main< / mainClass>
< / manifest>
< / archive>
< descriptorRefs>
< descriptorRef> jar -with-dependencies< / descriptorRef>
< / descriptorRefs>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.3.2< / version>
<配置>
< source> 8< / source>
< target> 8< / target>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-shade-plugin< / artifactId>
< version> 2.4.2< / version>
<执行次数>
<执行>
<阶段>包< /阶段>
<目标>
<目标>阴影< /目标>
< /目标>
<配置>
< filters>
< filter>
< artifact> *:*< / artifact>
< exclude> META-INF / *。SF< / exclude>
< exclude> META-INF / *。DSA< / exclude>
< exclude> META-INF / * .RSA< / exclude>
< /不包括>
< / filter>
< / filters>
<变形金刚>
< transformer implementation =org.apache.maven.plugins.shade.resource.ServicesResourceTransformer/>
< transformer
implementation =org.apache.maven.plugins.shade.resource.ManifestResourceTransformer>
< manifestEntries>
< Main-Class> reload.transform.ReloadCamelProcessMain< / Main-Class>
< Build-Number> 123< / Build-Number>
< / manifestEntries>
< /变压器>
< /变形金刚>
< / configuration>
< /执行>
< /执行次数>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-surefire-plugin< / artifactId>
< version> 2.19.1< / version>
<配置>
<包括>
< include> ** / * Test.java< / include>
< / includes>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / project>
I got the some errors when I use camel-hdfs2 in my OSGI project(base on karaf)
My environment:
Apache Karaf v4.0.4
Apache Camel v2.15.2
Apache Camel hdfs2 v2.15.2
Error is:
No FileSystem for scheme: hdfs
Error detail:
2016-07-07 15:59:52,141 | ERROR | pool-14-thread-1 | BlueprintCamelContext | 36 - org.apache.camel.camel-blueprint - 2.15.2 | Error occurred during starting Camel: CamelContext(intelligenceCollectorWorkCamelContext) due Failed to create Producer for endpoint: Endpoint[hdfs2://server01:9000/test-camel-byte?fileType=SEQUENCE_FILE&valueType=BYTE]. Reason: java.io.IOException: No FileSystem for scheme: hdfs
org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[hdfs2://server01:9000/test-camel-byte?fileType=SEQUENCE_FILE&valueType=BYTE]. Reason: java.io.IOException: No FileSystem for scheme: hdfs
at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:407)
at org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:123)
at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:219)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1272)
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:44)
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:31)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:155)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.impl.RouteService.startChildService(RouteService.java:340)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:182)
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3090)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3020)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:180)
at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:212)
at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:150)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.registerService(Felix.java:3549)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:355)
at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_74]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_74]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_74]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_74]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:736)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:848)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[28:org.apache.aries.blueprint.core:1.5.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_74]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:186)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:712)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:399)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:273)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[28:org.apache.aries.blueprint.core:1.5.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[35:org.apache.aries.util:1.1.1]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[35:org.apache.aries.util:1.1.1]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[35:org.apache.aries.util:1.1.1]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[35:org.apache.aries.util:1.1.1]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[35:org.apache.aries.util:1.1.1]
at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:731)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:486)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2172)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1199)[10:org.apache.karaf.features.core:4.0.4]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:840)[10:org.apache.karaf.features.core:4.0.4]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1089)[10:org.apache.karaf.features.core:4.0.4]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:985)[10:org.apache.karaf.features.core:4.0.4]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_74]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_74]
Caused by: java.io.IOException: No FileSystem for scheme: hdfs
Blueprint.xml
<cm:property-placeholder id="intelligence.collector.work" persistent-id="wbg.space.intelligence.collector.work">
<cm:default-properties>
<!--default properties-->
</cm:default-properties>
</cm:property-placeholder>
<bean id="hdfsWriter" class="wbg.space.intelligence.collector.work.HdfsWriteProcessor"/>
<bean id="hdfsOsgiHelper" class="org.apache.camel.component.hdfs2.HdfsOsgiHelper">
<argument>
<map>
<entry key="hdfs://server01:9000" value="org.apache.hadoop.hdfs.DistributedFileSystem"/>
<entry key="file://" value="org.apache.hadoop.fs.LocalFileSystem"/>
</map>
</argument>
</bean>
<bean id="hdfs2" class="org.apache.camel.component.hdfs2.HdfsComponent" depends-on="hdfsOsgiHelper"/>
<camelContext id="intelligenceCollectorWorkCamelContext" xmlns="http://camel.apache.org/schema/blueprint">
<package>wbg.space.intelligence.collector.work</package>
</camelContext>
RoutBuild.java
@Override
public void configure() throws Exception {
from("direct:write_byte").to("hdfs2://server01:9000/test-camel-byte?valueType=BYTE&fileType=SEQUENCE_FILE");
from("quartz2://myGroup/myTimerName?trigger.repeatInterval=2000&trigger.repeatCount=10").processRef("hdfsWriter");
}
解决方案
I had the same problem. this is the pom that generated me the correct jar.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId`enter code here`>XXXXXX</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<org.apache.camel>2.12.1</org.apache.camel>
</properties>
<dependencies>
<!-- Hadoop main client artifact -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.20.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.camel/camel-hdfs2 -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hdfs2</artifactId>
<version>2.20.2</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>artifactory-utn</id>
<url>http://artifactory.incubator.com.ar/artifactory/utn</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>main.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>reload.transform.ReloadCamelProcessMain</Main-Class>
<Build-Number>123</Build-Number>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
这篇关于camel-hdfs2没有FileSystem for scheme:hdfs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!