-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: /hibernate.cfg.xml not found
PostPosted: Sat Dec 17, 2005 10:12 am 
Newbie

Joined: Thu Nov 24, 2005 8:17 am
Posts: 10
Hi All,
I am getting the error /hibernate.cfg.xml not found .I dont know exactly what the problem is.

Please help me out.
I am using Hibernate 3.0 ,Jboss 4.0.2 and MSSQL Server with Eclipse 3.1 IDE

The Trace is

org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1137)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1161)
at org.helpdesk.hibernate.HelpDeskHibernateSessionFactory.getFactory(HelpDeskHibernateSessionFactory.java:40)
at org.helpdesk.hibernate.HelpDeskTrancation.LoginUser(HelpDeskTrancation.java:29)
at org.helpdesk.ejb.HelpDeskSessionBean.LoginUser(HelpDeskSessionBean.java:105)
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:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy51.LoginUser(Unknown Source)
at com.helpdesk.Ticket.TicketMaster.LoginUser(TicketMaster.java:16)
at com.helpdesk.servlets.HelpDeskActionController.doPost(HelpDeskActionController.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
18:03:47,398 INFO [STDOUT] java.rmi.ServerException: RuntimeException; nested exception is:
org.hibernate.HibernateException: /hibernate.cfg.xml not found



The java code is in the package org.helpdesk.Hibernate

public static SessionFactory getFactory(Class classname)
{

//System.out.println("Dialect "+bundle.getString("DIALECT"));
Configuration cfg = new Configuration()
.addClass(EmployeeMaster.class)
.setProperty(Environment.DIALECT,"org.hibernate.dialect.SQLServerDialect")
.setProperty(Environment.DRIVER, "com.inet.tds.TdsDriver")
.setProperty(Environment.URL, "jdbc:inetdae7:Aedxb-ashkar:1433?database=Telecom_HelpDesk")
.setProperty(Environment.USER, "sa")
.setProperty(Environment.PASS,"sa")
.setProperty("hibernate.show_sql", "true");
factory = cfg.configure("/hibernate.cfg.xml").buildSessionFactory();

return factory;
}




My Hibernate.cfg.xml is in org.helpdesk Directory ,and the java code is in org.helpdesk.hibernate


Please help me out

Thanks a lot in advance
Mehdi


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 17, 2005 8:11 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
One possibility is that the hibernate.cfg.xml is in source, but may not be getting copied over to the binary directory from where the application is run.

Not sure if the / in front of the hibernate.cfg.xml works.

I usually don't specify the name, just do
config.configure().buildSessionFactory();


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 18, 2005 10:52 am 
Beginner
Beginner

Joined: Thu Dec 01, 2005 7:07 pm
Posts: 21
Copy ur xml file to the same dir as source code adn remove the / frm the path. once it works, use ../bla bla.. and set it up.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 1:18 am 
Newbie

Joined: Mon Jun 06, 2005 10:11 am
Posts: 14
Make sure the file is available in classpath from where the code is run. No need to give the file name unless you are giving different name other than "hibernate.cfg.xml".

/Ashwani


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 29, 2005 6:39 pm 
Newbie

Joined: Thu Dec 29, 2005 6:18 pm
Posts: 3
ashwanik wrote:
Make sure the file is available in classpath from where the code is run. No need to give the file name unless you are giving different name other than "hibernate.cfg.xml".

/Ashwani


Hi.

I've a similar problem w/ the location of the hibernate.cfg.xml file in the directory structure of an Eclipse plugin that I develop. Currently, it looks like this:

<my plug-in>/src/
<my plug-in>/bin/
<my plug-in>/hibernate.cfg.xml

The CLASSPATH has the standard definition for an Eclipse plug-in (w/ standard I mean the value defined by the wizard) and I expect that the plug-in root directory is included.

Any suggestion?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.