【问题标题】:Using datanucleus-rest with HBASE将 datanucleus-rest 与 HBASE 一起使用
【发布时间】:2011-08-07 19:47:32
【问题描述】:

我正在尝试让datanucleus REST service (2.0.1) 与HBASE (0.90.2) 一起运行。

但是,当访问 servlet(注册工作)时,我得到一个 503:

HTTP 错误 503

访问 /dn/ 时出现问题。原因:

org.datanucleus.exceptions.NucleusUserException: There is no
available StoreManager of type "rdbms". Make sure that you have put
the relevant DataNucleus store plugin in your CLASSPATH and if
defining a connection via JNDI or DataSource you also need to provide
persistence property "datanucleus.storeManagerType"

我的 persistence.xml 如下所示:

<persistence-unit name="test">
    <provider>org.datanucleus.api.jdo.JDOPersistenceManagerFactory</provider>
    <class>com.bla.MyClass</class>
    <exclude-unlisted-classes />
    <properties>
        <property name="datanucleus.storeManagerType" value="hbase" />
        <property name="datanucleus.ConnectionURL" value="hbase" />
        <property name="datanucleus.ConnectionUserName" value="" />
        <property name="datanucleus.ConnectionPassword" value="" />
        <property name="datanucleus.autoCreateTables" value="true" />
        <property name="datanucleus.autoCreateColumns" value="true" />
        <property name="datanucleus.Multithreaded" value="true" />
    </properties>
</persistence-unit>

但我不确定

的值
  • 提供者
  • datanucleus.storeManagerType

谁能给我一个提示我可能错的地方或指向我一些关于此的文档?

【问题讨论】:

  • 尤其是 的值在所有示例中似乎都是“org.datanucleus.api.jpa.PersistenceProviderImpl”。
  • Provider 必须是:org.datanucleus.api.jpa.PersistenceProviderImpl 并且不需要 datanucleus.storeManagerType。也不要忘记使持久性单元名称属性与 web.xml 中指定的相同

标签: java hbase datanucleus


【解决方案1】:

Provider 无关紧要,因为后端使用 JDO; persistence.xml 只是简单地定义连接、属性(如果需要,还可以定义类)。

datanucleus.storeManagerType 也无关紧要,因为只有当您使用 JNDI 指定连接时,按照文档中的明确说明。

因此,您的类路径中没有 datanucleus-hbase 和依赖 jar 之一。

显然查看日志可能会有所帮助。我可以将 DataNucleus v3 REST 与 HBase 一起使用,完全没有问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-08
    • 2016-07-16
    • 1970-01-01
    相关资源
    最近更新 更多