Common knowledge in Java

A few notes, observations that I would like to document about Java. This may be common,trivial knowledge, but I just want it to be in one place.

Thursday, July 14, 2005

apache.commons.net ParserInitializationException

We use the jakarta/apache (don't know what they call it these days) commons net jar as our ftp client and this seems to be failing with a TANDEM ftp box. Looks like someone else was running into the same error at about the same time.
This is the error I was running into:


org.apache.commons.net.ftp.parser.ParserInitializationException:
Error initializing parser at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.
createFileEntryParser(DefaultFTPFileEntryParserFactory.java:115) at org.apache.commons.net.ftp.FTPClient.
initiateListParsing(FTPClient.java:2306) at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2055) at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2106) at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2146)


After taking a look at the commons code, here's what I figured out, the TANDEM box was returning
an empty string on a FTP SYST command. Our good people at commons don't handle a null, assuming
the FTPClient.getSystemName() always returns something. So here's my hack to get around it.

if(null == ftpClient.getSystemName()) {
//use parserKey,pathName method signature
ftpFileArray = ftpClient.listFiles("UNIX",(String)null);
} else {
ftpFileArray = ftpClient.listFiles();
}

42 Comments:

At 9:16 AM, Blogger Steve Austin said...

Informative blog. I have a xml sql server blog.

 
At 2:22 AM, Blogger goks said...

HI,

I tried your fix in my code:
FTPFile[] files = null;
if(null == ftp.getSystemName()) {
/use parserKey,pathName method ture
files = ftp.listFiles("UNIX",(String)null);
} else {
files = ftp.listFiles();
}

but i still get failure:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/oro/text/regex/MalformedPatternException
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createUnixFTPEntryParser(DefaultFTPFileEntryParserFactory.java:169)
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:94)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2345)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2090)
at com.ericsson.snmp.ftp.main(ftp.java:143)
Press any key to continue . . .


any idea why?

 
At 9:50 AM, Blogger Java Foo said...

goks your error seems to be different. You might be using a different commons net version. Also not sure what OS your ftp box is using. For me it was a HP Tandem, which was close to generic UNIX, thats the reason I used "UNIX", there. You might want to see what OS your ftp server is using and use the appropriate string.

 
At 10:27 PM, Blogger IsabellaWilliams said...

To the suggestion of the slave whom he had in charge for the time being that the articles be laid aside until he had http://startso11.info/Virgin-%2C%2CKolejny+Razmp3.html finished, he would not listen.. I've thought for some time that you http://startso11.info/www.bankmilennium.pl..html were getting a little overtrained.. Watkinson, anything so that it http://startso11.info/Greenpeace+Polska.html is only a speech.. And of late--of course it might http://startso11.info/w.taniedomeny.pl.html be imagination --Gideon had shown a little physical falling off.. Er--ceased his attentions, said the Colonel, gravely. http://startso11.info/contrasty+szczecin.html. You'll be mighty fur off your feet if you let Matt Pike put things in your head that hain't no business a-bein' http://storyah44.info/plan+kryzysu.html there, and special if you find yourself a-wantin' to know where he's a-perambulatin' in his everlastin' meanderin's.. The two women were walking off toward our view, each with an arm http://rebestal.info/samochody+marki+Dacia.html about the other's waist--touched by a sudden sisterhood of sympathy.. Watkinson is in fashionable society, said Caroline, or http://startso11.info/Katalogi.html Mrs.. Another publisher who read the manuscript of the Anecdotes and Reminiscences thought that, with a little retouching and toning down of the http://startso11.info/fotografia+%C5%9Blubna+lublin.html high lights, he could make a really bright and salable volume of it.. His grandfather http://startso11.info/poczochy.html was a seize-Hessian-ist in the Revolutionary War.. We do not doubt that even this apparatus http://startso11.info/gramatyka+klasa+6.html attained its present perfection through a long course of development.. I positively decline to overlook it, sir. http://startso11.info/J%C3%B3zef+Koz%C5%82owski+AND+major.html. On the contrary, there will be a tendency in the primary apparatus to abandon the painful memory picture as soon as it is in any way awakened, as the overflow of its http://startso11.info/galeria+shaza.html excitement would surely produce (more precisely, begin to produce) pain.. There was, of course, at the time not http://storyah44.info/radwanska.html a word about undivided attention.. The wealth of detail, the infinite care never to let anything pass unexplained, with which he presented to the public the result of his investigations, are impressing http://startso11.info/www.dziennik+zachodni.pl.html more and more serious-minded scientists, but the examination of his evidential data demands arduous work and presupposes an absolutely open mind.. Buller was frightened, http://rebestal.info/czy+mo%C5%BCna+zwolni%C4%87+kobieta+w+ci%C4%85%C5%BCy.html but the horse was not.. Nothing can be brought to an end in the unconscious; nothing can cease or http://startso11.info/biustonosz+dla+pan%C3%B3w.html be forgotten.. I let them infloonces go to friendship, ef you'll take it so. http://startso11.info/o2+forum.html. A perceptive stimulus acts on the http://startso11.info/mogilno.html primitive apparatus, becoming the source of a painful emotion.. Let them select anyhow http://rebestal.info/roletki.html and he should be pleased...

 
At 9:30 PM, Blogger EmmaAnderson said...

A day or two later it was known throughout the town that Zaidee Hooker had sued Adoniram Hotchkiss for breach of promise, and that the damages were laid http://startso11.info/heck+my+tip.html at five thousand dollars.. It has been intimated, indeed, that the Sandemanians are leaning towards Free-Will, and that we have, therefore, neglected these semi-annual exhibitions, while there is no doubt http://startso11.info/notowania+funduszy+inwestycyjnych.html that Auchmuty last year went to Commencement at Waterville.. With cheerful alacrity he dodged the stones flung after him with friendly, erratic aim by the girl upon whom, yesterday afternoon, http://rebestal.info/rokytnice.html he had come to make a social call.. M---- is a young business man without any http://startso11.info/www.oriflame.pl.html poetical or literary interests.. Nevertheless, the Colonel returned to his private room, and it was nearly twilight when the faithful Jim entered, to find him http://startso11.info/www.uw.gdansk.pl.html sitting meditatively before his desk.. He was, indeed, got from the hall only with the http://startso11.info/www.puprawicz.html greatest difficulty by the Governor, the City Marshal, who had been called in, and the Superintendent of my Sunday School.. She could http://storyah44.info/pompka+zamka+centralnego+Audi+A4.html not help it.. His attitude toward dream study was, in other words, that of a statistician who does not know, and has no means of foreseeing, what conclusions will be forced on him by the information he is gathering, but who http://rebestal.info/rury+wydechowe+bielsko.html is fully prepared to accept those unavoidable conclusions.. A faint and misty smile was http://startso11.info/www.shrek3.com.html the widest departure from its propriety, and this unaccustomed disturbance made wrinkles in the flat, skinny cheeks like those in the surface of a lake, after the intrusion of a stone.. The phobia http://startso11.info/imiona.html is thrown before the anxiety like a fortress on the frontier.. But I rubbed the glasses well, and looked at her, and saw a white lily, whose stem was broken, but which was fresh; http://startso11.info/jak+wypiac+naped.html and luminous, and fragrant, still.. That the forgetting of dreams explains this in part, at least, we http://startso11.info/Nota+o+autorze+Romanie+Pisarskim.html are convinced by our experience, confirmed again and again.. I shall certainly never http://startso11.info/premiery+kinowe.html be one of those Spanish knights, said Edward.. If I'm fool enough to go, I don't http://startso11.info/hotmail.co.uk.html expect to come out of it alive.. Morland, I am quite satisfied with http://startso11.info/www+Korona+Kielce+pl..html the quiet joys of a happy home.. My own mother--that is, I call her my own mother, because, you know, I http://startso11.info/Wyszukaj+dobre+programy.html do not remember, etc.. The first person in the dream-thoughts behind the ego was my friend who http://startso11.info/24.html had been so scandalously treated.. My memory is bad; but I had not had time http://startso11.info/Bank+Gospdarki+%C5%BBywno%C5%9Bciowej.html to forget that Mr.. Honors are about even in http://startso11.info/Karol+Szymanowski.html that game, he said.. Lick him! Lick him! exclaimed http://startso11.info/www.investcomfort.pl.html Buller...

 
At 10:58 AM, Blogger pbsl said...

you have a nice site. thanks for sharing this site. there are various kinds of ebooks are available here

http://feboook.blogspot.com

 
At 6:08 AM, Blogger 單存 said...

人因夢想而偉大,要堅持自己的理想哦!..................................................

 
At 6:08 AM, Blogger 手ˊ震 said...

這麼好的部落格,以後看不到怎麼辦啊!!!..................................................

 
At 2:15 AM, Blogger 白色情人節 said...

thx u very much, i learn a lot

 
At 4:28 AM, Blogger 冠宇 said...

成人無碼片線上看18限成人影片論壇成人鴛鴦成人影片鴛鴦吧成人影片a正妹百人斬a影片免費看a騙bbsx693bonbonme線上觀看bt成人分享bt免費論壇bt後宮cb 倉井空影片cb倉井空影片cf聊天室dudu貼片dudu嘟嘟區dvd 卡通色情片a影片卡通a網情色片a漫網址a色情圖片a免費卡通影片a免費看片a免費情色影片a免費影片觀看a免費線上直播a免費線上觀賞a我愛78論壇視訊辣妹亞洲情色風暴貼圖交友聊天找e爵aio交友愛情館

 
At 7:03 PM, Blogger v奎峰奎峰 said...

裸體寫真全裸美女圖片色情訊息黃色圖片自拍裸體圖片sex裸露圖片18限85cc a片台灣色情網站免費色情圖一夜激情聊天情色聊天室限制級爆乳女優作愛巨乳學院性愛情慾陰脣一夜情下體網愛聊天鹹濕做愛自拍成人圖庫成人影城性關係視訊情人性影片觀賞裸照淫美成人論壇av寫真自拍裸女貼圖av圖情色性愛貼圖成人vcdsexy辣妹視訊聊天色情視訊淫婦台灣情色論壇丁字褲貼圖免費a片影片淫蕩女人live show男女做愛火辣妹妹激情網愛聊天美女裸照免費色情網站

 
At 4:11 AM, Blogger 彭志文 said...

Practice what you preach.......................................................

 
At 9:39 PM, Blogger Raphae9845 said...

may the blessing be with you.........................................

 
At 7:42 PM, Blogger Heriberto said...

與其爭取不可能得到的東西,不如善自珍惜運用自己所擁有的........................................

 
At 8:05 PM, Blogger WillyA_Mellinger said...

文章很棒~感謝!!..................................................

 
At 8:16 PM, Blogger 詩婷 said...

不費勞力而得者,唯貧困而已........................................

 
At 12:19 PM, Blogger 韋于倫成 said...

放棄者不會勝利,勝利者永不放棄。.........................

 
At 2:26 PM, Blogger 韋于倫成 said...

Lets cross the bridge when we come to it..................................................

 
At 4:20 AM, Blogger 韋于倫成 said...

傻氣的人喜歡給心 雖然每次都被笑了卻得到了別人的心 ..................................................

 
At 8:47 PM, Blogger 哲宇皓云 said...

加油啦!要繼續發表好文章喔!........................................

 
At 12:56 AM, Blogger ShilaLong嘉雯 said...

幸福不是一切,人還有責任。..................................................

 
At 4:10 AM, Blogger 皇雯皇雯 said...

被人揭下面具是一種失敗,自己揭下面具卻是種勝利。..................................................................

 
At 7:01 AM, Blogger 洪筱婷 said...

來幫推 你個blog影d相真係好靚,係我至愛~.................................................................

 
At 1:25 AM, Blogger 李哲維 said...

良言一句三冬暖,惡語傷人六月寒。.................................................................

 
At 11:44 AM, Blogger 江婷 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」.................................................................

 
At 1:04 AM, Blogger 美方 said...

當一個人內心能容納兩樣相互衝突的東西,這個人便開始變得有價值了。............................................................

 
At 11:47 PM, Blogger 江冠彭珮李佳宏陽筠 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................

 
At 5:07 AM, Blogger 宥妃宥妃 said...

來拜訪你囉~期待你的下次文章~加油^^..................................................................

 
At 4:50 AM, Blogger 偉軍 said...

工作,是愛的具體化~~~~努力吧!............................................................

 
At 6:29 PM, Blogger 誠李行王wtf桂屏李edt李 said...

開心不開心都是一天,祝您能夠笑著面對一切!............................................................

 
At 12:26 AM, Blogger 冠宇 said...

I have nothing to offer but blood, toil, tears and sweat..................................................................

 
At 4:07 PM, Blogger 吳勇佩吳勇佩 said...

再度來訪@v@ 謝謝分享囉~ ............................................................

 
At 12:48 AM, Blogger 家榮家榮 said...

來看你了~心在、愛在、牽掛在,幸福才會繁衍不息^^..................................................................

 
At 11:16 PM, Blogger 楊儀卉 said...

出遊不拘名勝,有景就是好的..................................................................

 
At 8:28 PM, Blogger 王筱彥王筱彥 said...

聰明人之所以不會成功,是因為他們缺乏了堅忍的毅力。..................................................

 
At 8:53 PM, Blogger 鄭雅雯 said...

來看你囉~加油~~!!............................................................

 
At 11:42 PM, Blogger 515152 said...

It is easier to get than to keep it.......................................................................

 
At 9:34 PM, Blogger 吳承侯政霖虹 said...

It is easier to get than to keep it.......................................................................

 
At 3:37 PM, Blogger 吳沛黃以富民 said...

要在憂患恥辱的環境裡,創造我們自力更生的新生活。..................................................

 
At 12:13 AM, Blogger 偉曹琬 said...

看著你的BLOG 好多朋友都回應 真厲害..................................................

 
At 10:43 AM, Blogger 冠陳儒 said...

回應是最大的支持^^y~~~甘吧嗲............................................................

 
At 9:11 AM, Blogger 國林林林林維 said...

TAHNKS FOR YOUR SHARING~~~VERY NICE..................................................................

 

Post a Comment

<< Home