ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Chiucchi" <s.chiuc...@gmail.com>
Subject Re: java.net.UnknownHostException: www.ibatis.com
Date Tue, 25 Apr 2006 21:59:42 GMT
Ed,
I modified the host as you suggested, but I got the following exception:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException
parsing XML document from class path resource [geeg-data-orm-sqlmap.xml];
nested exception is java.net.ConnectException: Connection refused: connect

java.net.ConnectException: Connection refused: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:329)

at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:194)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:181)

at java.net.Socket.connect(Socket.java:459)

at java.net.Socket.connect(Socket.java:409)

at sun.net.NetworkClient.doConnect(NetworkClient.java:157)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:414)

at sun.net.www.http.HttpClient.openServer(HttpClient.java:628)

at sun.net.www.http.HttpClient.<init>(HttpClient.java:331)

at sun.net.www.http.HttpClient.<init>(HttpClient.java:292)

at sun.net.www.http.HttpClient.New(HttpClient.java:364)

at sun.net.www.http.HttpClient.New(HttpClient.java:345)

at sun.net.www.http.HttpClient.New(HttpClient.java:340)

at sun.net.www.protocol.http.HttpURLConnection.plainConnect(
HttpURLConnection.java:506)

at sun.net.www.protocol.http.HttpURLConnection.connect(
HttpURLConnection.java:497)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(
HttpURLConnection.java:599)

at java.net.URL.openStream(URL.java(Inlined Compiled Code))

at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)

at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)

at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)

at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)

at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
(XmlBeanDefinitionReader.java:161)

at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
(AbstractBeanDefinitionReader.java:125)

at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
(AbstractBeanDefinitionReader.java:141)

at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions
(AbstractXmlApplicationContext.java:113)

at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions
(AbstractXmlApplicationContext.java:81)

at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory
(AbstractRefreshableApplicationContext.java:89)

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

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

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

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.AbstractMessageDrivenBean.ejbCreate(
AbstractMessageDrivenBean.java:76)

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

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

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

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

at com.ibm.ejs.container.MessageDrivenBeanO.<init>(MessageDrivenBeanO.java
:137)

at com.ibm.ejs.container.CMMessageDrivenBeanO.<init>(
CMMessageDrivenBeanO.java:67)

at com.ibm.ejs.container.CMMessageDrivenBeanOFactory.create(
CMMessageDrivenBeanOFactory.java:39)

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

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

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
:2777)

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

at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:87)

at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)

at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:373)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
It seems that the DTD is searched on the internet, instead of beeing read
from the iBatis jar file. Maybe there's something wrong in the way Spring
initializes iBatis? Or it could be a classloader problem? I can't imagine
another reasons....

Thanks in advance for any suggestion.

Simone.

On 4/25/06, Ed Griebel <edgriebel@gmail.com> wrote:
>
> You need to change the host to ibatis.apache.org as ibatis is now
> hosted there. I don't know for sure, but my guess is that it was not
> picking up the DTD in the jar file because your dtd declaration didn't
> match the DTD in the jar. Examine the dtd inside the ibatis jar file
> for what to set it to, if it does not work right away.
>
> HTH,
> -ed
>
> On 4/24/06, Simone Chiucchi <s.chiucchi@gmail.com> wrote:
> >
> >
> > Hello!
> > I'm using iBatis 2.1.5 in a 1.3 J2EE project, and is is activated by
> Spring
> > 1.2.5.
> >
> > The iBatis and Spring jars are placed in a lib folder of the ear
> project,
> > visible to all the modules.
> > The J2EE project also contains a web module, an ejb module and a java
> > utility jar.
> > The war classloader policy is set to APPLICATION, so there is the same
> > classloader for all the modules of the ear.
> >
> > It happens that when the Spring/iBatis initialization is triggered by
> the
> > web module (via the web application user interface) it's alright.
> > Instead, if the frameworks are initialized by the ejb module, by
> starting a
> > listener port of an MDB, I get the exception in the subject:
> >
> > IOException parsing XML document from class path resource
> > [geeg-data-orm-sqlmap.xml]; nested exception is
> > java.net.UnknownHostException: www.ibatis.com
> >
> > That's just the from the URI
> > (http://www.ibatis.com/dtd/sql-map-config-2.dtd )
> > referencing the DTD used by iBatis for XML validation.
> >
> > Since iBatis is version 2.1.5, it should be able to resolve that DTD
> URI.
> >
> > The problem happens both from the IDE (WSAD) Unit Test Environment and
> > deploying the ear file on WebSphere 5.1.1.4.
> >
> > The only workaround I found to make the application to run correctly
> under
> > the WSAD unit test environment have been to modify:
> >
> >
> > <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
> "
> > http://www.ibatis.com/dtd/sql-map-config-2.dtd" >
> >
> > with:
> >
> >
> > <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0
> //EN"
> > "sql-map-config-2.dtd">
> >
> > and putting the DTD file in the WSAD installation directory.
> >
> > But it can't be the solution when finally deploying to a production
> > applicatione server !!!
> >
> > Why the DTD inside the iBatis jar is not read? It is possible that the
> > classloader I'm using at the moment of the problem is a parent to the
> one
> > that loads the iBatis jar?
> >
> > I've tryed to follow the advices posted to questions similar to mine,
> but I
> > didn't get results.
> >
> > Hence, any help would be greatly appreciated.
> >
> > Thanks, Simone.
> >
> >
> >
>

Mime
View raw message