DeejUK
DeejUK

Reputation: 13471

DataNucleus, HBase, JDO: "A property named javax.jdo.PersistenceManagerFactoryClass must be specified"

I'm getting an exception ("A property named javax.jdo.PersistenceManagerFactoryClass must be specified") when trying to follow the DataNucleus HBase tutorial.

My datanucleus.properties file (below) doesn't specify such a property, but then nor does the tutorial, and nor does the DataNucleus HBase sample.

Edited after finding the 3.1 sample:

src/main/resources/datanucleus.properties

javax.jdo.option.ConnectionURL=hbase:hx1:60010
javax.jdo.option.Mapping=hbase

datanucleus.metadata.validate=false
datanucleus.autoCreateSchema=true
datanucleus.validateTables=false
datanucleus.validateConstraints=false

src/main/java/hbase-site.xml

<?xml version="1.0"?>

<configuration> 
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>hx1:2181</value>
    <description>The host and port that the HBase master runs at.
    </description>
  </property>
</configuration>

src/main/com.business.model/package-hbase.xml

<?xml version="1.0"?>
<!DOCTYPE orm PUBLIC 
    "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" 
    "http://java.sun.com/dtd/orm_2_0.dtd">
<orm>
    <package name="com.business.model">
        <class name="Recommendation" table="Recommendations">
            <field name="id" column="ID"/>
            <field name="documents" column="DOCUMENTS"/>
        </class>

        <class name="Document">
            <field name="id" column="ID"/>
            <field name="title" column="TITLE"/>
        </class>
    </package>
</orm>

Any ideas what I'm missing? I'm new to JDO after having worked with JPA for a few years.

Upvotes: 1

Views: 3276

Answers (1)

Krzysztof Zielinski
Krzysztof Zielinski

Reputation: 400

I never tried a HBase tutorial but you have to have javax.jdo.PersistenceManagerFactoryClass property defined. Mine is defined in persistence.xml file (src/main/resources). Property definition:

<property name="javax.jdo.PersistenceManagerFactoryClass"
            value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory" />

You can also define this property when creating PMF.

More details are at: http://db.apache.org/jdo/pmf.html

Upvotes: 6

Related Questions