configuring Hibernate, stripersist on eclipse

I have tried to use stripersist with mysql but was not successful.

I have copied sample code of stripes book , email23 , to eclipse and added res folder as source folder.

When I try to run the application I get the following error

SEVERE: Servlet.service() for servlet DispatcherServlet threw exception java.lang.NullPointerException at stripesbook.dao.impl.stripersist.BaseDaoImpl.read(BaseDaoImpl.java:46) at stripesbook.ext.MyActionBeanContext.getUser(MyActionBeanContext.java:60) at stripesbook.action.BaseActionBean.getUser(BaseActionBean.java:93) at stripesbook.action.ContactListActionBean.getContacts(ContactListActionBean.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.getValue(BeanELResolver.java:83) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54) at org.apache.el.parser.AstValue.getValue(AstValue.java:123) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:938) at org.apache.jsp.WEB_002dINF.jsp.contact_005flist_jsp._jspService(contact_005flist_jsp.java:177) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110) at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:483) at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158) at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99) at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113) at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74) at net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:477) at net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:293) at net.sourceforge.stripes.controller.DispatcherServlet.doPost(DispatcherServlet.java:177) at net.sourceforge.stripes.controller.DispatcherServlet.doGet(DispatcherServlet.java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:246) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680)

I have checked this thread, Help configuring Hibernate,Jpa, Stripesist on Stripes , but still have the problem

Any help is appreciated.

-------------Problems Reply------------

Your code is failing on the getEntityManager() that returns null:

45: public T read(ID id) {
46: return Stripersist.getEntityManager().find(entityClass, id);
47: }

This means that you don't have Hibernate/JPA configured correctly for your web application.

You might find this documentation helpful (although you can follow any Hibernate/JPA configuration guide, as the configuration is not Stripersist or Stripes specific): http://www.stripesframework.org/display/stripes/Hibernate+configuration

Category:hibernate Views:0 Time:2011-12-21

Related post

  • How to Configure Hibernate with Eclipse Galileo 2009-10-27

    Can someone tell me how to configure hibernate (Annotations) with Eclipse? --------------Solutions------------- To use hibernate annotations in Eclipse I just add a reference to the required jar (hibernate-annotations.jar). You will also need the hib

  • How to configure Hibernate Tools HQL editor in Eclipse with a custom NamingStrategy 2009-03-18

    I've installed Hibernate Tools 3.2.4.GA in Eclipse Ganymede. The main driver for installing it was to be able to issue HQL queries interactively. I have configured all of our mapping files, hibernate.properties, etc. and it shows all of our entities

  • how to configure hibernate 3.3 in eclipse galileo? 2010-02-12

    i am working on galileo but i am not able to find the plugin for hibernate 3.3 can anybody send me the plugin link please. it's urgent. and also send me the spring 2.x latest version plugin also. Thanks in advance, Bhuvan Yadav. --------------Solutio

  • How to install Hibernate Tools in Eclipse? 2008-12-09

    What is the proper way to install Hibernate Tools in Eclipse as a plugin? The Hibernate site doesn't really give any instructions. Looking at the Hibernate Tools binary HibernateTools-3.2.4.Beta1-R200810311334.zip, it appears that I can just unzip th

  • How to see SQL query using Hibernate Tools in Eclipse? 2008-12-09

    Having installed Hibernate Tools in Eclipse, how can I view the would-be generated SQL query of from the JPA query language? (I'm using Hibernate as my JPA implementation) My Java DAO class looks something like: public List<Person> findById(int

  • Error while running a hibernate program in eclipse 2011-01-20

    I was trying to run a hibernate sample in eclipse and I am getting Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig.classpathProvider I just uninstalled maven from eclipse but I think I need to make some changes in con

  • Help configuring Hibernate,Jpa, Stripesist on Stripes 2011-04-21

    I need some help configuring JPA Stripersist and Hibernate on a Stripes project I have the Stripersist.jar and JPA.jar, the book i have is not that clear about how to get the "correct" Hibernate jars(i just found so many on the hibernate website), an

  • can I configure hibernate properties to connect without using an instance name to sql server 2005? 2008-10-01

    Can I configure hibernate properties to connect without using an instance name to sql server 2005? I need to force it to use localhost as the hostname and not specify the instance (same as you can do with the sql server enterprise manager). Ta! T ---

  • Configure Hibernate to escape underscores in LIKE clause using SQL Server dialect 2008-11-17

    I have a SQL SELECT query which has a LIKE clause containing an underscore, which should specifically look for an underscore, not treat it as a wildcard: SELECT * FROM my_table WHERE name LIKE '_H9%'; I understand that I can change the actual clause

  • Configuring Hibernate logging using Log4j XML config file? 2009-01-12

    I haven't been able to find any documentation on how to configure Hibernate's logging using the XML style configuration file for Log4j. Is this even possible or do I have use a properties style configuration file to control Hibernate's logging? If an

  • How can I configure Hibernate to use SSL to talk to the DB server? 2009-08-13

    I have an existing java webapp that uses Hibernate for it's persistence. I've been told that I have to have to talk to the DB encrypted - so my first thought is to set it up to do the communication via SSL - and went through figured out how to set up

  • Configure Hibernate to obtain a fresh connection from a connection pool 2010-04-15

    How do I configure Hibernate so that each time I call sessionFactory.openSession() it connects with a new connection from the connection pool? The connection pool is managed by Websphere Application Server and is a JDBC Data Source. Thanks ----------

  • How to configure Hibernate database reverse engineering tool to map database table relation as a entites inheritance? 2010-04-30

    Is it possible to configure Hibernate reverse engineering and code generation tool in such a way that one-to-many relation between tables is mapped to entities inheritance instead of enrites relation? I have Person table and Employee table, which are

  • How to configure tomcat 7 in Eclipse 3.6 with jdk 1.6.0_20? 2010-09-26

    I'm having some problems configure tomcat 7 on Eclipse 3.6 . The enviroment is a notebook with o.s. Windows 7 Home Premium 64 bit. Before this upgrade i work succesfully with tomcat 6 on Eclipse 3.6 but my switch on the newer tomcat is an evil! I rep

  • How to add hibernate javadocs in Eclipse? 2010-09-28

    I am using Eclipse for the past two months. I didnt used javadocs in it before. Today i searched for hibernate javadocs and got hibernate-3.2.2.ga-javadoc.jar. But i dont know how to add it in eclipse. Any suggestions!! --------------Solutions-------

  • Configuring Hibernate.cfg.xml 2011-01-04

    How to tell to my Spring and here is my hibernate.cf.xml... I am getting this error. I have not configured anything in my application-context.xml Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found co

  • How do I configure Hibernate with a JPA 2.0 file? 2011-05-24

    Hibernate docs show very clearly how to configure Hibernate with XML. This is the snippet of code to do so: new Configuration().configure("catdb.cfg.xml") Now how do you configure Hibernate when instead of a hibernate configuration file, you have a J

  • Setting debug configuration for maven+jetty+eclipse 2011-10-24

    I have created a web app using maven in eclipse. I am using jetty for running the app. I am able to run the app using the maven jetty plugin. But I am facing difficulty while debugging the app - The steps that i have followed to setup debug settings

  • Setting Hibernate up in eclipse 2011-12-19

    I have a serious problem understanding how to set up hibernate using eclipse. I spent like 2 days already and cant figure it out. I downloaded Eclipse IDE for Java Developers, 128 MB. Now I have no freaking Idea how to install hibernate! I am also co

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.082 (s). 11 q(s)