You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@entity @table(name="p1",schema="kundera@kundera_mongo_pu" )//schema="kundera@kundera_mongo_pu" @access(AccessType.PROPERTY)
public class P1 implements Serializable{
/**
*
*/
private static final long serialVersionUID = -3861925441255623432L;
private String id;
private String productname;
private Date createDate;
private Integer type;
@Id
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Column
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname;
}
@Column
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
P1 other = (P1) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
//persist object exception
2013-8-1 22:01:38 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean createNativeEntityManagerFactory
信息: Building JPA container EntityManagerFactory for persistence unit 'kundera_mongo_pu'
2013-8-1 22:01:38 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@10f11b8: defining beans [p1Dao,entityManagerFactory]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.samtech.jpa.base.dao.P1Dao.main(P1Dao.java:38)
Caused by: java.lang.NullPointerException
at com.impetus.kundera.configure.MetamodelConfiguration.processGeneratedValueAnnotation(MetamodelConfiguration.java:490)
at com.impetus.kundera.configure.MetamodelConfiguration.scanClassAndPutMetadata(MetamodelConfiguration.java:399)
at com.impetus.kundera.configure.MetamodelConfiguration.loadEntityMetadata(MetamodelConfiguration.java:230)
at com.impetus.kundera.configure.MetamodelConfiguration.configure(MetamodelConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:65)
The text was updated successfully, but these errors were encountered:
@entity
@table(name="p1",schema="kundera@kundera_mongo_pu" )//schema="kundera@kundera_mongo_pu"
@access(AccessType.PROPERTY)
public class P1 implements Serializable{
}
//persistence.xml
com.impetus.kundera.KunderaPersistence
com.samtech.jpa.domain.P1
//persist object exception
2013-8-1 22:01:38 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean createNativeEntityManagerFactory
信息: Building JPA container EntityManagerFactory for persistence unit 'kundera_mongo_pu'
2013-8-1 22:01:38 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@10f11b8: defining beans [p1Dao,entityManagerFactory]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1117)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:922)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.samtech.jpa.base.dao.P1Dao.main(P1Dao.java:38)
Caused by: java.lang.NullPointerException
at com.impetus.kundera.configure.MetamodelConfiguration.processGeneratedValueAnnotation(MetamodelConfiguration.java:490)
at com.impetus.kundera.configure.MetamodelConfiguration.scanClassAndPutMetadata(MetamodelConfiguration.java:399)
at com.impetus.kundera.configure.MetamodelConfiguration.loadEntityMetadata(MetamodelConfiguration.java:230)
at com.impetus.kundera.configure.MetamodelConfiguration.configure(MetamodelConfiguration.java:102)
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65)
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109)
at com.impetus.kundera.KunderaPersistence.createEntityManagerFactory(KunderaPersistence.java:81)
at com.impetus.kundera.KunderaPersistence.createContainerEntityManagerFactory(KunderaPersistence.java:65)
The text was updated successfully, but these errors were encountered: