Skip to main content

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

What application server are you running?  What version?  Is EclipseLink installed?

Based on your error message, it looks like you have TopLink Essentials but not EclipseLink.

org.eclipse.persistence.jpa.PersistenceProvider is the EclipseLink persistence provider and EclipseLink will need to be available to your app server to allow you to use it.

Recent versions of WebLogic, GlassFish, Spring, and some other app servers have EclipseLink available by default. Earlier versions have TopLink Essentials.

-Tom

dyamanoha wrote:
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!


Back to the top