Hey ich weiß nicht ob jemand hier erfahrung hat mit GWT jedenfalls ich habe ein problem mit dem Hibernate.
Ich habe jetzt alles vom client was mit hibernate zusammenhängt vom client paket getrennt ich erhalte aber trotzdem noch immer einen fehler beim erstellen der sessionfactory.
Hier meine sessionfactory:
Eigentlich alles normal und die klasse befindet sich auch am server also müsste ich auch alles machen können oder?
Hier noch meine Webshop GWT.xml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='webshop'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='project.client.Webshop'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
[/XML]
Hier noch die Fehlermeldung:
java.lang.NoClassDefFoundError: java.net.Socket is a restricted class. Please see the Google App Engine developer's guide for more details.
Dabei ist ja eigentlich klar dass es nicht unterstützt wird jedoch habe ich ein tutorial gefunden wo genau steht wie es gehen soll und bei mir gehts nicht.
Using GWT with Hibernate - Google Web Toolkit - Google Code
Im Bild sieht man den aufbau.
Wenn ich im falschen unterforum gepostet habe bitte melden.
Lg Vincenz
Ich habe jetzt alles vom client was mit hibernate zusammenhängt vom client paket getrennt ich erhalte aber trotzdem noch immer einen fehler beim erstellen der sessionfactory.
Hier meine sessionfactory:
Java:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package project.server.hibernate;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.SessionFactory;
import org.hibernate.tool.hbm2ddl.SchemaExport;
/**
* Hibernate Utility class with a convenient method to get Session Factory object.
*
* @author Administrator
*/
public class HibernateUtil_Postgres {
private static final SessionFactory sessionFactory;
static {
try {
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
cfg.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver");
cfg.setProperty("hibernate.connection.url", "jdbc:postgresql://localhost:5432/webshop");
cfg.setProperty("hibernate.connection.username", "postgres");
cfg.setProperty("hibernate.connection.password", "cisco");
cfg.setProperty("hibernate.show_sql", "true");
cfg.addAnnotatedClass(project.server.persistence.Adresse.class);
cfg.addAnnotatedClass(project.server.persistence.Bankverbindung.class);
cfg.addAnnotatedClass(project.server.persistence.Bestellposition.class);
cfg.addAnnotatedClass(project.server.persistence.Bestellung.class);
cfg.addAnnotatedClass(project.server.persistence.Bonitaet.class);
cfg.addAnnotatedClass(project.server.persistence.KreditkartenInfo.class);
cfg.addAnnotatedClass(project.server.persistence.Kunde.class);
cfg.addAnnotatedClass(project.server.persistence.Kundenstatistik.class);
cfg.addAnnotatedClass(project.server.persistence.Lieferant.class);
cfg.addAnnotatedClass(project.server.persistence.Mengenrabatt.class);
cfg.addAnnotatedClass(project.server.persistence.Plz.class);
cfg.addAnnotatedClass(project.server.persistence.Rabatt.class);
cfg.addAnnotatedClass(project.server.persistence.RechnungsAdresse.class);
cfg.addAnnotatedClass(project.server.persistence.Ware.class);
cfg.addAnnotatedClass(project.server.persistence.Zahlungsform.class);
cfg.addPackage("persistence");
SchemaExport se = new SchemaExport(cfg);
se.create(false, false);
sessionFactory=cfg.buildSessionFactory();
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
public static void shutdown() {
//Caches und Verbindungspools schließen
getSessionFactory().close();
}
}
Hier noch meine Webshop GWT.xml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='webshop'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='project.client.Webshop'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
[/XML]
Hier noch die Fehlermeldung:
java.lang.NoClassDefFoundError: java.net.Socket is a restricted class. Please see the Google App Engine developer's guide for more details.
Dabei ist ja eigentlich klar dass es nicht unterstützt wird jedoch habe ich ein tutorial gefunden wo genau steht wie es gehen soll und bei mir gehts nicht.
Using GWT with Hibernate - Google Web Toolkit - Google Code
Im Bild sieht man den aufbau.
Wenn ich im falschen unterforum gepostet habe bitte melden.
Lg Vincenz