Can you post your actual test logic? I don't understand why do you need to go through the GWT servlets to do some unit testing of your DAO. It would be better to test the DAO logic separately.
On 8 Okt., 04:33, VrmpX <vrm...@gmail.com> wrote: > Hello, > > I'm currently using GWT 2.0.4 with Hibernate3, on Eclipse Helios, to > create a simple web application. So far, I'm able to reach the > database and do some RPC's to the server perfectly without any > problem. > > The problem arises whenever I try to test out my server classes (the > data access objects) with a JUnit test case. I've added the JUnit.jar > (JUnit 3) and modified the "Run As..." properties to include the /src > and /test folders in the classpath. Whenever I call my class methods I > get the following exception: > > Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: > org/slf4j/impl/StaticLoggerBinder > at > com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(Abstract > RemoteServiceServlet.java: > 62) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > ... > Caused by: java.lang.ExceptionInInitializerError > at com.ingsoftw.chat.util.HibernateUtil.<clinit>(HibernateUtil.java: > 16) > at > com.ingsoftw.chat.server.UserDAOImpl.getUserByNick(UserDAOImpl.java: > 15) > ... > Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/ > StaticLoggerBinder > at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223) > at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120) > at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java: > 111) > ... > Caused by: java.lang.ClassNotFoundException: > org.slf4j.impl.StaticLoggerBinder > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > > The HibernateUtil.java code is: > > public class HibernateUtil { > > private static final SessionFactory sessionFactory; > > static { > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new > Configuration().configure().buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + > ex); > throw new ExceptionInInitializerError(ex); > } > } > > public static SessionFactory getSessionFactory() { > return sessionFactory; > } > > } > > From what I understand, the problem lies on the fact that I haven't > added the sl4j.jar to the test server. Is the any way to do that? > > Thanks in advance! -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.