java - hibernate.cfg.xml not found error while running on server -
project run on local machine, after deploy on server hibernate.cfg.xml not found error.same war file deploy on local machine tomcat work.
2015-07-13 07:00:00 error jobrunshell:211 - job grppm.jobpm threw unhandled exception: org.hibernate.hibernateexception: hibernate.cfg.xml not found @ org.hibernate.internal.util.confighelper.getresourceasstream(confighelper.java:173) @ org.hibernate.cfg.configuration.getconfigurationinputstream(configuration.java:2095) @ org.hibernate.cfg.configuration.configure(configuration.java:2076) @ hibernet.hibernateconnection.getinstance(hibernateconnection.java:32) @ hibernet.hibernatedata.getconnection(hibernatedata.java:45) @ stockrefresh.script330.runscript(script330.java:34) @ stockrefresh330.execute(stockrefresh330.java:13) @ org.quartz.core.jobrunshell.run(jobrunshell.java:202) @ org.quartz.simpl.simplethreadpool$workerthread.run(simplethreadpool.java:573) 2015-07-13 07:00:00 error errorlogger:2425 - job (grppm.jobpm threw exception. org.quartz.schedulerexception: job threw unhandled exception. [see nested exception: org.hibernate.hibernateexception: hibernate.cfg.xml not found] @ org.quartz.core.jobrunshell.run(jobrunshell.java:213) @ org.quartz.simpl.simplethreadpool$workerthread.run(simplethreadpool.java:573) caused by: org.hibernate.hibernateexception: hibernate.cfg.xml not found @ org.hibernate.internal.util.confighelper.getresourceasstream(confighelper.java:173) @ org.hibernate.cfg.configuration.getconfigurationinputstream(configuration.java:2095) @ org.hibernate.cfg.configuration.configure(configuration.java:2076) @ hibernet.hibernateconnection.getinstance(hibernateconnection.java:32) @ hibernet.hibernatedata.getconnection(hibernatedata.java:45) @ stockrefresh.script330.runscript(script330.java:34) @ stockrefresh330.execute(stockrefresh330.java:13) @ org.quartz.core.jobrunshell.run(jobrunshell.java:202)
put hibernate.cfg.xml in classpath. , if don't want, use below context of xml file.
configuration configuration = new configuration();
configuration.configure("hibernate.cfg.xml");//here can give exact path w.r.t project`
Comments
Post a Comment