-->
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.  [ 6 posts ] 
Author Message
 Post subject: org.dom4j.DocumentException: Operation timed out
PostPosted: Wed Mar 01, 2006 5:53 pm 
Newbie

Joined: Wed Mar 01, 2006 4:37 pm
Posts: 3
I am having intermittent problems with my Hibernate XML files. I believe this may be related to a network issue in resolving the DTD URL, but am not convinced that is the problem (because it works sometimes). Here is part of my stack trace. We are using Spring, but I don't know that that is complicating the issue (I don't think it is):

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [selfservice-ejb-beans.xml]: Can't resolve reference to bean 'sessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [selfservice-ejb-beans.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: org.dom4j.DocumentException: Operation timed out: connect:could be due to invalid address Nested exception: Operation timed out: connect:could be due to invalid address

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [selfservice-ejb-beans.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: org.dom4j.DocumentException: Operation timed out: connect:could be due to invalid address Nested exception: Operation timed out: connect:could be due to invalid address

org.hibernate.MappingException: org.dom4j.DocumentException: Operation timed out: connect:could be due to invalid address Nested exception: Operation timed out: connect:could be due to invalid address

at java.lang.Throwable.<init>(Throwable.java)

at org.hibernate.exception.NestableRuntimeException.<init>(NestableRuntimeException.java:111)

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:408)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:621)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)

at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:80)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)

at org.springframework.context.access.ContextJndiBeanFactoryLocator.createBeanFactory(ContextJndiBeanFactoryLocator.java:86)

at org.springframework.context.access.ContextJndiBeanFactoryLocator.useBeanFactory(ContextJndiBeanFactoryLocator.java:70)

at org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(AbstractEnterpriseBean.java:117)

at org.springframework.ejb.support.AbstractStatelessSessionBean.ejbCreate(AbstractStatelessSessionBean.java:63)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)

at java.lang.reflect.Method.invoke(Method.java)

at com.ibm.ejs.container.StatelessBeanO.<init>(StatelessBeanO.java:145)

at com.ibm.ejs.container.CMStatelessBeanOFactory.create(CMStatelessBeanOFactory.java:40)

at com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:686)

at com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:773)

at com.ibm.ejs.container.activator.UncachedActivationStrategy.atActivate(UncachedActivationStrategy.java:78)

at com.ibm.ejs.container.activator.Activator.activateBean(Activator.java:516)

at com.ibm.ejs.container.EJSContainer.preInvoke_internal(EJSContainer.java:2792)

at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2503)

at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2488)


Here is a snippet from my .hbm.xml file:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

To test if the network was the issue, I updated my Windows HOSTS file to point all traffic to hibernate.sourceforge.net to 127.0.0.1 (thus eliminating the possibility of being able to successfully resolve http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd), but the initialization of my mapping file still worked properly. Then I read about how sometimes it could be resolving the DTD from the Hibernate JAR, so I deleted the DTDs (hibernate-mapping and hibernate-configuration) from the JAR in my server classpath, but it was still able to initialize the mapping file properly.

At this point, I think I would like to try resolving the DTD locally rather than using a URL. Does anyone know how to do this easily without having to create an XML catalog? Ideally, it'd be nice if I could put the DTD right next to my hbm.xml files so that it would be checked in right next to the hbm.xml file and I wouldn't have to worry about how the DTD will be resolved locally in all of the environments we have.


Top
 Profile  
 
 Post subject: read this
PostPosted: Wed Mar 01, 2006 6:08 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
The thread may answer you
http://forum.hibernate.org/viewtopic.ph ... tyresolver

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 7:50 pm 
Newbie

Joined: Wed Mar 01, 2006 4:37 pm
Posts: 3
Thanks for the information. I'll give it a shot soon.

Can anyone shed some more light on whether the DTD is resolved through the Hibernate JAR if it's on your classpath? How does that process work? Or does the parser always go to the URL to resolve the DTD?


Top
 Profile  
 
 Post subject: locally
PostPosted: Wed Mar 01, 2006 7:56 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
normally DTD gets resolved locally unless some weirdness in classloader/xml parser prevents that...

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 8:08 pm 
Newbie

Joined: Wed Mar 01, 2006 4:37 pm
Posts: 3
When you say locally do you mean via a JAR file entry (even if the DOCTYPE specifies http://..../file.dtd)? So if I delete the DTD from the JAR on the classpath will it go to the URL to resolve the DTD?


Top
 Profile  
 
 Post subject: meaning
PostPosted: Thu Mar 02, 2006 1:32 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Generally yes, from jar file. But that is actually up to XML EntityResolver implementation, yes, it should go to the net if it cannot resolve it locally.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.