Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

java.lang.NullPointerException at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.

Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi All,
I am new to Hibernate . I know the concept .
Now i am designing a applicaton using Hibernate .

I am getting a error , while creating a configuration object .

StackTrace :

May 26, 2012 6:47:36 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet CreateUserServlet threw exception
at org.hibernate.util.ConfigHelper.getResourceAsStream(
at org.hibernate.cfg.Environment.<clinit>(
at org.hibernate.cfg.Configuration.reset(
at org.hibernate.cfg.Configuration.<init>(
at org.hibernate.cfg.Configuration.<init>(
at com.jitu.core.HibernateUtil.sessionFactory(
at com.jitu.http.server.CreateUserServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(

Code :

//Configuration cfg = new Configuration().configure("Hibernate.cfg.xml");
Configuration cfg = new Configuration().addResource("com/jitu/core/Book.hbm.xml")
.setProperty("hibernate.dialect", "org.hibernate.dialect.HSQLDialect")
.setProperty("hibernate.connection.driver_class", "oracle.jdbc.driver.OracleDrive")
.setProperty("hibernate.connection.url", "jdbc:oracle:thin:@TRAINHR1011:1521:RETAILS")
.setProperty("hibernate.connection.username", "fcr")
.setProperty("hibernate.connection.password", "fcr");
SessionFactory sessionFactry = cfg.buildSessionFactory();
Session session = sessionFactry.getCurrentSession();

Please help .

Posts: 4109
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't duplicate posts. Continue the discussion in your other thread.
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic