1 Reply Latest reply on Dec 8, 2010 5:53 AM by mike just

    How to find hibernate.properties

    mike just Master

      Using JBoss 6.0.0.CR1, currently, I removed the hibernate related jars from my ear\lib directory. But the problem is the hibernate.cfg.xml can not be found. I changed the api to specify the absolute path to look for hibernate.cfg.xml and it succeeds.

      Configuration cfg =

      new Configuration().configure(HibernateUtil.

      class.getResource("/classes/hibernate.cfg.xml"));

       

      but the next problem is the hibernate.proerties file which is required by hibernate.cfg.xml can not be found. I do not find there is any place in the code that I can modify to specify the path to find it. So I shoot a question here. Does anybody have an answer to this?

       

      Note: my hibernate.cfg.xml and hibernate.properties are located at .ear\lib\classes.

       

      I guessed it is because jboss is using jboss' hibernate jar which should be located at \common\lib to load hibernate.cfg.xml (that is why the default method new Configuration().configure() can not find the hibernate.cfg.xml in the first time).

       

        • 1. Re: How to find hibernate.properties
          mike just Master

          Putting the log trace here in  case someone knows what the problem is.

           

          18:45:12,750 WARN  [RootClass] composite-id class does not override hashCode(): com.globalsight.everest.page.pageimport.TemplateFormat
          18:45:12,765 WARN  [UserSuppliedConnectionProvider] No connection properties specified - the user must supply JDBC connections
          18:45:12,765 INFO  [STDOUT] org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available
          18:45:12,781 INFO  [STDOUT]     at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:106)
          18:45:12,796 INFO  [STDOUT]     at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:152)
          18:45:12,796 INFO  [STDOUT]     at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
          18:45:12,796 INFO  [STDOUT]     at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
          18:45:12,796 INFO  [STDOUT]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
          18:45:12,796 INFO  [STDOUT]     at com.globalsight.persistence.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:64)
          18:45:12,796 INFO  [STDOUT]     at com.globalsight.everest.page.PageManagerLocal.cleanupUpdatingPages(PageManagerLocal.java:805)
          18:45:12,796 INFO  [STDOUT]     at com.globalsight.everest.page.PageManagerWLRMIImpl.cleanupUpdatingPages(PageManagerWLRMIImpl.java:439)
          18:45:12,796 INFO  [STDOUT]     at com.globalsight.everest.page.PageManagerWLRMIImpl.init(PageManagerWLRMIImpl.java:82)
          18:45:12,828 INFO  [STDOUT]     at com.globalsight.everest.util.system.SystemControlTemplate.processCommand(SystemControlTemplate.java:215)
          18:45:12,828 INFO  [STDOUT]     at com.globalsight.everest.util.system.SystemControlTemplate.startup(SystemControlTemplate.java:89)
          18:45:12,859 INFO  [STDOUT]     at com.globalsight.everest.util.system.Envoy.startup(Envoy.java:170)
          18:45:12,859 INFO  [STDOUT]     at com.globalsight.everest.util.system.AmbassadorServer.startup(AmbassadorServer.java:231)
          18:45:12,906 INFO  [STDOUT]     at com.globalsight.everest.servlet.ControlServlet.<clinit>(ControlServlet.java:111)
          18:45:12,906 INFO  [STDOUT]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          18:45:12,906 INFO  [STDOUT]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          18:45:12,906 INFO  [STDOUT]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          18:45:12,906 INFO  [STDOUT]     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
          18:45:12,906 INFO  [STDOUT]     at java.lang.Class.newInstance0(Class.java:355)
          18:45:12,906 INFO  [STDOUT]     at java.lang.Class.newInstance(Class.java:308)
          18:45:12,906 INFO  [STDOUT]     at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:284)
          18:45:12,906 INFO  [STDOUT]     at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:268)
          18:45:12,937 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1162)
          18:45:12,937 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108)
          18:45:12,953 INFO  [STDOUT]     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3628)
          18:45:12,953 INFO  [STDOUT]     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3851)
          18:45:12,984 INFO  [STDOUT]     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312)
          18:45:12,984 INFO  [STDOUT]     at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:149)
          18:45:13,031 INFO  [STDOUT]     at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
          18:45:13,031 INFO  [STDOUT]     at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
          18:45:13,062 INFO  [STDOUT]     at org.jboss.web.deployers.WebModule.start(WebModule.java:95)
          18:45:13,062 INFO  [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          18:45:13,093 INFO  [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          18:45:13,093 INFO  [STDOUT]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          18:45:13,171 INFO  [STDOUT]     at java.lang.reflect.Method.invoke(Method.java:597)
          18:45:13,171 INFO  [STDOUT]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
          18:45:13,187 INFO  [STDOUT]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
          18:45:13,187 INFO  [STDOUT]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          18:45:13,218 INFO  [STDOUT]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
          18:45:13,218 INFO  [STDOUT]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
          18:45:13,250 INFO  [STDOUT]     at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
          18:45:13,250 INFO  [STDOUT]     at $Proxy41.start(Unknown Source)
          18:45:13,343 INFO  [STDOUT]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53)
          18:45:13,343 INFO  [STDOUT]     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41)
          18:45:13,359 INFO  [STDOUT]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
          18:45:13,359 INFO  [STDOUT]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
          18:45:13,375 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
          18:45:13,375 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
          18:45:13,453 INFO  [STDOUT]     at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301)
          18:45:13,453 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
          18:45:13,453 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
          18:45:13,453 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
          18:45:13,500 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
          18:45:13,500 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
          18:45:13,578 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894)
          18:45:13,578 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641)
          18:45:13,625 INFO  [STDOUT]     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182)
          18:45:13,625 INFO  [STDOUT]     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58)
          18:45:13,687 INFO  [STDOUT]     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
          18:45:13,687 INFO  [STDOUT]     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55)
          18:45:13,703 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
          18:45:13,703 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832)
          18:45:13,703 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550)
          18:45:13,734 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571)
          18:45:13,734 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603)
          18:45:13,796 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491)
          18:45:13,796 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
          18:45:13,875 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
          18:45:13,875 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
          18:45:13,953 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
          18:45:13,953 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
          18:45:14,000 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
          18:45:14,000 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
          18:45:14,031 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
          18:45:14,046 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983)
          18:45:14,046 INFO  [STDOUT]     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076)
          18:45:14,062 INFO  [STDOUT]     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
          18:45:14,125 INFO  [STDOUT]     at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106)
          18:45:14,125 INFO  [STDOUT]     at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:130)
          18:45:14,203 INFO  [STDOUT]     at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:148)
          18:45:14,203 INFO  [STDOUT]     at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94)
          18:45:14,234 INFO  [STDOUT]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
          18:45:14,234 INFO  [STDOUT]     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
          18:45:14,250 INFO  [STDOUT]     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
          18:45:14,265 INFO  [STDOUT]     at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
          18:45:14,343 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
          18:45:14,343 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379)
          18:45:14,421 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044)
          18:45:14,421 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083)
          18:45:14,437 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322)
          18:45:14,437 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246)
          18:45:14,546 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139)
          18:45:14,546 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939)
          18:45:14,562 INFO  [STDOUT]     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654)
          18:45:14,562 INFO  [STDOUT]     at org.jboss.profileservice.dependency.ProfileServiceController.activate(ProfileServiceController.java:188)
          18:45:14,625 INFO  [STDOUT]     at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:170)
          18:45:14,625 INFO  [STDOUT]     at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:117)
          18:45:14,703 INFO  [STDOUT]     at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:89)
          18:45:14,703 INFO  [STDOUT]     at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:97)
          18:45:14,718 INFO  [STDOUT]     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:130)
          18:45:14,718 INFO  [STDOUT]     at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56)
          18:45:14,734 INFO  [STDOUT]     at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827)
          18:45:14,734 INFO  [STDOUT]     at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417)