gpt4 book ai didi

rest - 来自 org.apache.hadoop.hbase.client.HConnectionManager.createConnection 的 InvocationTargetException 异常

转载 作者:可可西里 更新时间:2023-11-01 15:13:57 27 4
gpt4 key购买 nike

由于上述错误,我基于 tomcat 的 REST API 应用程序无法处理请求。到目前为止,我已经尝试过以下事情:

  1. 检查所有的jar文件是否可用
  2. 检查 tomcat/webapp/ 目录中所有文件的权限
  3. 防火墙规则
  4. Hbase是否可用

但随后也出现以下异常。我正在使用包含 HBase 0.98.6CDH 5.3.1。有谁知道如何解决这个问题?

2015-03-03 05:09:02 privateLog [ERROR]          java.lang.reflect.InvocationTargetException     org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:413)
org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:306)
com.amazon.dao.MyDAO.<clinit>(SensorDataDAO.java:78)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
java.util.concurrent.FutureTask.run(FutureTask.java:166)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:724)
com.amazon.dao.MyDAO <clinit>

尝试建立连接的代码如下:

public class MyDAO {

protected static HConnection connection;


static {
Configuration conf = HBaseConfiguration.create();
conf.addResource("hbase-site.xml");
connection = HConnectionManager.createConnection(conf);
// connection object is still null at this point
try {
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

最佳答案

你能试着把它设置到你的 conf 中吗?

config.set("hbase.zookeeper.quorum", "zookeeper-ip:port");

如果这有效,那么我们可以检查您设置到 conf 中的 hbase-site.xml 是否具有正确的详细信息。

关于rest - 来自 org.apache.hadoop.hbase.client.HConnectionManager.createConnection 的 InvocationTargetException 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28816765/

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