makina_syu Posted October 30, 2009 Share Posted October 30, 2009 Hello everybody.I have problem setting hibernate connection, and I used every known "trick" to solve problem but without result.I set classpath to hibernate.cfg.xml and hibernate.properties, classpath to jar I'm using... I even tried to replace existing hibernate, hibernate-annotations and hibernate-commons-annotations in ireport/modules/ext directory.When I click Test button on hibernate connection I receive next error:Unable to load class declared as <mapping class="x.y.z"/> in the configuration.When I look to IDE Log I can see:org.hibernate.MappingException: Unable to load class declared as <mapping class="x.y.z"/> in the configuration:... Caused by: java.lang.ClassNotFoundException: x.y.z...Mentioned classes are on the path, but cannot be loaded.Did anyone have same problem?Thank you Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted November 2, 2009 Share Posted November 2, 2009 Are you sure the classes are in the classpath? Link to comment Share on other sites More sharing options...
tofa Posted October 7, 2010 Share Posted October 7, 2010 HiDid you found the solution for this?I have added both the path to the sources and class files in classpath in iReport...But still get this error. Code:  Compiling to file... C:\path\to\report\report.jasperCompilation running time: 1 028!  Filling report...  Locale: norsk (Norge)  Time zone: DefaultHibernate session openedError filling print... Unable to load class declared as <mapping class="no.package.model.Access"/> in the configuration:  org.hibernate.MappingException: Unable to load class declared as <mapping class="no.package.model.Access"/> in the configuration:     at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:650)     at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)     at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1047)     at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)     at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1035)     at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)     at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)     at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)     at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:64)     at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)     at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1011)     at com.jaspersoft.ireport.designer.connection.JRHibernateConnection.getSessionFactory(JRHibernateConnection.java:128)     at com.jaspersoft.ireport.designer.connection.JRHibernateConnection.createSession(JRHibernateConnection.java:121)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:928)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: java.lang.ClassNotFoundException: no.evote.model.Access     at java.net.URLClassLoader$1.run(Unknown Source)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(Unknown Source)     at java.lang.ClassLoader.loadClass(Unknown Source)     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)     at java.lang.ClassLoader.loadClass(Unknown Source)     at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)     at java.lang.ClassLoader.loadClass(Unknown Source)     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Unknown Source)     at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)     at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:647)     ... 17 more Print not filled. Try to use an EmptyDataSource... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now