Hi Isomorphic,
We were using Spring DMI till now in our project and everything was working very well.
We are trying to introduce the smartgwt servertype:hibernate stuff to our datasources.
We are using annotation to define our hibernate configs. So, I have not given any .cfg.xml file or mapping file
Below is our ds.xml file
I have defined hibernate config in our server.properties file
hibernate.config.lookupStyle:spring
hibernate.config.bean:sessionFactory
If I use beanConfig in the ds.xml, datasource loads up and everything works fine. If I take that out from ds.xml file then I get a Null pointer exception.
Am I missing something?? Can somebody help me out please??
We were using Spring DMI till now in our project and everything was working very well.
We are trying to introduce the smartgwt servertype:hibernate stuff to our datasources.
We are using annotation to define our hibernate configs. So, I have not given any .cfg.xml file or mapping file
Code:
@Entity @Table(name = "STD_MATL_USE") @AttributeOverride(name="guid", column=@Column(name="STD_MATL_USE_SK")) public class StandardMaterialUse extends AbstractDomainObject { /** * Generated */ private static final long serialVersionUID = -1484851182779890075L; @Type(type = "org.hibernate.type.NumericBooleanType") @Column(name = "STAT_IND", nullable = false) private Boolean statusIndicator; @Column(name = "STD_MATL_USE_NM", nullable = false, length = 100) private String name; @Column(name = "STD_MATL_USE_DESC", length = 500) private String abbreviation; }
Code:
<DataSource ID="materialUseDatasource" serverType="hibernate" beanClassName="xxx.StandardMaterialUse" >
hibernate.config.lookupStyle:spring
hibernate.config.bean:sessionFactory
If I use beanConfig in the ds.xml, datasource loads up and everything works fine. If I take that out from ds.xml file then I get a Null pointer exception.
Code:
javax.servlet.ServletException: java.lang.NullPointerException at com.isomorphic.hibernate.HibernateDataSource.init(HibernateDataSource.java:191) at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:165) at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:337) at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110) at com.isomorphic.datasource.DataSource.forName(DataSource.java:156) at com.isomorphic.datasource.DataSource.forName(DataSource.java:148) at com.isomorphic.datasource.DataSource.forName(DataSource.java:143) at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95) at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102) at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82) at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:62) at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:81) at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:64)
Comment