Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA: Toplink / Eclipselink works in Netbeans, not as standalone .JAR

Hi all, I have been stuck on this one for the past 2 days. I am trying to run
our server by executing it as a single .jar -- so far I can only get this to
work through netbeans, and honestly, I don't know what Netbeans is doing
that I'm not.

Here's the error I'm getting when I try to run this via the jar:

No Persistence provider for EntityManager named game_pu: The following
providers: oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider



Here's my persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";>
  <persistence-unit name="game_pu" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>com.novel.tech1.gatewayServer.model.AvatarCombatantModel</class>
    <class>com.novel.tech1.gatewayServer.model.AvatarModel</class>
    <class>com.novel.tech1.gatewayServer.model.BattleModel</class>
    <class>com.novel.tech1.gatewayServer.model.CityModel</class>
    <class>com.novel.tech1.gatewayServer.model.EmpireCombatantModel</class>
    <class>com.novel.tech1.gatewayServer.model.EmpireModel</class>
    <class>com.novel.tech1.gatewayServer.model.TileModel</class>
    <class>com.novel.tech1.gatewayServer.model.UserModel</class>
    <class>com.novel.tech1.gatewayServer.model.WorldModel</class>
    <class>com.novel.tech1.gatewayServer.model.NaturalResourceModel</class>
    <shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode>
    <properties>
      <property name="javax.persistence.jdbc.url" value="..."/>
      <property name="javax.persistence.jdbc.password" value="..."/>
      <property name="javax.persistence.jdbc.driver" value="..."/>
      <property name="javax.persistence.jdbc.user" value="..."/>
    </properties>
  </persistence-unit>
</persistence>



Examining my uber jar's "jar tf", I have references to:

oracle/toplink/essentials/PersistenceProvider.class (toplink is present.)
org/eclipse/persistence/jaxb/xjc/MOXyXJC$Listener.class (eclipselink is
present.)
META-INF/persistence.xml (The persistence.xml should be in the correct
place.)



Additional info that may be relevant:
1. We created our own manifest file to specify the server's entry point, it
only the main-class attribute is defined.
2. We are using Maven to build our project.

Any ideas?

Thanks in advance! 
-- 
View this message in context: http://old.nabble.com/JPA%3A-Toplink---Eclipselink-works-in-Netbeans%2C-not-as-standalone-.JAR-tp29528473p29528473.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top