From fhopkins@example.org Tue Feb 01 17:36:10 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 82794 invoked from network); 1 Feb 2011 17:36:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2011 17:36:09 -0000 Received: (qmail 19791 invoked by uid 500); 1 Feb 2011 17:36:08 -0000 Delivered-To: fhopkins@example.org Received: (qmail 19527 invoked by uid 500); 1 Feb 2011 17:36:06 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 19519 invoked by uid 99); 1 Feb 2011 17:36:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 17:36:05 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO a.mail.sonic.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 17:35:56 +0000 Received: from [83.161.120.155] (75-101-5-130.dsl.static.sonic.net [83.161.120.155]) (authenticated bits=0) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id p11HZW7P012051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <fhopkins@example.org>; Tue, 1 Feb 2011 09:35:33 -0800 Message-ID: <fhopkins@example.org> Date: Tue, 01 Feb 2011 09:35:31 -0800 From: Mike Power <fhopkins@example.org> Reply-To: fhopkins@example.org User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:83.161.120.155) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: fhopkins@example.org Subject: [configuration] ConfigurationConverter differing behavior for ints and strings Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Curiosity question I am seeing the ConfigurationConverter behave differently depending on if I added an int or a string to a configuration object. Consider the following code: 01 Configuration confInt = new BaseConfiguration(); 02 Configuration confString = new BaseConfiguration(); 03 confInt.setProperty("port", 80); 04 confString.setProperty("port", "80"); 05 assertEquals(80, confInt.getInt("port")); 06 assertEquals(80, confString.getInt("port")); 07 08 Properties propString = ConfigurationConverter.getProperties(confString); 09 assertEquals("80", propString.getProperty("port")); 10 11 Properties propInt = ConfigurationConverter.getProperties(confInt); 12 13 assertEquals("80", propInt.getProperty("port")); As you can see the code is basically duplicated one set uses an int the other set uses a String. However an exception blows out of line 11. 'port' doesn't map to a List object: 80, a java.lang.Integer org.apache.commons.configuration.ConversionException: 'port' doesn't map to a List object: 80, a fhopkins@example.org(AbstractConfiguration.java:1144) at org.apache.commons.configuration.AbstractConfiguration.getList(AbstractConfiguration.java:1109) at org.apache.commons.configuration.ConfigurationConverter.getProperties(ConfigurationConverter.java:116) It seems for some reason since I used an int, the ConfigurationConverter wants to treat the property as a list. However since I actually put an integer into the property it errors out since it can not convert a integer to a list. This behavior seems odd. Why does it do this? Mike Power --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Tue Feb 01 18:21:18 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 8167 invoked from network); 1 Feb 2011 18:21:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2011 18:21:17 -0000 Received: (qmail 28098 invoked by uid 500); 1 Feb 2011 18:21:16 -0000 Delivered-To: fhopkins@example.org Received: (qmail 27670 invoked by uid 500); 1 Feb 2011 18:21:13 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 27653 invoked by uid 99); 1 Feb 2011 18:21:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 18:21:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-ew0-f43.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 18:21:04 +0000 Received: by ewy22 with SMTP id 22so4566305ewy.30 for <fhopkins@example.org>; Tue, 01 Feb 2011 10:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:from:date:message-id :subject:to:content-type; bh=Npuv8okXAOOu1Z5Retjf9gdM1yaOHY6eriVhVVwhYPU=; b=m1mymAZUisN6cUqp4py8R1YxEk25GMtmcA1WIJLdqo7ZYx5w4RO5wLzjN9wmNDPf2u Ucui6HlTpx2QrklXtuY/2FbxwJU1Ed4SPtekPCPVGfkEm9AJgQW5LCA8SkrafRq7eFjE xxCn+QNVM4PQ0dEH8OZ67Sg0TL8qDXiakxxOo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; b=RDMsomBRmaH55p5bF/sq+IOVSuNWp5GcUb1Rq+kCtZUIjOc1uApRxKnVqnmKa8Vmhc Nn9ecV0p9R1vm0SC2WhDtNd+5KUSuba5dwYLFuK+dfcQBfGeXj3YrtaIEu+R8I/eg8E/ oc7q8Gz3MP55ZczoTcrsuFaqTNsnbplkgxLF0= Received: by 83.161.120.155 with SMTP id y7mr98981eba.94.1296584444174; Tue, 01 Feb 2011 10:20:44 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with HTTP; Tue, 1 Feb 2011 10:20:23 -0800 (PST) Reply-To: fhopkins@example.org From: Aleksandr Bissekerskij <fhopkins@example.org> Date: Tue, 1 Feb 2011 20:20:23 +0200 Message-ID: <fhopkins@example.org> Subject: [jxpath] using AbstractFactory with Map in XPath To: fhopkins@example.org Content-Type: multipart/mixed; boundary=000e0cd6d29c3760a9049b3c9746 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd6d29c3760a9049b3c9746 Content-Type: multipart/alternative; boundary=000e0cd6d29c376093049b3c9744 --000e0cd6d29c376093049b3c9744 Content-Type: text/plain; charset=UTF-8 Hi, I have a problem with JXPath which I suppose is something that is not supported yet, though it's looks like a bug. I'm using AbstractFactory implementation to create missing objects in XPath when setting properties. (see http://commons.apache.org/jxpath/users-guide.html#Creating_Objects). Everything works fine as long as missing objects are Bean-like objects, or any Collections. But if missing object is one of objects in Map<K,V> problems begin. Here is my issue (please find complete code of used classes and working example attached): public class Parent { private String name; private Map<String, Child> children; } public class Child { private String sex; private int age; } public class JXPathMap { public static void main (String[] args) { Parent p = new Parent("Dad"); p.setChildren(new LinkedHashMap<String, Child>() {{ put("Bobby", new Child("Male", 9)); put("Steven", null); put("Sandra", new Child("Female", 12)); }}); JXPathContext context = JXPathContext.newContext(p); context.setFactory(new AbstractFactory() { @Override public boolean createObject(JXPathContext context, Pointer pointer, Object parent, String name, int index) { System.out.println("parent: " + parent); System.out.println("name: " + name); System.out.println("index: " + index); return super.createObject(context, pointer, parent, name, index); } }); context.createPathAndSetValue("children/Steven/age", 4); } } * * this code results as following: *parent: {Bobby=Child[sex=Male, age=9], Steven=null, Sandra=Child[sex=Female, age=12]} name: Steven index: 0* Exception in thread "main" org.apache.commons.jxpath.JXPathException: Exception trying to create xpath children/Steven/age; Factory could not create an object for path: /children[@name='Steven'] at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPathAndSetValue(JXPathContextReferenceImpl.java:549) at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPathAndSetValue(JXPathContextReferenceImpl.java:533) at tests.xpath.JXPathMap.main(JXPathMap.java:29) Caused by: org.apache.commons.jxpath.JXPathAbstractFactoryException: Factory could not create an object for path: /children[@name='Steven'] at org.apache.commons.jxpath.ri.model.dynamic.DynamicPropertyPointer.createPath(DynamicPropertyPointer.java:230) at org.apache.commons.jxpath.ri.model.beans.NullPointer.createPath(NullPointer.java:100) at org.apache.commons.jxpath.ri.model.beans.NullPropertyPointer.createPath(NullPropertyPointer.java:138) at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.setValue(JXPathContextReferenceImpl.java:584) at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPathAndSetValue(JXPathContextReferenceImpl.java:546) ... 2 more * * I must mention that *context.createPathAndSetValue("children/Bobby/age", 4)*works fine - sets Bobby's age to 4. In case of missing object is element of collection - everything works fine, I would get *Parent* as parent object, * children* as property that has missing object and *index* so i know where to put my newly created object. In case of Map I don't get enough information to instantiate missing object. "Steven" as property name is most surprising. Exception is OK, cause nothing is created by factory. I suppose that AbstractFactory should have separate method in case of Map element is missed. JXPath easily detects that it is Map because setting * "children/Bobby/age"* works as expected. * *I'm quite sure that I will post this to issue tracking system, but first I'd like to ask if anybody had similar issue? may be i am missing something important? Any comments are appreciated. Regards, Aleksandr --000e0cd6d29c376093049b3c9744 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,<br><br>I have a problem with JXPath which I suppose is something that i= s not supported yet, though it&#39;s looks like a bug.<br><br>I&#39;m using= AbstractFactory implementation to create missing objects in XPath when set= ting properties. (see <a href=3D"http://commons.apache.org/jxpath/users-gui= de.html#Creating_Objects">http://commons.apache.org/jxpath/users-guide.html= #Creating_Objects</a>). Everything works fine as long as missing objects ar= e Bean-like objects, or any Collections. But if missing object is one of ob= jects in Map&lt;K,V&gt; problems begin. Here is my issue (please find compl= ete code of used classes and working example attached):<br> <br><br><font size=3D"1">public class Parent {<br>=C2=A0=C2=A0=C2=A0 privat= e String name;<br>=C2=A0=C2=A0=C2=A0 private Map&lt;String, Child&gt; child= ren;<br>}<br><br>public class Child {<br>=C2=A0=C2=A0=C2=A0 private String = sex;<br>=C2=A0=C2=A0=C2=A0 private int age;<br>}<br><br>public class JXPath= Map {<br> <br>=C2=A0=C2=A0=C2=A0 public static void main (String[] args) {<br><br>=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Parent p =3D new Parent(&quot;Dad&q= uot;);<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 p.setChildren(new Link= edHashMap&lt;String, Child&gt;() {{<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 put(&quot;Bobby&quot;, new Child(&quot;Male&= quot;, 9));<br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 put(&quo= t;Steven&quot;, null);<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 put(&quot;Sandra&quot;, new Child(&quot;Female&quot;, 12= ));<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }});<br><br>=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 JXPathContext context =3D JXPathContext.newC= ontext(p);<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 context.setFactory= (new AbstractFactory() {<br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @Overrid= e<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pub= lic boolean createObject(JXPathContext context, Pointer pointer, Object par= ent, String name, int index) {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 System.out.println(&quo= t;parent: &quot; + parent);<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 System.out.println(&quot;n= ame: &quot; + name);<br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 System.out.println(&quot;index: &quot; + index);<br>=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 return super.createObject(context, pointer, parent, name, index);= <br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br= >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 });<br>=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 context.createPathAndSetValue(&quot;children/Steven/age&= quot;, 4);<br> =C2=A0=C2=A0=C2=A0 }<br>}<br><br></font><i><br></i><br><br>this code result= s as following:<br><br><br><br><font size=3D"1"><font style=3D"color: rgb(= 255, 0, 0);" size=3D"1"><b>parent: {Bobby=3DChild[sex=3DMale, age=3D9], Ste= ven=3Dnull, Sandra=3DChild[sex=3DFemale, age=3D12]}<br> name: Steven<br>index: 0</b></font><br></font><font size=3D"1">Exception in= thread &quot;main&quot;=20 org.apache.commons.jxpath.JXPathException: Exception trying to create=20 xpath children/Steven/age; Factory could not create an object for path:=20 /children[@name=3D&#39;Steven&#39;]</font><br><font size=3D"1">=C2=A0=C2=A0= =fhopkins@example.org= tReferenceImpl.createPathAndSetValue(JXPathContextReferenceImpl.java:549)<b= r>=fhopkins@example.org= i.JXPathContextReferenceImpl.createPathAndSetValue(JXPathContextReferenceIm= pl.java:533)<br> =fhopkins@example.org(JX= PathMap.java:29)<br>Caused by: org.apache.commons.jxpath.JXPathAbstractFact= oryException: Factory could not create an object for path: /children[@name= =3D&#39;Steven&#39;]<br>=fhopkins@example.org= pache.commons.jxpath.ri.model.dynamic.DynamicPropertyPointer.createPath(Dyn= amicPropertyPointer.java:230)<br> =fhopkins@example.org.= model.beans.NullPointer.createPath(NullPointer.java:100)<br>=C2=A0=C2=A0=C2= =fhopkins@example.org= lPropertyPointer.createPath(NullPropertyPointer.java:138)<br>=C2=A0=C2=A0= =fhopkins@example.org= tReferenceImpl.setValue(JXPathContextReferenceImpl.java:584)<br> =fhopkins@example.org.= JXPathContextReferenceImpl.createPathAndSetValue(JXPathContextReferenceImpl= .java:546)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... 2 more</font><= br><br><i><br><br></i><br>I must mention that <i>context.createPathAndSetVa= lue(&quot;children/Bobby/age&quot;, 4)</i> works fine - sets Bobby&#39;s ag= e to 4. In case of missing object is element of collection - everything wor= ks fine, I would get <i>Parent</i> as parent object, <i>children</i> as pro= perty that has missing object and <i>index</i> so i know where to put my ne= wly created object.<br> <br>In case of Map I don&#39;t get enough information to instantiate missin= g object. &quot;Steven&quot; as property name is most surprising. Exception= is OK, cause nothing is created by factory.<br>I suppose that AbstractFact= ory should have separate method in case of Map element is missed. JXPath ea= sily detects that it is Map because setting <i>&quot;children/Bobby/age&quo= t;</i> works as expected.<br> <i><br></i>I&#39;m quite sure that I will post this to issue tracking syste= m, but first I&#39;d like to ask if anybody had similar issue? may be i am = missing something important?<br><br>Any comments are appreciated.<br><br> Regards,<br>Aleksandr<br> --000e0cd6d29c376093049b3c9744-- --000e0cd6d29c3760a9049b3c9746 Content-Type: text/x-java; charset=US-ASCII; name="Child.java" Content-Disposition: attachment; filename="Child.java" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gjn3wvkr0 cGFja2FnZSB0ZXN0cy54cGF0aDsKCnB1YmxpYyBjbGFzcyBDaGlsZCB7CiAgICBwcml2YXRlIFN0 cmluZyBzZXg7CiAgICBwcml2YXRlIGludCBhZ2U7CgogICAgQ2hpbGQoKSB7fQogICAgQ2hpbGQo U3RyaW5nIHNleCwgaW50IGFnZSkgeyBzZXRTZXgoc2V4KTsgc2V0QWdlKGFnZSk7IH0KCiAgICBw dWJsaWMgaW50IGdldEFnZSgpIHsgcmV0dXJuIGFnZTsgfQogICAgcHVibGljIHZvaWQgc2V0QWdl KGludCBhZ2UpIHsgdGhpcy5hZ2UgPSBhZ2U7IH0KICAgIHB1YmxpYyBTdHJpbmcgZ2V0U2V4KCkg eyByZXR1cm4gc2V4OyB9CiAgICBwdWJsaWMgdm9pZCBzZXRTZXgoU3RyaW5nIHNleCkgeyB0aGlz LnNleCA9IHNleDsgfQoKICAgIEBPdmVycmlkZQogICAgcHVibGljIFN0cmluZyB0b1N0cmluZygp IHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRDbGFzcygpLmdldFNpbXBsZU5hbWUoKSArICJbIiAr CiAgICAgICAgICAgICAgICAic2V4PSIgKyBnZXRTZXgoKSArICIsICIgKwogICAgICAgICAgICAg ICAgImFnZT0iICsgZ2V0QWdlKCkgKwogICAgICAgICAgICAgICAgIl0iOwogICAgfQp9 --000e0cd6d29c3760a9049b3c9746 Content-Type: text/x-java; charset=US-ASCII; name="JXPathMap.java" Content-Disposition: attachment; filename="JXPathMap.java" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gjn3x91s1 cGFja2FnZSB0ZXN0cy54cGF0aDsKCmltcG9ydCBqYXZhLnV0aWwuTGlua2VkSGFzaE1hcDsKaW1w b3J0IG9yZy5hcGFjaGUuY29tbW9ucy5qeHBhdGguQWJzdHJhY3RGYWN0b3J5OwppbXBvcnQgb3Jn LmFwYWNoZS5jb21tb25zLmp4cGF0aC5KWFBhdGhDb250ZXh0OwppbXBvcnQgb3JnLmFwYWNoZS5j b21tb25zLmp4cGF0aC5Qb2ludGVyOwoKcHVibGljIGNsYXNzIEpYUGF0aE1hcCB7CgogICAgcHVi bGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHsKCiAgICAgICAgUGFyZW50IHAg PSBuZXcgUGFyZW50KCJEYWQiKTsKICAgICAgICBwLnNldENoaWxkcmVuKG5ldyBMaW5rZWRIYXNo TWFwPFN0cmluZywgQ2hpbGQ+KCkge3sKICAgICAgICAgICAgcHV0KCJCb2JieSIsIG5ldyBDaGls ZCgiTWFsZSIsIDkpKTsKICAgICAgICAgICAgcHV0KCJTdGV2ZW4iLCBudWxsKTsKICAgICAgICAg ICAgcHV0KCJTYW5kcmEiLCBuZXcgQ2hpbGQoIkZlbWFsZSIsIDEyKSk7CiAgICAgICAgfX0pOwoK ICAgICAgICBKWFBhdGhDb250ZXh0IGNvbnRleHQgPSBKWFBhdGhDb250ZXh0Lm5ld0NvbnRleHQo cCk7CiAgICAgICAgY29udGV4dC5zZXRGYWN0b3J5KG5ldyBBYnN0cmFjdEZhY3RvcnkoKSB7CiAg ICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBjcmVhdGVPYmpl Y3QoSlhQYXRoQ29udGV4dCBjb250ZXh0LCBQb2ludGVyIHBvaW50ZXIsIE9iamVjdCBwYXJlbnQs IFN0cmluZyBuYW1lLCBpbnQgaW5kZXgpIHsKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJp bnRsbigicGFyZW50OiAiICsgcGFyZW50KTsKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJp bnRsbigibmFtZTogIiArIG5hbWUpOwogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxu KCJpbmRleDogIiArIGluZGV4KTsKICAgICAgICAgICAgICAgIHJldHVybiBzdXBlci5jcmVhdGVP YmplY3QoY29udGV4dCwgcG9pbnRlciwgcGFyZW50LCBuYW1lLCBpbmRleCk7CiAgICAgICAgICAg IH0KICAgICAgICB9KTsKICAgICAgICBjb250ZXh0LmNyZWF0ZVBhdGhBbmRTZXRWYWx1ZSgiY2hp bGRyZW4vU3RldmVuL2FnZSIsIDQpOwogICAgfQp9Cg== --000e0cd6d29c3760a9049b3c9746 Content-Type: text/x-java; charset=US-ASCII; name="Parent.java" Content-Disposition: attachment; filename="Parent.java" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gjn3x9q72 cGFja2FnZSB0ZXN0cy54cGF0aDsKCmltcG9ydCBqYXZhLnV0aWwuTWFwOwoKcHVibGljIGNsYXNz IFBhcmVudCB7CiAgICBwcml2YXRlIFN0cmluZyBuYW1lOwogICAgcHJpdmF0ZSBNYXA8U3RyaW5n LCBDaGlsZD4gY2hpbGRyZW47CgogICAgUGFyZW50KCkge30KICAgIFBhcmVudChTdHJpbmcgbmFt ZSkgeyBzZXROYW1lKG5hbWUpOyB9CgogICAgcHVibGljIE1hcDxTdHJpbmcsIENoaWxkPiBnZXRD aGlsZHJlbigpIHsgcmV0dXJuIGNoaWxkcmVuOyB9CiAgICBwdWJsaWMgdm9pZCBzZXRDaGlsZHJl bihNYXA8U3RyaW5nLCBDaGlsZD4gY2hpbGRyZW4pIHsgdGhpcy5jaGlsZHJlbiA9IGNoaWxkcmVu OyB9CiAgICBwdWJsaWMgU3RyaW5nIGdldE5hbWUoKSB7IHJldHVybiBuYW1lOyB9CiAgICBwdWJs aWMgdm9pZCBzZXROYW1lKFN0cmluZyBuYW1lKSB7IHRoaXMubmFtZSA9IG5hbWU7IH0KCiAgICBA T3ZlcnJpZGUKICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CiAgICAgICAgcmV0dXJuIHRo aXMuZ2V0Q2xhc3MoKS5nZXRTaW1wbGVOYW1lKCkgKyAiWyIgKwogICAgICAgICAgICAgICAgIm5h bWU9IiArIGdldE5hbWUoKSArICIsICIgKwogICAgICAgICAgICAgICAgImNoaWxkcmVuPSIgKyBn ZXRDaGlsZHJlbigpICsKICAgICAgICAgICAgICAgICJdIjsKICAgIH0KCgoKfQ== --000e0cd6d29c3760a9049b3c9746 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org --000e0cd6d29c3760a9049b3c9746-- From fhopkins@example.org Tue Feb 01 21:06:40 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 29378 invoked from network); 1 Feb 2011 21:06:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2011 21:06:39 -0000 Received: (qmail 84680 invoked by uid 500); 1 Feb 2011 21:06:38 -0000 Delivered-To: fhopkins@example.org Received: (qmail 84405 invoked by uid 500); 1 Feb 2011 21:06:37 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 84396 invoked by uid 99); 1 Feb 2011 21:06:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 21:06:36 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO moutng.kundenserver.de) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 21:06:27 +0000 Received: from [83.161.120.155] (trir-5d8006b7.pool.mediaWays.net [83.161.120.155]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0LlpHE-1QJiAw4BEG-00ZNkR; Tue, 01 Feb 2011 22:06:07 +0100 Message-ID: <fhopkins@example.org> Date: Tue, 01 Feb 2011 22:06:03 +0100 From: Oliver Heger <fhopkins@example.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:83.161.120.155) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Commons Users List <fhopkins@example.org> Subject: Re: [configuration] ConfigurationConverter differing behavior for ints and strings References: <fhopkins@example.org> In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:8Tka/ywn/4bEwoER/wKdA7/FZtqAxwkDwlVEM0P3jKr YT3eWWvtktV69tOAKqiTymqVLuyZzXOJiv8cLPm7Y4Zexabqor gIpmTxY96R64js0LrfbSZFVNun4Ug2N32yUzbKLPJtsGh3NrsE 3WFu3KVrQzigOtr99KD/PKqkzy/7Ll/54hl4rH2YEQrlFpqWfO 6SHYbC6RaA5ieE+tpZj4Q== X-Virus-Checked: Checked by ClamAV on apache.org Hi Mike, Am 01.02.2011 18:35, schrieb Mike Power: > Curiosity question I am seeing the ConfigurationConverter behave > differently depending on if I added an int or a string to a > configuration object. > > Consider the following code: > > 01 Configuration confInt = new BaseConfiguration(); > 02 Configuration confString = new BaseConfiguration(); > 03 confInt.setProperty("port", 80); > 04 confString.setProperty("port", "80"); > 05 assertEquals(80, confInt.getInt("port")); > 06 assertEquals(80, confString.getInt("port")); > 07 > 08 Properties propString = > ConfigurationConverter.getProperties(confString); > 09 assertEquals("80", propString.getProperty("port")); > 10 > 11 Properties propInt = ConfigurationConverter.getProperties(confInt); > 12 > 13 assertEquals("80", propInt.getProperty("port")); > > As you can see the code is basically duplicated one set uses an int the > other set uses a String. However an exception blows out of line 11. > > 'port' doesn't map to a List object: 80, a java.lang.Integer > org.apache.commons.configuration.ConversionException: 'port' doesn't map > to a List object: 80, a java.lang.Integer > at > org.apache.commons.configuration.AbstractConfiguration.getList(AbstractConfiguration.java:1144) > > at > org.apache.commons.configuration.AbstractConfiguration.getList(AbstractConfiguration.java:1109) > > at > org.apache.commons.configuration.ConfigurationConverter.getProperties(ConfigurationConverter.java:116) > > > It seems for some reason since I used an int, the ConfigurationConverter > wants to treat the property as a list. However since I actually put an > integer into the property it errors out since it can not convert a > integer to a list. > > This behavior seems odd. Why does it do this? > > Mike Power > the code responsible for this odd behavior is actually in AbstractConfiguration.getList(). Here a single string value is treated in a special way: it is returned as single element of a newly created list. However, for other scalar types such a conversion is not performed. This code is pretty old, I guess it is in there from the very beginning. Probably it was just forgotten that a configuration could store other types of values, too. If you like, you can add a bug report in Jira. The current behavior is probably not desired. Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Tue Feb 01 23:58:59 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 6246 invoked from network); 1 Feb 2011 23:58:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Feb 2011 23:58:59 -0000 Received: (qmail 63139 invoked by uid 500); 1 Feb 2011 23:58:57 -0000 Delivered-To: fhopkins@example.org Received: (qmail 62519 invoked by uid 500); 1 Feb 2011 23:58:57 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 62511 invoked by uid 99); 1 Feb 2011 23:58:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 23:58:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qw0-f43.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 23:58:51 +0000 Received: by qwk3 with SMTP id 3so7108247qwk.30 for <fhopkins@example.org>; Tue, 01 Feb 2011 15:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=BndVUYEfHyfuNx16cGQO7gsiY4tXJTO95A6YmkFR3Qg=; b=PvEvqgGlVTHMeIXVMIJpqm7/1raJNKx9lRfZFRzLW3cC1YU4XOWN/uN1sXfmm3zMzL qBUql0cyy6EnTL3aIx1jHoFXad/r5SWO5Pr3XvNO/W7y9OyYtCAR6u07aW0CBGQCYg+G iHk3lGOmyi0bmmEnfbODzBAGR5ovmc7lDlTyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YfkakVSyNpvwCiaR1rKY9tOBItHY7Xy3Pl8t5/ThFit99SROZTh2KbZ3zjbaK2XwuV PKk1Kx4h3UbWQEUlk6WbcR5aAuV68d+lQgTs0QI1HN1259Ye2dMs3gSXzwNCgqJj1CKk gqXDtxKMlIWAUn+Ht1YAZhmgZmZUyWFZMTd70= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id n17mr7434935qcm.258.1296604710914; Tue, 01 Feb 2011 15:58:30 -0800 (PST) Received: by 83.161.120.155 with HTTP; Tue, 1 Feb 2011 15:58:30 -0800 (PST) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> <fhopkins@example.org> Date: Tue, 1 Feb 2011 15:58:30 -0800 Message-ID: <fhopkins@example.org> Subject: Re: [configuration] XPathExpressionEngine Variable Interpolation From: NJuk Njuk <fhopkins@example.org> To: Commons Users List <fhopkins@example.org> Content-Type: multipart/alternative; boundary=00c09fa9c4ff3549a2049b414fd4 --00c09fa9c4ff3549a2049b414fd4 Content-Type: text/plain; charset=ISO-8859-1 finally got a chance to look into this. oliver, the extra information at the end of your message was the hint that helped. indeed i was relying on the original dot-notation within my configuration files so when i switched to xpath it was unable to interpolate those. in my case, i have a large number of configuration files, all of which use the standard dot-notation for interpolating values. however, i came across a case where the use of xpath would access select resources in a more economical manner. for me to go back and convert all my interpolated values to use xpath slash-notation would be too difficult --- both code and configuration would be touched. it seems that if one is using interpolation then you can either use either the standard expression engine or the xpath expression engine but not both. thanks for the clarification. On Sun, Jan 23, 2011 at 8:15 AM, Oliver Heger <fhopkins@example.org>wrote: > Am 23.01.2011 00:57, schrieb NJuk Njuk: > > i've been using Commons Configuration on a particular project for several >> years. until lately i have been using the DefaultExpressionEngine --- or >> at >> least i believe i have since i've never called setExpressionEngine(). my >> configuration is specified by a set of xml files, some of which use >> variable >> interpolation (via ${} syntax) to define property values. >> >> i recently had a case where the use of XPATH would be helpful in obtaining >> certain configuration values. when i switched the expression engine to >> XPathExpressionEngine, i was able to locate the necessary configuration >> properties but their values resulted in the non-interpolated string. if i >> use the DefaultExpressionEngine, the values are properly interpolated. >> >> am i wrong in assuming that XPathExpressionEngine should transparently >> variable interpolation like DefaultExpressionEngine does? i saw no >> mention >> of this, one way or the other, in the Commons Configuration documentation. >> >> thanks in advance for any guidance. >> >> > You are right, interpolation should work the same way for the > XPathExpressionEngine as for the default one. > > Would it be possible to post a code fragment and an example configuration > file so that we can reproduce the problem? > > What might be the cause for your problem is the fact that when using > XPathExpressionEngine this engine is also used for interpreting the > interpolated variables, i.e. the expressions in ${} syntax. If these > expressions are not valid XPath expressions, the corresponding values cannot > be retrieved; in this case the non-interpolated strings are returned. > > Oliver > > --------------------------------------------------------------------- > To unsubscribe, e-mail: fhopkins@example.org > For additional commands, e-mail: fhopkins@example.org > > --00c09fa9c4ff3549a2049b414fd4-- From fhopkins@example.org Wed Feb 02 08:42:52 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 39191 invoked from network); 2 Feb 2011 08:42:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2011 08:42:51 -0000 Received: (qmail 81002 invoked by uid 500); 2 Feb 2011 08:42:50 -0000 Delivered-To: fhopkins@example.org Received: (qmail 80711 invoked by uid 500); 2 Feb 2011 08:42:47 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 80494 invoked by uid 99); 2 Feb 2011 08:42:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 08:42:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO web33806.mail.mud.yahoo.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Feb 2011 08:42:41 +0000 Received: (qmail 86078 invoked by uid 60001); 2 Feb 2011 08:42:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1296636139; bh=jN3zbJnUPp8S9YiCCh4gfFx7GiIEwRsp44DmXySQ77o=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=LlIHObh6nPus9Hq3p2V9s3/AsL32goUK4CxYPnVw8DMcgLtAAEsZNfYwEieSvQlVXF4Bnx4sNLjgKreob944L9pD2bt8IcPdFdGkRS+jct9wT1wGwr9mPztp2zQKy8+s6nkOaoKkzbNIgnFMK/DwBxhmucvOHmev45CPdnI7VGo= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=2HSfYCcmiL+Z+1fUhiIWZ2hspwfBG4R7QIOs7gDH9Xz2X0HANJ/Bt6qeuOvOXPy2xknhtynyLalCywnKLgrm1PV74l1CJFklRNS9Y76gxziVnV+6qOIu+g4KvtFcdYONzlZftXLkkgDJ+HU9gx7YnfntEImhOZhrcypIadnaLk0=; Message-ID: <fhopkins@example.org> X-YMail-OSG: 4ATVHygVM1kqs4.wvHSBA218AQ1oRFLSsAHK4SdWeTuEw8_ IF7JZgVCVutZiVKppdnjEXG9FmCFZn2nng3Lvvf0AooYuw5UiNPZFp9PR.CO wDMpgTEAAVEm1JlnszVuOs3gA29ZHrvYjAbejxbNYcMFx7EqDbtY9_J0hnEy m2GuvF7SRORdR2i80NagS2LYGxJ8Chz0Bp_0fAV.gMXCY_0sxsDeRE_tRcFk rork0nS08Q57fqAxtjU7wex.msQD5YiaC5l4i3U9cEMCmNGSj7nA9t8pGXCQ DhjG4N2gL_riGRfHHQiIYGxpsz5DepBrUGtQQqAvHdd7.WscF8DZlQPzhlke sN2MfuQ-- Received: from [83.161.120.155] by web33806.mail.mud.yahoo.com via HTTP; Wed, 02 Feb 2011 00:42:19 PST X-Mailer: YahooMailRC/555 YahooMailWebService/83.161.120.1551010 Date: Wed, 2 Feb 2011 00:42:19 -0800 (PST) From: Trasca Virgil <fhopkins@example.org> Subject: [commons-net] - Issue with commons-net and MS Exchange email server To: fhopkins@example.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1538672151-1296636139=:85686" --0-1538672151-1296636139=:85686 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=A0=0A=A0=A0=A0=A0=A0=A0 I am trying to send an email using commons-n= et and a=A0MS Exchange server. =0AAll the=A0server connect settings were do= uble checked and are correct. Also some =0Afirewall settings were adjusted = to be sure nothing stays in between that could =0Ablock the communication. = =0A=0A=A0=0AStill things are not working and following is the stack=A0trace= .=A0Any help will be =0Agreatly appreciated.=0A=A0=0A=0A=A0org.apache.commo= ns.mail.EmailException: Sending the email to the following =0Aserver failed= : CIBSE-MAIL.cibse.org:25=0A=A0at org.apache.commons.mail.Email.sendMimeMe= ssage(Email.java:1242)=0A=A0at org.apache.commons.mail.Email.send(Email.jav= a:1267)=0A=A0at =0Acom.smartwish.documentburster.sender.EmailSender.doSend(= EmailSender.java:148)=0A=A0at com.smartwish.documentburster.sender.Sender.s= end(Sender.java:89)=0A=A0at =0Acom.smartwish.documentburster.engine.SimpleB= urster.endDocument(SimpleBurster.java:272)=0A=0A=A0at =0Acom.smartwish.docu= mentburster.engine.SimpleBurster.doBurst(SimpleBurster.java:135)=0A=0A=A0at= com.smartwish.documentburster.facade.Facade.doBurst(Facade.java:59)=0A=A0a= t com.smartwish.documentburster.DocumentBurster.main(DocumentBurster.java:6= 3)=0ACaused by: javax.mail.MessagingException: Could not connect to SMTP ho= st: =0ACIBSE-MAIL.cibse.org, port: 25, response: 421=0A=A0at com.sun.mail.s= mtp.SMTPTransport.openServer(SMTPTransport.java:1694)=0A=A0at com.sun.mail.= smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)=0A=A0at javax.ma= il.Service.connect(Service.java:313)=0A=A0at javax.mail.Service.connect(Ser= vice.java:172)=0A=A0at javax.mail.Service.connect(Service.java:121)=0A=A0at= javax.mail.Transport.send0(Transport.java:190)=0A=A0at javax.mail.Transpor= t.send(Transport.java:120)=0A=A0at org.apache.commons.mail.Email.sendMimeMe= ssage(Email.java:1232)=0A=A0... 7 more=0A=0A=A0=0AThank you,=0AVirgil --0-1538672151-1296636139=:85686-- From fhopkins@example.org Wed Feb 02 09:13:53 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 56992 invoked from network); 2 Feb 2011 09:13:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2011 09:13:52 -0000 Received: (qmail 10081 invoked by uid 500); 2 Feb 2011 09:13:51 -0000 Delivered-To: fhopkins@example.org Received: (qmail 9512 invoked by uid 500); 2 Feb 2011 09:13:48 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 9485 invoked by uid 99); 2 Feb 2011 09:13:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 09:13:46 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO acero.sim.ucm.es) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 09:13:36 +0000 X-IronPort-AV: E=Sophos;i="4.60,413,1291590000"; d="scan'208,217";a="26588309" Received: from unknown (HELO ULISES.sim.ucm.es) ([83.161.120.155]) by acero.sim.ucm.es with ESMTP; 02 Feb 2011 10:13:16 +0100 Received: from [83.161.120.155] by ULISES.sim.ucm.es (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <fhopkins@example.org> for fhopkins@example.org; Wed, 02 Feb 2011 10:13:16 +0100 (CET) Date: Wed, 02 Feb 2011 10:13:16 +0100 From: Ismael =?ISO-8859-1?Q?Mar=EDn_Carri=F3n?= <fhopkins@example.org> Subject: [vfs] - Problem with httpclient To: fhopkins@example.org Message-id: <1296637996.2270.9.camel@magno> MIME-version: 1.0 X-Mailer: Evolution 2.28.3 Content-type: multipart/alternative; boundary="=-XRFgNQJ0y6tglTROnktz" X-Virus-Checked: Checked by ClamAV on apache.org --=-XRFgNQJ0y6tglTROnktz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Dear all, I am working in the development of a driver for a Grid system. In our tests, we are using GridSAM, which use the httpclient and commons-vfs. I am writing you to get some advise of how solving the next problem. GridSAM invokes httpclient classes from the HttpClientFactory class (org.apache.commons.vfs.provider.http), in the method createConnection(). public static HttpClient createConnection(HttpFileSystemConfigBuilder builder, String scheme, String hostname, int port, String username, String password, FileSystemOptions fileSystemOptions) throws FileSystemException { .... client.executeMethod(new HeadMethod()); .... } I am not using any authentication mechanism, and so username and passwd are null, but hostname, port and scheme has the proper values. Thus, in executeMethod() method of the HttpClient class: public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state) throws IOException, HttpException { .... HostConfiguration defaulthostconfig = getHostConfiguration(); if (hostconfig == null) { hostconfig = defaulthostconfig; } URI uri = method.getURI(); .... } I received a null value for uri, while the hostconfig object has values for host attribute, but not for localAddress attribute or any other. Later it causes a NoHttpResponseException. The complete stack is: 2011-02-01 17:11:49,050 ERROR [TransferAgentFactory] source URI is not resolvable org.apache.commons.vfs.FileSystemException: Could not connect to HTTP server on "magno". at org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:186) at org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:53) at org.apache.commons.vfs.provider.http.HttpFileProvider.doCreateFileSystem(HttpFileProvider.java:97) at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:103) at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:82) at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:66) at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:706) at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:623) at org.icenigrid.gridsam.core.plugin.transfer.protocol.AbstractTransferAgent.getFileObject(AbstractTransferAgent.java:239) at org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.resolveSourceFile(TransferAgentFactory.java:168) at org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.<init>(TransferAgentFactory.java:120) at org.icenigrid.gridsam.core.plugin.transfer.provider.AFTFileTransferJob.execute(AFTFileTransferJob.java:131) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool $WorkerThread.run(SimpleThreadPool.java:525) Caused by: org.apache.commons.httpclient.NoHttpResponseException: The server magno failed to fhopkins@example.org(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source) at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source) at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source) at org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:182) ... 13 more Maybe, the line numbers are not exactly correct since I have been some minor changes. The version of httpclient is 3.0.1 and vfs is 2.1. I am very pleased of any help or advise. Best regards. --=-XRFgNQJ0y6tglTROnktz-- From fhopkins@example.org Wed Feb 02 09:27:39 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 60318 invoked from network); 2 Feb 2011 09:27:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2011 09:27:39 -0000 Received: (qmail 25665 invoked by uid 500); 2 Feb 2011 09:27:38 -0000 Delivered-To: fhopkins@example.org Received: (qmail 25259 invoked by uid 500); 2 Feb 2011 09:27:35 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 25248 invoked by uid 99); 2 Feb 2011 09:27:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 09:27:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qy0-f178.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 09:27:28 +0000 Received: by qyk33 with SMTP id 33so7591109qyk.9 for <fhopkins@example.org>; Wed, 02 Feb 2011 01:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=W+NI4AKhdawDbsCzY84PagsGUbOVOjQF4tKCYwH++os=; b=JjHs3wEVfgcLrqSBZ1v5rEZSR1FnNbebDWh4c4tTo6KYmO6mmzw7zqmQoa14fBCWu+ Ga3ZXpwNxT4969ZNgtBo6hk8+niRDexcWe0C/D20ahEnmKFi6LoBYv+BP8FI14w7+XSp hRiTBOfnaP8z6CxU39sDbeGjabfDCGYdHzhoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lHqNOB8yXu+/sa6B5hWkbCNpkrAvHc7TSTkUogfFAFcNiytL7MCOKzK4+BzhoP7WnV hnPUY4HdUzQtKiGzsViwN6SaKT4nYYnEYtW1E7hKJwe+kTIwT3jEhZxA7+jFdlKU5H/L Sl/RAiQqGB6CfqDjlciYEyGiGBwNg2yc92k7I= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id mb4mr7848117qcb.294.1296638827020; Wed, 02 Feb 2011 01:27:07 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Feb 2011 01:27:06 -0800 (PST) In-Reply-To: <fhopkins@example.org> References: <fhopkins@example.org> Date: Wed, 2 Feb 2011 09:27:06 +0000 Message-ID: <fhopkins@example.org> Subject: Re: [EMAIL] - Issue with commons-net and MS Exchange email server From: sebb <fhopkins@example.org> To: Commons Users List <fhopkins@example.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2 February 2011 08:42, Trasca Virgil <fhopkins@example.org> wrote: > Hi, > > =A0=A0=A0=A0=A0=A0 I am trying to send an email using commons-net and a= =A0MS Exchange server. I think you mean Commons EMAIL - subject changed accordingly. > All the=A0server connect settings were double checked and are correct. Al= so some > firewall settings were adjusted to be sure nothing stays in between that = could > block the communication. > > > Still things are not working and following is the stack=A0trace.=A0Any he= lp will be > greatly appreciated. > > > =A0org.apache.commons.mail.EmailException: Sending the email to the follo= wing > server failed : CIBSE-MAIL.cibse.org:25 > =A0at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242) > =A0at org.apache.commons.mail.Email.send(Email.java:1267) > =A0at > com.smartwish.documentburster.sender.EmailSender.doSend(EmailSender.java:= 148) > =A0at com.smartwish.documentburster.sender.Sender.send(Sender.java:89) > =A0at > com.smartwish.documentburster.engine.SimpleBurster.endDocument(SimpleBurs= ter.java:272) > > =A0at > com.smartwish.documentburster.engine.SimpleBurster.doBurst(SimpleBurster.= java:135) > > =A0at com.smartwish.documentburster.facade.Facade.doBurst(Facade.java:59) > =A0at com.smartwish.documentburster.DocumentBurster.main(DocumentBurster.= java:63) > Caused by: javax.mail.MessagingException: Could not connect to SMTP host: > CIBSE-MAIL.cibse.org, port: 25, response: 421 Response 421 means what? Googling "SMTP 421" should help you here. This does not appear to be a Commons EMAIL problem. > =A0at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1694) > =A0at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:= 525) > =A0at javax.mail.Service.connect(Service.java:313) > =A0at javax.mail.Service.connect(Service.java:172) > =A0at javax.mail.Service.connect(Service.java:121) > =A0at javax.mail.Transport.send0(Transport.java:190) > =A0at javax.mail.Transport.send(Transport.java:120) > =A0at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232) > =A0... 7 more > > > Thank you, > Virgil --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Wed Feb 02 13:54:42 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 77718 invoked from network); 2 Feb 2011 13:54:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2011 13:54:41 -0000 Received: (qmail 34489 invoked by uid 500); 2 Feb 2011 13:54:40 -0000 Delivered-To: fhopkins@example.org Received: (qmail 33779 invoked by uid 500); 2 Feb 2011 13:54:36 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 33767 invoked by uid 99); 2 Feb 2011 13:54:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 13:54:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO web33804.mail.mud.yahoo.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Feb 2011 13:54:29 +0000 Received: (qmail 30150 invoked by uid 60001); 2 Feb 2011 13:54:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1296654848; bh=IRFF0Tqn/dllXwYZB5eX7wDGguyHN1L7IPF8NbXDoXw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Gx/JcxaQVT0rvqKJUHS9xkKtAQHUgl4JWLcFkA5bA9LUnxETnhnJHCqlH1oNrpcNJVOurXK/JwCfRMHflOnKsigddfds+TzFZis/xS3I1R1V7WRjLYC1pTtusA+JCqM6kT4axe18cCHRseDK/5DG8s0gzXZbxdsn7gzJeYKJJ2o= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=fpYUYM6XLAMTM5mAS3eSOEOT3hEtu/yyZhp32o2TJl5Rf9hjjDxt5rkCgf45BanGv51CCw7j28HsIi3s43TZqVT47M0VdT7fAOBdO0WiSqbv88u0xbaaYRfhGcOMn/7H3TafVVqof8TFz+SHF7UjWl41EliQKK7iGB2IXdVDahs=; Message-ID: <fhopkins@example.org> X-YMail-OSG: _VmyYvIVM1koFgV2g20rJ2qVSKkdYc2DlqhiC.vDrYW4lzz jKSsgBTRlrdJgLlNFNpDcxHigNpIfjYR5PPvGXubNGWhNSwY94WPDrlTSSZ1 c3dAaAq6b5bgmxxFcBv_u_WGkQgbyyp.SQV69KlYfktSfKg94Nt0EAu7M_Cr M5apNZmyAfhwAn_ghometNBFyyNhfoQuxMwN16ogtGto_gL8s2QrhTvouB5T HuMMsq_MQtRppN2dpdai8461kOezW5Bv_gBVCKffVUfT9hSrYZfzlCTAWGgs csGmd52Tanwa97SU9aWt9m43na9fwQCiLcFg5m_HedyKUqzhm5q3kRIsbfcu ZD6k5ag-- Received: from [83.161.120.155] by web33804.mail.mud.yahoo.com via HTTP; Wed, 02 Feb 2011 05:54:08 PST X-Mailer: YahooMailRC/555 YahooMailWebService/83.161.120.1551010 References: <fhopkins@example.org> <fhopkins@example.org> Date: Wed, 2 Feb 2011 05:54:08 -0800 (PST) From: Trasca Virgil <fhopkins@example.org> Subject: Re: [EMAIL] - Issue with commons-net and MS Exchange email server To: fhopkins@example.org, Commons Users List <fhopkins@example.org> In-Reply-To: <fhopkins@example.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1262651078-1296654848=:27830" --0-1262651078-1296654848=:27830 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Sebb,=0A=A0=0A=A0=A0=A0=A0=A0=A0=A0 I goggled for SMTP 421 and I saw=A0t= he meaning of it. I did not say it is =0Aa bug - I am only asking if=A0peop= le can give some=A0hints as from where the problem =0Acan come.=A0=0A=A0=0A= What I already tried=0A=A0=0A=09* double checked the server settings to be= =A0ok=0A=09* checked for firewalls/antivirus which might block the communic= ation - it is =0Anot the case=0A=09* goggled for SMTP 421 and saw it is a c= ommunication problem between the client =0Aand the server=0A=A0=0AThank you= , =0AVirgil=0A=0A=0A=0A=0A________________________________=0AFrom: sebb <se= fhopkins@example.org>=0ATo: Commons Users List <fhopkins@example.org>=0ASent: = Wed, February 2, 2011 11:27:06 AM=0ASubject: Re: [EMAIL] - Issue with commo= ns-net and MS Exchange email server=0A=0AOn 2 February 2011 08:42, Trasca V= irgil <fhopkins@example.org> wrote:=0A> Hi,=0A>=0A> =A0=A0=A0=A0=A0=A0 I= am trying to send an email using commons-net and a=A0MS Exchange =0Aserver= .=0A=0AI think you mean Commons EMAIL - subject changed accordingly.=0A=0A>= All the=A0server connect settings were double checked and are correct. Als= o some=0A> firewall settings were adjusted to be sure nothing stays in betw= een that could=0A> block the communication.=0A>=0A>=0A> Still things are no= t working and following is the stack=A0trace.=A0Any help will =0Abe=0A> gre= atly appreciated.=0A>=0A>=0A> =A0org.apache.commons.mail.EmailException: Se= nding the email to the following=0A> server failed : CIBSE-MAIL.cibse.org:2= 5=0A> =A0at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242)= =0A> =A0at org.apache.commons.mail.Email.send(Email.java:1267)=0A> =A0at=0A= > com.smartwish.documentburster.sender.EmailSender.doSend(EmailSender.java:= 148)=0A> =A0at com.smartwish.documentburster.sender.Sender.send(Sender.java= :89)=0A> =A0at=0A>com.smartwish.documentburster.engine.SimpleBurster.endDoc= ument(SimpleBurster.java:272)=0A>)=0A>=0A> =A0at=0A>com.smartwish.documentb= urster.engine.SimpleBurster.doBurst(SimpleBurster.java:135)=0A>)=0A>=0A> = =A0at com.smartwish.documentburster.facade.Facade.doBurst(Facade.java:59)= =0A> =A0at =0Acom.smartwish.documentburster.DocumentBurster.main(DocumentBu= rster.java:63)=0A> Caused by: javax.mail.MessagingException: Could not conn= ect to SMTP host:=0A> CIBSE-MAIL.cibse.org, port: 25, response: 421=0A=0ARe= sponse 421 means what?=0A=0AGoogling "SMTP 421" should help you here.=0A=0A= This does not appear to be a Commons EMAIL problem.=0A=0A> =A0at com.sun.ma= il.smtp.SMTPTransport.openServer(SMTPTransport.java:1694)=0A> =A0at com.sun= .mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)=0A> =A0at = javax.mail.Service.connect(Service.java:313)=0A> =A0at javax.mail.Service.c= onnect(Service.java:172)=0A> =A0at javax.mail.Service.connect(Service.java:= 121)=0A> =A0at javax.mail.Transport.send0(Transport.java:190)=0A> =A0at jav= ax.mail.Transport.send(Transport.java:120)=0A> =A0at org.apache.commons.mai= l.Email.sendMimeMessage(Email.java:1232)=0A> =A0... 7 more=0A>=0A>=0A> Than= k you,=0A> Virgil=0A=0A----------------------------------------------------= -----------------=0ATo unsubscribe, e-mail: fhopkins@example.org= .org=0AFor additional commands, e-mail: fhopkins@example.org --0-1262651078-1296654848=:27830-- From fhopkins@example.org Wed Feb 02 20:44:27 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 69740 invoked from network); 2 Feb 2011 20:44:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Feb 2011 20:44:26 -0000 Received: (qmail 26369 invoked by uid 500); 2 Feb 2011 20:44:25 -0000 Delivered-To: fhopkins@example.org Received: (qmail 26293 invoked by uid 500); 2 Feb 2011 20:44:24 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 26285 invoked by uid 99); 2 Feb 2011 20:44:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Feb 2011 20:44:24 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mailout-de.gmx.net) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Feb 2011 20:44:16 +0000 Received: (qmail invoked by alias); 02 Feb 2011 20:43:55 -0000 Received: from chello080108123177.3.11.vie.surfer.at (EHLO deathmarch.local) [83.161.120.155] by mail.gmx.net (mp003) with SMTP; 02 Feb 2011 21:43:55 +0100 X-Authenticated: #35915548 X-Provags-ID: V01U2FsdGVkX18JNpsQpm0JtsF2Xk8tu/AzTaPyTWatQPICnod03V Ut/NOOGlDP6m/t Message-ID: <fhopkins@example.org> Date: Wed, 02 Feb 2011 21:43:55 +0100 From: Siegfried Goeschl <fhopkins@example.org> Reply-To: fhopkins@example.org User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:83.161.120.155) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Commons Users List <fhopkins@example.org> Subject: Re: [EMAIL] - Issue with commons-net and MS Exchange email server References: <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> <fhopkins@example.org> In-Reply-To: <fhopkins@example.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Oops - wrong email account .... On 2/2/11 9:42 PM, Siegfried Goeschl wrote: > Hi Trascs, > > some hints > > +) try telnet to connect to the SMTP port > +) try the "mail.debug" system property to dump SMTP communication > (see > http://java.sun.com/products/javamail/javadocs/javax/mail/package-summary.html) > +) use a conventional mail client to send email using the SMTP port > > Cheers, > > Siegfried Goeschl > > On 2/2/11 2:54 PM, Trasca Virgil wrote: >> Hi Sebb, >> I goggled for SMTP 421 and I saw the meaning of it. I did >> not say it is >> a bug - I am only asking if people can give some hints as from where >> the problem >> can come. What I already tried >> * double checked the server settings to be ok >> * checked for firewalls/antivirus which might block the >> communication - it is >> not the case >> * goggled for SMTP 421 and saw it is a communication problem >> between the client >> and the server >> Thank you, >> Virgil >> >> >> >> >> ________________________________ >> From: sebb<fhopkins@example.org> >> To: Commons Users List<fhopkins@example.org> >> Sent: Wed, February 2, 2011 11:27:06 AM >> Subject: Re: [EMAIL] - Issue with commons-net and MS Exchange email >> server >> >> On 2 February 2011 08:42, Trasca Virgil<fhopkins@example.org> wrote: >>> Hi, >>> >>> I am trying to send an email using commons-net and a MS >>> Exchange >> server. >> >> I think you mean Commons EMAIL - subject changed accordingly. >> >>> All the server connect settings were double checked and are correct. >>> Also some >>> firewall settings were adjusted to be sure nothing stays in between >>> that could >>> block the communication. >>> >>> >>> Still things are not working and following is the stack trace. Any >>> help will >> be >>> greatly appreciated. >>> >>> >>> org.apache.commons.mail.EmailException: Sending the email to the >>> following >>> server failed : CIBSE-MAIL.cibse.org:25 >>> at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242) >>> at org.apache.commons.mail.Email.send(Email.java:1267) >>> at >>> com.smartwish.documentburster.sender.EmailSender.doSend(EmailSender.java:148) >>> >>> at com.smartwish.documentburster.sender.Sender.send(Sender.java:89) >>> at >>> com.smartwish.documentburster.engine.SimpleBurster.endDocument(SimpleBurster.java:272) >>> >>> ) >>> >>> at >>> com.smartwish.documentburster.engine.SimpleBurster.doBurst(SimpleBurster.java:135) >>> >>> ) >>> >>> at >>> com.smartwish.documentburster.facade.Facade.doBurst(Facade.java:59) >>> at >> com.smartwish.documentburster.DocumentBurster.main(DocumentBurster.java:63) >> >>> Caused by: javax.mail.MessagingException: Could not connect to SMTP >>> host: >>> CIBSE-MAIL.cibse.org, port: 25, response: 421 >> Response 421 means what? >> >> Googling "SMTP 421" should help you here. >> >> This does not appear to be a Commons EMAIL problem. >> >>> at >>> com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1694) >>> at >>> com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525) >>> at javax.mail.Service.connect(Service.java:313) >>> at javax.mail.Service.connect(Service.java:172) >>> at javax.mail.Service.connect(Service.java:121) >>> at javax.mail.Transport.send0(Transport.java:190) >>> at javax.mail.Transport.send(Transport.java:120) >>> at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232) >>> ... 7 more >>> >>> >>> Thank you, >>> Virgil >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: fhopkins@example.org >> For additional commands, e-mail: fhopkins@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Thu Feb 03 05:11:56 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 32880 invoked from network); 3 Feb 2011 05:11:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2011 05:11:55 -0000 Received: (qmail 28983 invoked by uid 500); 3 Feb 2011 05:11:54 -0000 Delivered-To: fhopkins@example.org Received: (qmail 27950 invoked by uid 500); 3 Feb 2011 05:11:49 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 27929 invoked by uid 99); 3 Feb 2011 05:11:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 05:11:48 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-ww0-f49.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 05:11:43 +0000 Received: by wwb17 with SMTP id 17so797572wwb.6 for <multiple recipients>; Wed, 02 Feb 2011 21:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Dpinf8GZAuxBQqqi/lJ474sKGjFIGpNwxPz5N5to+po=; b=lRg/070p0ERRd/BFIIS8RArZgRCMxcOgDf+N/i+IDmmzt+WCTjmI8EzfWEmjbDFMfE GY3WVS8vUDf2kt53pZ15JnYxdoDjZY1xFwyo5pgLAYsGPp/0s1vh0OjSiyI1kdjulVSz 30ppVm5y8Sn8gkwheFWJr7OnqRW7RVHFDP96Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fSThVg6JA6t87ohraGHCPk0tpi1auq9do6+54qH09z9J3n+hZ4RzGxWilLWe7bDNbJ 7xINqW+ZTQ/nY6v/SDnJsjBNlIJR8u2jY/f/Dav2i5BNNiNROsl5/5EuTScVGU1jMUwr 8JmeCttzTOQHf76manEPN+DGOi9Cq0etk+FVs= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id i8mr9389478wer.19.1296709881442; Wed, 02 Feb 2011 21:11:21 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Feb 2011 21:11:21 -0800 (PST) Date: Wed, 2 Feb 2011 21:11:21 -0800 Message-ID: <fhopkins@example.org> Subject: Feathercast on Apache Commons From: Henri Yandell <fhopkins@example.org> To: Commons Users List <fhopkins@example.org>, Commons Developers List <fhopkins@example.org> Content-Type: text/plain; charset=ISO-8859-1 Our own Gary Gregory being interviewed by Feathercast.org: http://feathercast.org/?p=97 --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Thu Feb 03 15:21:08 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 638 invoked from network); 3 Feb 2011 15:21:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2011 15:21:08 -0000 Received: (qmail 80660 invoked by uid 500); 3 Feb 2011 15:21:07 -0000 Delivered-To: fhopkins@example.org Received: (qmail 80245 invoked by uid 500); 3 Feb 2011 15:21:04 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 80237 invoked by uid 99); 3 Feb 2011 15:21:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 15:21:02 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO acero.sim.ucm.es) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 15:20:53 +0000 X-IronPort-AV: E=Sophos;i="4.60,420,1291590000"; d="scan'208";a="26652814" Received: from unknown (HELO ODISEO.sim.ucm.es) ([83.161.120.155]) by acero.sim.ucm.es with ESMTP; 03 Feb 2011 16:20:33 +0100 Received: from [83.161.120.155] by ODISEO.sim.ucm.es (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <fhopkins@example.org> for fhopkins@example.org; Thu, 03 Feb 2011 16:20:33 +0100 (CET) Date: Thu, 03 Feb 2011 16:20:33 +0100 From: Ismael =?ISO-8859-1?Q?Mar=EDn_Carri=F3n?= <fhopkins@example.org> Subject: Re: [vfs] - Problem with httpclient In-reply-to: <1296637996.2270.9.camel@magno> To: Commons Users List <fhopkins@example.org> Message-id: <1296746433.2080.10.camel@magno> MIME-version: 1.0 X-Mailer: Evolution 2.28.3 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8BIT References: <1296637996.2270.9.camel@magno> X-Virus-Checked: Checked by ClamAV on apache.org I would like to emphasize that the URI is given by a insecure Globus GASS session (the files are transfered using wget, so the session is ok). This code does not fail with other kind of URIs. Thus, are this kind of URIs valid for httpclient? Regards. On Wed, 2011-02-02 at 10:13 +0100, Ismael Marín Carrión wrote: > Dear all, > > I am working in the development of a driver for a Grid system. In our > tests, we are using GridSAM, which use the httpclient and commons-vfs. > > I am writing you to get some advise of how solving the next problem. > > GridSAM invokes httpclient classes from the HttpClientFactory class > (org.apache.commons.vfs.provider.http), in the method > createConnection(). > > public static HttpClient createConnection(HttpFileSystemConfigBuilder > builder, String scheme, > String hostname, int port, > String username, > String password, > FileSystemOptions fileSystemOptions) > throws FileSystemException > { > .... > client.executeMethod(new HeadMethod()); > .... > } > > I am not using any authentication mechanism, and so username and passwd > are null, but hostname, port and scheme has the proper values. > > Thus, in executeMethod() method of the HttpClient class: > > public int executeMethod(HostConfiguration hostconfig, > final HttpMethod method, final HttpState state) > throws IOException, HttpException { > .... > HostConfiguration defaulthostconfig = getHostConfiguration(); > if (hostconfig == null) { > hostconfig = defaulthostconfig; > } > URI uri = method.getURI(); > .... > } > > I received a null value for uri, while the hostconfig object has values > for host attribute, but not for localAddress attribute or any other. > Later it causes a NoHttpResponseException. > > The complete stack is: > > 2011-02-01 17:11:49,050 ERROR [TransferAgentFactory] source URI is not > resolvable > org.apache.commons.vfs.FileSystemException: Could not connect to HTTP > server on "magno". > at > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:186) > at > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:53) > at > org.apache.commons.vfs.provider.http.HttpFileProvider.doCreateFileSystem(HttpFileProvider.java:97) > at > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:103) > at > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:82) > at > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:66) > at > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:706) > at > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:623) > at > org.icenigrid.gridsam.core.plugin.transfer.protocol.AbstractTransferAgent.getFileObject(AbstractTransferAgent.java:239) > at > org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.resolveSourceFile(TransferAgentFactory.java:168) > at > org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactory.<init>(TransferAgentFactory.java:120) > at > org.icenigrid.gridsam.core.plugin.transfer.provider.AFTFileTransferJob.execute(AFTFileTransferJob.java:131) > at org.quartz.core.JobRunShell.run(JobRunShell.java:202) > at org.quartz.simpl.SimpleThreadPool > $WorkerThread.run(SimpleThreadPool.java:525) > Caused by: org.apache.commons.httpclient.NoHttpResponseException: The > server magno failed to respond > at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown > Source) > at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown > Source) > at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source) > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown > Source) > at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown > Source) > at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown > Source) > at > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection(HttpClientFactory.java:182) > ... 13 more > > Maybe, the line numbers are not exactly correct since I have been some > minor changes. The version of httpclient is 3.0.1 and vfs is 2.1. > > I am very pleased of any help or advise. Best regards. --------------------------------------------------------------------- To unsubscribe, e-mail: fhopkins@example.org For additional commands, e-mail: fhopkins@example.org From fhopkins@example.org Thu Feb 03 16:10:13 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 30960 invoked from network); 3 Feb 2011 16:10:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2011 16:10:12 -0000 Received: (qmail 84359 invoked by uid 500); 3 Feb 2011 16:10:11 -0000 Delivered-To: fhopkins@example.org Received: (qmail 84248 invoked by uid 500); 3 Feb 2011 16:10:08 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 84240 invoked by uid 99); 3 Feb 2011 16:10:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 16:10:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fhopkins@example.org designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO blu0-omc3-s19.blu0.hotmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 16:09:58 +0000 Received: from BLU142-W34 ([83.161.120.155]) by blu0-omc3-s19.blu0.hotmail.com with Microsoft SMTPSVC(772)547-0284); Thu, 3 Feb 2011 08:09:36 -0800 Message-ID: <fhopkins@example.org> Content-Type: multipart/alternative; boundary="_99288bc5-f98a-49ef-939a-2b2f106659d2_" X-Originating-IP: [83.161.120.155] From: Martin Gainty <fhopkins@example.org> To: <fhopkins@example.org> Subject: RE: [vfs] - Problem with httpclient Date: Thu, 3 Feb 2011 11:09:36 -0500 Importance: Normal In-Reply-To: <1296746433.2080.10.camel@magno> References: <1296637996.2270.9.camel@magno>,<1296746433.2080.10.camel@magno> MIME-Version: 1.0 X-OriginalArrivalTime: 03 Feb 2011 16:09:36.0783 (UTC) FILETIME=[C0E719F0:01CBC3BC] X-Virus-Checked: Checked by ClamAV on apache.org --_99288bc5-f98a-49ef-939a-2b2f106659d2_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ssh username@magno (or whatever the IP is assigned to magno in hosts file) >netstat -ab | grep 80 //if you do not have HTTPServer running on 80 you will get no results //if you do have HTTPServer running on Port 80 you should see output //also if your HttpClient executeMethod is declared as=20 public int executeMethod(HostConfiguration hostconfig=2C final HttpMethod m= ethod=2C final HttpState state) throws IOException=2C HttpException=20 //you should call executeMethod with all of the params initialised e.g. try { int n=3Dclient.executeMethod(hostconfig=2Cmethod=2Cstate) } catch(IOException ioe) { log.debug("Handle your IOException from client.executeMethod here")=3B } catch(HttpException http_exception) { log.debug("Handle your HttpException from client.executeMethod here")=3B } Saludos Cordiales=2C Martin Gainty=20 ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit= =E9 =20 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng= er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter= leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l= ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin= dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w= ir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAtes= pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que pour sat= isfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e= ou la copie de ceci est interdite. Ce message sert =E0 l'information seule= ment et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9tant d= onn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulation= =2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni= . > Date: Thu=2C 3 Feb 2011 16:20:33 +0100 > From: fhopkins@example.org > Subject: Re: [vfs] - Problem with httpclient > To: fhopkins@example.org >=20 > I would like to emphasize that the URI is given by a insecure Globus > GASS session (the files are transfered using wget=2C so the session is > ok). This code does not fail with other kind of URIs. >=20 > Thus=2C are this kind of URIs valid for httpclient? >=20 > Regards. >=20 > On Wed=2C 2011-02-02 at 10:13 +0100=2C Ismael Mar=EDn Carri=F3n wrote: > > Dear all=2C > >=20 > > I am working in the development of a driver for a Grid system. In our > > tests=2C we are using GridSAM=2C which use the httpclient and commons-v= fs. > >=20 > > I am writing you to get some advise of how solving the next problem. > >=20 > > GridSAM invokes httpclient classes from the HttpClientFactory class > > (org.apache.commons.vfs.provider.http)=2C in the method > > createConnection(). > >=20 > > public static HttpClient createConnection(HttpFileSystemConfigBuilder > > builder=2C String scheme=2C > > String hostname=2C int po= rt=2C > > String username=2C > > String password=2C > > FileSystemOptions fileSystemOptions) > > throws FileSystemException > > { > > .... > > client.executeMethod(new HeadMethod())=3B > > .... > > } > >=20 > > I am not using any authentication mechanism=2C and so username and pass= wd > > are null=2C but hostname=2C port and scheme has the proper values. > >=20 > > Thus=2C in executeMethod() method of the HttpClient class: > >=20 > > public int executeMethod(HostConfiguration hostconfig=2C > > final HttpMethod method=2C final HttpState state) > > throws IOException=2C HttpException { > > .... > > HostConfiguration defaulthostconfig =3D getHostConfiguration()= =3B > > if (hostconfig =3D=3D null) { > > hostconfig =3D defaulthostconfig=3B > > } > > URI uri =3D method.getURI()=3B > > .... > > } > >=20 > > I received a null value for uri=2C while the hostconfig object has valu= es > > for host attribute=2C but not for localAddress attribute or any other. > > Later it causes a NoHttpResponseException.=20 > >=20 > > The complete stack is: > >=20 > > 2011-02-01 17:11:49=2C050 ERROR [TransferAgentFactory] source URI is no= t > > resolvable > > org.apache.commons.vfs.FileSystemException: Could not connect to HTTP > > server on "magno". > > at > > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection= (HttpClientFactory.java:186) > > at > > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection= (HttpClientFactory.java:53) > > at > > org.apache.commons.vfs.provider.http.HttpFileProvider.doCreateFileSyste= m(HttpFileProvider.java:97) > > at > > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.getFile= System(AbstractOriginatingFileProvider.java:103) > > at > > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFil= e(AbstractOriginatingFileProvider.java:82) > > at > > org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFil= e(AbstractOriginatingFileProvider.java:66) > > at > > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(Defaul= tFileSystemManager.java:706) > > at > > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(Defaul= tFileSystemManager.java:623) > > at > > org.icenigrid.gridsam.core.plugin.transfer.protocol.AbstractTransferAge= nt.getFileObject(AbstractTransferAgent.java:239) > > at > > org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactor= y.resolveSourceFile(TransferAgentFactory.java:168) > > at > > org.icenigrid.gridsam.core.plugin.transfer.protocol.TransferAgentFactor= y.<init>(TransferAgentFactory.java:120) > > at > > org.icenigrid.gridsam.core.plugin.transfer.provider.AFTFileTransferJob.= execute(AFTFileTransferJob.java:131) > > at org.quartz.core.JobRunShell.run(JobRunShell.java:202) > > at org.quartz.simpl.SimpleThreadPool > > $WorkerThread.run(SimpleThreadPool.java:525) > > Caused by: org.apache.commons.httpclient.NoHttpResponseException: The > > server magno failed to respond > > at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(Unknown > > Source) > > at org.apache.commons.httpclient.HttpMethodBase.readResponse(Unknown > > Source) > > at org.apache.commons.httpclient.HttpMethodBase.execute(Unknown Source) > > at > > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unkno= wn Source) > > at > > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown > > Source) > > at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown > > Source) > > at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown > > Source) > > at > > org.apache.commons.vfs.provider.http.HttpClientFactory.createConnection= (HttpClientFactory.java:182) > > ... 13 more > >=20 > > Maybe=2C the line numbers are not exactly correct since I have been som= e > > minor changes. The version of httpclient is 3.0.1 and vfs is 2.1. > >=20 > > I am very pleased of any help or advise. Best regards. >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe=2C e-mail: fhopkins@example.org > For additional commands=2C e-mail: fhopkins@example.org >=20 = --_99288bc5-f98a-49ef-939a-2b2f106659d2_-- From fhopkins@example.org Thu Feb 03 16:28:07 2011 Return-Path: <fhopkins@example.org> Delivered-To: fhopkins@example.org Received: (qmail 37747 invoked from network); 3 Feb 2011 16:28:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Feb 2011 16:28:06 -0000 Received: (qmail 13469 invoked by uid 500); 3 Feb 2011 16:28:05 -0000 Delivered-To: fhopkins@example.org Received: (qmail 13023 invoked by uid 500); 3 Feb 2011 16:28:02 -0000 Mailing-List: contact fhopkins@example.org; run by ezmlm Precedence: bulk List-Help: <mailto:fhopkins@example.org> List-Unsubscribe: <mailto:fhopkins@example.org> List-Post: <mailto:fhopkins@example.org> List-Id: <user.commons.apache.org> Reply-To: "Commons Users List" <fhopkins@example.org> Delivered-To: mailing list fhopkins@example.org Received: (qmail 13014 invoked by uid 99); 3 Feb 2011 16:28:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 16:28:01 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO acero.sim.ucm.es) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 16:27:52 +0000 X-IronPort-AV: E=Sophos;i="4.60,420,1291590000"; d="scan'208";a="26654798" Received: from unknown (HELO ODISEO.sim.ucm.es) ([83.161.120.155]) by acero.sim.ucm.es with ESMTP; 03 Feb 2011 17:27:32 +0100 Received: from [83.161.120.155] by ODISEO.sim.ucm.es (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPA id <fhopkins@example.org> for fhopkins@example.org; Thu, 03 Feb 2011 17:27:32 +0100 (CET) Date: Thu, 03 Feb 2011 17:27:19 +0100 From: Ismael =?ISO-8859-1?Q?Mar=EDn_Carri=F3n?= <fhopkins@example.org> Subject: RE: [vfs] - Problem with httpclient In-reply-to: <fhopkins@example.org> To: Commons Users List <fhopkins@example.org> Message-id: <1296750439.2080.23.camel@magno> MIME-version: 1.0 X-Mailer: Evolution 2.28.3 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8BIT References: <1296637996.2270.9.camel@magno> <1296746433.2080.10.camel@magno> <fhopkins@example.org> X-Virus-Checked: Checked by ClamAV on apache.org Dear Martin, thanks for your response. The GASS session does not uses the port 80 (and magno is a local domain). It opens a HTTP session such as $ globus-gass-server -i -p 8180 http://localhost:8180 and so, you can transfer files using the globus-url-copy (in a grid environment) or simply, using wget to a URI such as http://localhost:8180/out/test.txt, where /out/test.txt is on /, the file is downloaded. It seems rare since using a URI of a web server or tomcat servlet, this application has not problems. So, I guess that httpclient is not ready for this kind of HTTP services, no? By other hand, the application previously set the HostConfiguration, client.setHostConfiguration(config);. I am not the developer of this code, and so I unknown some details. Regards. On Thu, 2011-02-03 at 11:09 -0500, Martin Gainty wrote: > ssh username@magno (or whatever the IP is assigned to magno in hosts file) > >netstat -ab | grep 80 > > //if you do not have HTTPServer running on 80 you will get no results > //if you do have HTTPServer running on Port 80 you should see output > > //also if your HttpClient executeMethod is declared as > public int executeMethod(HostConfiguration hostconfig, final HttpMethod method, final HttpState state) > throws IOException, HttpException > > //you should call executeMethod with all of the params initialised e.g. > try > { > int n=client.executeMethod(hostconfig,method,state) > } > catch(IOException ioe) > { > log.debug("Handle your IOException from client.executeMethod here"); > } > catch(HttpException http_exception) > { > log.debug("Handle your HttpException from client.executeMethod here"); > } > > Saludos Cordiales, > Martin Gainty > ______________________________________________ > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > Ce message est
{'source': 'Apache Software Foundation Public Mail Archives'}