iReport Spring loaded Hibernate connection
i'm experiencing difficulties while trying to create a report using iReport via a Spring loaded Hibernate connection because i'm using spring. the problem is when i try to create a database connection i chose Spring loaded Hibernate connection ireport asks me to give the name of Spring configuration file and the session factory bean id, for Spring configuration: application-context.xml, session factory bean id: sessionFactory. but when i test the connection ireport diplays this error message:
nested exception is java.io.FileNotFoundException:class path resource[application-context] cannot be开发者_如何转开发 opened because it does not exist
best regards.
You need to go to Tools/Options/ClassPath, and add the folder that contains your configuration file.
Then in the dataset configuration, enter in just the filename for the spring configuration. You must enter the entire filename, so it would be "application-context.xml".
You seem to have left off the file extension.
You need to follow these steps
1: First go to Tools->Options->iReport->Classpath location
In this tab you need to add Folder location which contains your applicationContext.xml.
2: Add the Same version of Spring and Hibernate Jar files also.And don't add unwanted jar files because it will create some other problems.
3: Now Open Datasources dialog and Click New –> Spring loaded Hibernate Connection.
4:Configure Connection name,Spring Configuration should be
applicationContext.xml and your session factory Bean ID.
Still have any doubt Check the Screenshot in below url
http://www.techpages.org/ireport/spring-loaded-hibernate-connection/2460/
精彩评论