Hello Everybody, i am making a web application which is based on GWT instantiation.. at server end i want to use hibernate for accessing database but when i run it on eclipse 3.2 having GWT instantiation plug in(after writing all the code of client side and server side including use of hibernate)it is giving this error
Error is org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
which comes for these lines in the server side code
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); Session session =sessionFactory.openSession(); Manager manager = new Manager(session); user=manager.searchUser(username);
where user is object of database entity and manager is the class which access the database ...
what i think that when i run this as GWT application on eclipse 3.2 it is giving this error due to absence of hibernate lib at server end i am not so clear... if somebody will help me i will be thankful to him... please reply soonn....
No there is only single exception that a written previously... i have used try catch on the code written above session etc.. i think it is due to because server does not find hibernate library at its end
Hmm. You are probably hidding some of the stacktrace; stacetraces in Java are never one-liners. It unlikely to be down to a missing library, there is a specific error (NoClassDefFoundError) for that sort of issue. Edvins has called it right I think, there is something wrong with your hibernate.cfg.xml. Looking at it though it loks like valid XML and appears to conform to the DTD. Is User.hbm.xml valid and deployed to the correct place?
hibernate.cfg.xml web.xml Hibernate_library (Library for hibernate) Mysql_Library (Library for mysql dbms) Jre_system_library (Library for jdk) Gwt library (Library for gwt designer)
i am mapping the User entity in User.java and User.hbm.xml.. the error that i told you was coming when i dont add mysql mibrary in my project.. but when i add it also in my project the error is coming
[ERROR] Failure to load module 'com.innvy.home.register.register' java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.kind()I at com.google.gwt.dev.jdt.TypeOracleBuilder.isInterface(TypeOracleBuilder.java:481) at com.google.gwt.dev.jdt.TypeOracleBuilder.processType(TypeOracleBuilder.java:531) at com.google.gwt.dev.jdt.TypeOracleBuilder.access$000(TypeOracleBuilder.java:93) at com.google.gwt.dev.jdt.TypeOracleBuilder$2.visit(TypeOracleBuilder.java:410) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1007) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:305) at com.google.gwt.dev.jdt.TypeOracleBuilder.build(TypeOracleBuilder.java:395) at com.google.gwt.dev.cfg.ModuleDef.getTypeOracle(ModuleDef.java:294) at com.google.gwt.dev.cfg.ModuleDef.refresh(ModuleDef.java:359) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:86)
i want to implement GWT RPC and simultaneously want to access database at server side(registerServiceImpl.java) using hibernate.. i think now a make clear almost of my project.. if somebody could help me the i will be thankful to him..