将 datanucleus-rest 与 HBASE 结合使用
我正在尝试运行 datanucleus REST 服务 (2.0.1)与 HBASE (0.90.2)。
然而,当访问 servlet(注册有效)时,我收到 503:
HTTP 错误 503
访问 /dn/ 时出现问题。原因:
org.datanucleus.exceptions.NucleusUserException:没有 可用的“rdbms”类型的 StoreManager。确保您已放置 CLASSPATH 中的相关 DataNucleus 存储插件,如果 通过 JNDI 或 DataSource 定义连接,您还需要提供 持久化属性“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
。任何人都可以给我一个提示,我可能错了,或者给我指出一些有关此问题的文档?
I am trying to get the datanucleus REST service (2.0.1) running with HBASE (0.90.2).
When accessing the servlet (registering works) however, I am getting a 503:
HTTP ERROR 503
Problem accessing /dn/. Reason:
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"
My persistence.xml looks like this:
<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>
I am unsure however with the values for
- provider
- datanucleus.storeManagerType
Can anyone give me a hint where I might be wrong or point me to some documentation about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Provider 是无关紧要的,因为后端使用 JDO; persistence.xml 只是定义连接、属性(以及类,如果需要)。
datanucleus.storeManagerType 也是无关紧要的,因为只有当您使用 JNDI 指定连接时,正如文档明确指出的那样。
因此,您的类路径中没有 datanucleus-hbase 和依赖 jar 之一。
显然查看日志可能会有所帮助。我可以将 DataNucleus v3 REST 与 HBase 一起使用,完全没有问题
Provider is irrelevant since the backend uses JDO; persistence.xml is simply to define the connection, properties (and classes if required).
datanucleus.storeManagerType is irrelevant too, since that is only when you specify the connection using JNDI, as per what the docs say clearly.
So you don't have datanucleus-hbase, and one of the dependent jars in your classpath.
Obviously looking at the log may help. I can use DataNucleus v3 REST with HBase no problem at all