Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 35004 invoked from network); 26 Apr 2006 13:37:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2006 13:37:27 -0000 Received: (qmail 87707 invoked by uid 500); 26 Apr 2006 13:37:24 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 87694 invoked by uid 500); 26 Apr 2006 13:37:24 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 87683 invoked by uid 99); 26 Apr 2006 13:37:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 06:37:24 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of edgriebel@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO pproxy.gmail.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 06:37:23 -0700 Received: by pproxy.gmail.com with SMTP id b36so437681pyb for ; Wed, 26 Apr 2006 06:37:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=A2hhXY4SRn94BJeexEYN3F4gnWahrlrzP0c25kTaDL5bi1HxLpOhqTfRmjyXHCYtLs9L/kXS3KnqkwKV3pUewS+eZDCyXwbp3qHJE54gNbfst6cnQvQBwrw7Q1C+Ac6ZCIn5L9Rt7+OOd4uVnRIPtyEtn7dSvRqgtDbmj3Y7+4o= Received: by 10.35.40.10 with SMTP id s10mr590010pyj; Wed, 26 Apr 2006 06:37:02 -0700 (PDT) Received: by 10.35.82.12 with HTTP; Wed, 26 Apr 2006 06:37:02 -0700 (PDT) Message-ID: Date: Wed, 26 Apr 2006 09:37:02 -0400 From: "Ed Griebel" To: user-java@ibatis.apache.org Subject: Re: java.net.UnknownHostException: www.ibatis.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Sorry, I don't know enough about Spring to be able to help you. In my experience with Struts and tomcat, jboss, and weblogic, DTDs are looked up automatically in the JARs that are in the WAR/EAR file as long as the DTD spec in the XML file matches EXACTLY the decl at the top of the DTD file in the jar. -ed On 4/25/06, Simone Chiucchi wrote: > > 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.(HttpClient.java:331) > > at sun.net.www.http.HttpClient.(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(HttpURLConnectio= n.java:506) > > at > sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.jav= a:497) > > at > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnect= ion.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(Unkn= own > Source) > > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknow= n > 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.loadBeanDef= initions(XmlBeanDefinitionReader.java:161) > > at > org.springframework.beans.factory.support.AbstractBeanDefinitionReader.lo= adBeanDefinitions(AbstractBeanDefinitionReader.java:125) > > at > org.springframework.beans.factory.support.AbstractBeanDefinitionReader.lo= adBeanDefinitions(AbstractBeanDefinitionReader.java:141) > > at > org.springframework.context.support.AbstractXmlApplicationContext.loadBea= nDefinitions(AbstractXmlApplicationContext.java:113) > > at > org.springframework.context.support.AbstractXmlApplicationContext.loadBea= nDefinitions(AbstractXmlApplicationContext.java:81) > > at > org.springframework.context.support.AbstractRefreshableApplicationContext= .refreshBeanFactory(AbstractRefreshableApplicationContext.java:89) > > at > org.springframework.context.support.AbstractApplicationContext.refresh(Ab= stractApplicationContext.java:268) > > at > org.springframework.context.support.ClassPathXmlApplicationContext.= (ClassPathXmlApplicationContext.java:81) > > at > org.springframework.context.support.ClassPathXmlApplicationContext.= (ClassPathXmlApplicationContext.java:66) > > at > org.springframework.context.access.ContextJndiBeanFactoryLocator.createBe= anFactory(ContextJndiBeanFactoryLocator.java:86) > > at > org.springframework.context.access.ContextJndiBeanFactoryLocator.useBeanF= actory(ContextJndiBeanFactoryLocator.java:70) > > at > org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(Ab= stractEnterpriseBean.java:117) > > at > org.springframework.ejb.support.AbstractMessageDrivenBean.ejbCreate(Abstr= actMessageDrivenBean.java:76) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :79) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java(Compiled > Code)) > > at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) > > at > com.ibm.ejs.container.MessageDrivenBeanO.(MessageDrivenBeanO.java:1= 37) > > at > com.ibm.ejs.container.CMMessageDrivenBeanO.(CMMessageDrivenBeanO.ja= va:67) > > at > com.ibm.ejs.container.CMMessageDrivenBeanOFactory.create(CMMessageDrivenB= eanOFactory.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(Unc= achedActivationStrategy.java:78) > > at > com.ibm.ejs.container.activator.Activator.activateBean(Activator.java:516= ) > > at > com.ibm.ejs.container.EJSContainer.preInvoke_internal(EJSContainer.java:2= 777) > > 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 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 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 sam= e > > > 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 an= d > > > 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: > > > > > > > > > 2.0//EN" " > > > http://www.ibatis.com/dtd/sql-map-config-2.dtd" > > > > > > > with: > > > > > > > > > 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 th= e > > > 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. > > > > > > > > > > > > >