Announcement Announcement Module
Collapse
No announcement yet.
Deployment error with Hibernate and connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deployment error with Hibernate and connection

    I can connect to my mySql DB with the admin client and the db is there and accessible via the username/password I have configured.

    I get the following error when I deploy my first Hibernate deployment:

    11:11:14,169 ERROR [Configuration] Could not configure datastore from input stream
    org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
    at org.dom4j.io.SAXReader.read(SAXReader.java:353)
    at org.hibernate.cfg.Configuration.addInputStream(Con figuration.java:395)
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:608)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java
    :962)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:354)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:223)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:271)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:312)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java
    :134)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:230)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:156)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3669)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4104)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
    at sun.reflect.GeneratedMethodAccessor178.invoke(Unkn own Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.modeler.BaseModelMBean.invoke(B aseModelMBean.java:503)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDy namicInvoker.java:150)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:644)
    at org.apache.catalina.core.StandardContext.init(Stan dardContext.java:5005)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.modeler.BaseModelMBean.invoke(B aseModelMBean.java:503)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDy namicInvoker.java:150)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:644)
    at org.jboss.web.tomcat.tc5.TomcatDeployer.performDep loyInternal(TomcatDeployer.java:274)
    at org.jboss.web.tomcat.tc5.TomcatDeployer.performDep loy(TomcatDeployer.java:91)
    at org.jboss.web.AbstractWebDeployer.start(AbstractWe bDeployer.java:357)
    at org.jboss.web.WebModule.startModule(WebModule.java :68)
    at org.jboss.web.WebModule.startService(WebModule.jav a:46)
    at org.jboss.system.ServiceMBeanSupport.jbossInternal Start(ServiceMBeanSupport.java:272)
    at org.jboss.system.ServiceMBeanSupport.jbossInternal Lifecycle(ServiceMBeanSupport.java:222)
    at sun.reflect.GeneratedMethodAccessor184.invoke(Unkn own Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation .java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:644)
    at org.jboss.system.ServiceController$ServiceProxy.in voke(ServiceController.java:897)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceCo ntroller.java:418)
    at sun.reflect.GeneratedMethodAccessor10.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation .java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:177)
    at $Proxy28.start(Unknown Source)
    at org.jboss.web.AbstractWebContainer.start(AbstractW ebContainer.java:394)
    at org.jboss.deployment.MainDeployer.start(MainDeploy er.java:964)
    at org.jboss.deployment.MainDeployer.start(MainDeploy er.java:956)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:775)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:738)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation .java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invok e(AbstractInterceptor.java:121)
    at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterc eptor.invoke(ModelMBeanOperationInterceptor.java:1 27)
    at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:177)
    at $Proxy8.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner. deploy(URLDeploymentScanner.java:325)
    at org.jboss.deployment.scanner.URLDeploymentScanner. scan(URLDeploymentScanner.java:483)
    at org.jboss.deployment.scanner.AbstractDeploymentSca nner$ScannerThread.doScan(AbstractDeploymentScanne r.java:204)
    at org.jboss.deployment.scanner.AbstractDeploymentSca nner$ScannerThread.loop(AbstractDeploymentScanner. java:215)
    at org.jboss.deployment.scanner.AbstractDeploymentSca nner$ScannerThread.run(AbstractDeploymentScanner.j ava:194)



    Here are my relevent pieces:
    ======================
    jdbc.properties:
    jdbc.url=jdbc:mysql://localhost:3306/devdb
    jdbc.username=user1
    jdbc.password=password1
    hibernate.dialect=org.hibernate.dialect.MySQLDiale ct

    My appContextHibernate.xl:
    ==================

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location"><value>/WEB-INF/classes/jdbc.properties</value></property>
    </bean>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="driverClassName"><value>${jdbc.driverClassNa me}</value></property>
    <property name="url"><value>${jdbc.url}</value></property>
    <property name="username"><value>${jdbc.username}</value></property>
    <property name="password"><value>${jdbc.password}</value></property>
    </bean>


    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource"><ref local="dataSource"/></property>
    <property name="mappingResources">
    <value>ff.hbm.xml</value>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">${hibernate.dialect}</prop>
    <prop key="hibernate.show_sql">true</prop>
    </props>
    </property>
    <property name="eventListeners">
    <map>
    <entry key="merge">
    <bean class="org.springframework.orm.hibernate3.support. IdTransferringMergeEventListener"/>
    </entry>
    </map>
    </property>
    </bean>

  • #2
    Looks like your SAX parser is trying to download a DTD. Take a look at http://www.hibernate.org/116.html#A35
    This means that your XML parser does not support the EntityResolver callback that Hibernate uses to resolve the mapping DTD from inside hibernate3.jar. Either use a different XML parser, such as a recent version of Xerces, or edit your mapping documents to use a SYSTEM id instead of the PUBLIC id that we recommend in the documentation.
    You can do this by copying the Xerces JAR to the "jre\lib\ext" directory of your JDK installation

    Comment

    Working...
    X