SCJP 6.0
nimesh hindocha wrote:I am getting following exception...
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
nimesh hindocha wrote:Hi
I want to know how to do hibernate configuration in this servlet based hibernate application.
SCJP 6.0
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:80)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:62)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:460)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:155)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at mypack.PdServlet.init(PdServlet.java:35)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
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:857)
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(Unknown Source)
java.lang.NullPointerException
at mypack.PdServlet.doPost(PdServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
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.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:857)
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(Unknown Source)
SCJP 6.0
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
below is my configuration file. Please give some way.so how i can direct it to hibernate.cfg.xml file from web.xml for configuration.
SCJP 6.0
SCJP 6.0
..so how i can direct it to hibernate.cfg.xml file from web.xml for configuration....
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
if you use in a real application you might bind the hibernate service to JNDI in the server startup, initialized in a listener etc...
SCJP 6.0
SCJP 6.0
nimesh hindocha wrote:Thanks Vijitha for your reply.
I wanted to know if i keep hibernate.cfg.xml file directly inside the WEB-INF/classes do i have to write context path in server.xml file and i would also like to know second approach which you have mentioned
if you use in a real application you might bind the hibernate service to JNDI in the server startup, initialized in a listener etc...
again thanks for reply...
org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
Look ma! I'm selling my stuff!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|