Hi, läute,
ich brauch mal eure Hilfe da ich alle Konstellationen durch habe hier mein Exception
Code:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ExceptionInInitializerError
at de.AlbenloginSystem.databaseConnaction.HibernateUtil.buildSessionFactory(HibernateUtil.java:17)
at de.AlbenloginSystem.databaseConnaction.HibernateUtil.<clinit>(HibernateUtil.java:8)
at de.AlbenloginSystem.AlbenloginSystemMain.postInit(AlbenloginSystemMain.java:27)
at com.gluonhq.particle.application.ParticleApplication.start(ParticleApplication.java:113)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:128)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:301)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:452)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
at de.AlbenloginSystem.databaseConnaction.HibernateUtil.buildSessionFactory(HibernateUtil.java:13)
... 12 more
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:91)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:385)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:519)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:124)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)
... 19 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88)
... 28 more
Caused by: org.hibernate.PropertyNotFoundException: Could not locate getter method for property [de.AlbenloginSystem.model.bean.TracksBean#ALBUM_T]
at org.hibernate.internal.util.ReflectHelper.findGetterMethod(ReflectHelper.java:418)
at org.hibernate.property.access.internal.PropertyAccessBasicImpl.<init>(PropertyAccessBasicImpl.java:41)
at org.hibernate.property.access.internal.PropertyAccessStrategyBasicImpl.buildPropertyAccess(PropertyAccessStrategyBasicImpl.java:27)
at org.hibernate.mapping.Property.getGetter(Property.java:308)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:254)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:58)
... 33 more
Process finished with exit code 1
Profil 1:n Alben 1:n Track
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="de.AlbenloginSystem.model.bean.ProfilBean" table="PROFILE_T">
<id name="idProfile_t" column="IDPROFILE_T" type="integer">
<generator class="native"/>
</id>
<property name="benutzer" column="BENUTZER" type="string" not-null="true"/>
<property name="password" column="PASSWORD" type="string"/>
<set name="album_t" cascade="all" lazy="true">
<key column="PROFILE_T_IDPROFILE"/>
<one-to-many class="de.AlbenloginSystem.model.bean.AlbumsBean"/>
</set>
</class>
</hibernate-mapping>
Code:
public class ProfilBean {
private int idProfile_t ;
private String benutzer;
private String password;
private Set Albums = new HashSet();
public ProfilBean(){
}
public ProfilBean(int idProfile_t, String benutzer, String password) {
this.idProfile_t = idProfile_t;
this.benutzer = benutzer;
this.password = password;
}
public int getIdProfile_t() {
return idProfile_t;
}
public void setIdProfile_t(int idProfile_t) {
this.idProfile_t = idProfile_t;
}
public String getBenutzer() {
return benutzer;
}
public void setBenutzer(String benutzer) {
this.benutzer = benutzer;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Set getAlbums() {
return Albums;
}
public void setAlbums(Set albums) {
Albums = albums;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="de.AlbenloginSystem.model.bean.AlbumsBean" table="ALBUM_T">
<id name="idAlbum_t" column="IDALBUM_T" type="integer">
<generator class="native"/>
</id>
<property name="name" column="NAME" type="string" not-null="true"/>
<property name="bandName" column="BANDNAME" type="string" not-null="true"/>
<property name="erscheinungsJahr" column="ERSCHEINUNGSJAHR" type="string" not-null="true"/>
<many-to-one name="profile_t" column="IDPROFILE_T" class="de.AlbenloginSystem.model.bean.ProfilBean"/>
<set name="idTracks_t" cascade="all" lazy="true">
<key column="IDALBUM_T"/>
<one-to-many class="de.AlbenloginSystem.model.bean.TracksBean"/>
</set>
</class>
</hibernate-mapping>
Code:
public class AlbumsBean {
private int idAlbum_t;
private String name;
private String bandName;
private String erscheinungsJahr;
private Set ProfilBean = new HashSet();
private Set TracksBean = new HashSet();
public AlbumsBean() {
}
public AlbumsBean(int idAlbum_t, String name, String bandName, String erscheinungsJahr, Set profilBean, Set tracksBean) {
this.idAlbum_t = idAlbum_t;
this.name = name;
this.bandName = bandName;
this.erscheinungsJahr = erscheinungsJahr;
ProfilBean = profilBean;
TracksBean = tracksBean;
}
public int getIdAlbum_t() {
return idAlbum_t;
}
public void setIdAlbum_t(int idAlbum_t) {
this.idAlbum_t = idAlbum_t;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBandName() {
return bandName;
}
public void setBandName(String bandName) {
this.bandName = bandName;
}
public String getErscheinungsJahr() {
return erscheinungsJahr;
}
public void setErscheinungsJahr(String erscheinungsJahr) {
this.erscheinungsJahr = erscheinungsJahr;
}
public Set getProfilBean() {
return ProfilBean;
}
public void setProfilBean(Set profilBean) {
ProfilBean = profilBean;
}
public Set getTracksBean() {
return TracksBean;
}
public void setTracksBean(Set tracksBean) {
TracksBean = tracksBean;
}
}
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="de.AlbenloginSystem.model.bean.TracksBean" table="Tracks_T">
<id name="idTracks_t" column="IDTRACKS" type="integer">
<generator class="native"/>
</id>
<property name="titel" column="TITEL" type="string" not-null="true"/>
<property name="dauer" column="DAUER" type="string" not-null="true"/>
<property name="live" column="LIVE" type="java.lang.Boolean" not-null="true"/>
<property name="musikerAnzahl" column="MUSIKERANZAHL" type="integer" not-null="true"/>
<many-to-one name="ALBUM_T" column="ALBUM_T_IDALBUM_T" class="de.AlbenloginSystem.model.bean.AlbumsBean"/>
</class>
</hibernate-mapping>
Code:
public class TracksBean {
private int idTracks_t;
private String titel;
private String dauer;
private boolean live;
private int musikerAnzahl;
public TracksBean() {
}
public TracksBean(int idTracks_t, String titel, String dauer, boolean live, int musikerAnzahl) {
this.idTracks_t = idTracks_t;
this.titel = titel;
this.dauer = dauer;
this.live = live;
this.musikerAnzahl = musikerAnzahl;
}
public int getIdTracks_t() {
return idTracks_t;
}
public void setIdTracks_t(int idTracks_t) {
this.idTracks_t = idTracks_t;
}
public String getTitel() {
return titel;
}
public void setTitel(String titel) {
this.titel = titel;
}
public String getDauer() {
return dauer;
}
public void setDauer(String dauer) {
this.dauer = dauer;
}
public boolean isLive() {
return live;
}
public void setLive(boolean live) {
this.live = live;
}
public int getMusikerAnzahl() {
return musikerAnzahl;
}
public void setMusikerAnzahl(int musikerAnzahl) {
this.musikerAnzahl = musikerAnzahl;
}
}
habe die hbm.xml ohne <many -to-one> blabla getestet und läuft normal mit <many -to-one> blabla dann nicht mähr
danke für die Hilfe im voraus.