eclipselink

msp

Mitglied
Hallo,

ich versuche "frickele" gerade zum ersten mal mit jpa. leider komm ich einfach nicht weiter.

ich poste euch einfach mal was ich schon hab und die entsprechende fehlermeldung dazu.
Java:
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.extjs.gxt.ui.client.data.PagingLoadResult com.mycompany.project.client.DeviceService.getDevices(com.extjs.gxt.ui.client.data.PagingLoadConfig)' threw an unexpected exception: javax.persistence.PersistenceException: No Persistence provider for EntityManager named devices
	at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named devices
	at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
	at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
	at com.mycompany.project.server.PersitenceTest.<init>(PersitenceTest.java:16)
	at com.mycompany.project.server.DeviceServiceImpl.getDevices(DeviceServiceImpl.java:25)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
	... 22 more


persistence.xml
[XML]
<?xml version="1.0" encoding="UTF-8" ?>
<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"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="devices">
<class>com.mycompany.project.client.server.Device</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:postgres://192.168.2.183:5432/xxx" />
<property name="javax.persistence.jdbc.user" value="xxx" />
<property name="javax.persistence.jdbc.password" value="xx" />

</properties>

</persistence-unit>
</persistence>
[/XML]

Device.java
Java:
package com.mycompany.project.server;

import javax.persistence.*;

@Entity
public class Device {
	@Id
	String mac;
	String firmware;
	String comment;
	
	public String getFirmware() {
		return firmware;
	}
	public void setFirmware(String firmware) {
		this.firmware = firmware;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}

	@Override
	public String toString() {
		return "device [mac=" + mac + ", firmware=" + firmware + ", comment="+ comment +"]";
	}	
	
}



hier entsteht die Exception:
Java:
public class PersitenceTest {
	EntityManagerFactory factory;
	public PersitenceTest() {
	
	factory=Persistence.createEntityManagerFactory("devices");
		
	}
	
}


wie ihr seht bin ich noch nicht allzuweit gekommen :(


Ich hoffe euch reichen die Informationen um mir weiterzuhelfen. Danke schon mal im vorraus!


Mfg
MSP
 

MySelV

Aktives Mitglied
Hi,

in deiner Konfiguration fehlt in dem Tag <persistence-unit> etwas wie

[XML]<provider>org.hibernate.ejb.HibernatePersistence</provider>[/XML]

Musst du mal schauen, welchen du nutzen willst. Eclipselink hat glaube ich einen eigenen => Google

Grüße
 

Ähnliche Java Themen


Oben