java - why getting “No Persistence provider for EntityManager” when running with jnlp while standalone jar works fine -


environment win 8.1 mysql server: localhost netbeans 7.4 java: 1.7.0_51 (j2se) jre: 1.7.0_51-b31 eclipselink(jpa 2.1)

there several posts asking “no persistence provider entitymanager named…” error. developing j2se (not j2ee). however, problems seem silly troubles me 2days. need other software standalone program work? why oaky when run program under netbeans ide? sort of environment setting issue failed try?

working snapshot , eclipselink message! enter image description here

i use netbeans write code, , runs okay. now, decided copy whole standalone package out “d:\netbeanswork\projcosttracking\dist”. have change security setting medium in java control panel. then, double-clicked on projcosttracking.jnlp launch. well, see.

enter image description here

this persistence.xml

    <?xml version="1.0" encoding="utf-8"?>     <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">       <persistence-unit name="projcosttrackingpu" transaction-type="resource_local">         <provider>org.eclipse.persistence.jpa.persistenceprovider</provider>         <class>projcosttracking.entityuserlevel</class>         <class>projcosttracking.entityuser</class>         <properties>           <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/biotechcost?zerodatetimebehavior=converttonull"/>           <property name="javax.persistence.jdbc.password" value="1234"/>           <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.driver"/>           <property name="javax.persistence.jdbc.user" value="root"/>         </properties>       </persistence-unit>     </persistence> 

the entity files enter image description here

the generated files , lib enter image description here enter image description here

as persistence.xml, copy 3 places make sure can “seen”. enter image description here

as classpath, copied required jar files (from projcosttracking\dist\lib) lib folder under default jdk , jre. java suppose see jars. enter image description here enter image description here

usually connector issue. seems eclipse not using right connector. check connector version. should match version of mysql database.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -