https://blogs.oracle.com/arungupta/entry/java_ee_6_and_nosqlの例に取り組んでいます。
モデル src へのリンクは次のとおりですhttp://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.nosql.mongo/src/
問題を引き起こしている部分は次のとおりです。
EntityManagerFactory factory;
...
test.factory = Persistence.createEntityManagerFactory("mongo");
EntityManager em = test.factory.createEntityManager();
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager が呼び出されると、
SEVERE: javax.persistence.PersistenceException: Exception [EclipseLink-7108] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.ValidationException
Exception Description: This operation is not supported for non-relational platforms.
私が使用しているすべての依存関係は次のとおりです。
<classpath>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/javax/javaee-web-api/6.0/javaee-web-api-6.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.jar"/>
<classpathentry kind="var" path="M2_REPO/asm/asm/3.1/asm-3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/sun/jersey/jersey-core/1.8/jersey-core-1.8.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mongodb/mongo-java-driver/2.7.3/mongo-java-driver-2.7.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.oracle.nosql/2.4.0/org.eclipse.persistence.oracle.nosql-2.4.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/javax.persistence/2.0.4.v201112161009/javax.persistence-2.0.4.v201112161009.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.asm/3.3.1.v201206041142/org.eclipse.persistence.asm-3.3.1.v201206041142.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.antlr/3.2.0.v201206041011/org.eclipse.persistence.antlr-3.2.0.v201206041011.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.jpa.jpql/2.4.0/org.eclipse.persistence.jpa.jpql-2.4.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.core/2.4.0/org.eclipse.persistence.core-2.4.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.nosql/2.4.0/org.eclipse.persistence.nosql-2.4.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/persistence/org.eclipse.persistence.jpa/2.4.0/org.eclipse.persistence.jpa-2.4.0.jar"/>
</classpath>
サーバーはGlassFish Server Open Source Edition 3です。他の人のために機能したサンプルコードからすべてコピーしたときに、createEntityManagerが許可されない理由がわかりません??