From: Gerd M. <Ger...@sm...> - 2003-12-08 14:19:06
|
Hi, If I call java -jar joelib.jar:myclasses.jar my.Main.Class and try to load a molecule from a file I get an error that joelib can't load the file atomtypes.txt although the jar contains it. If I unpack joelib.jar it works. I found out that the error occurs if the jar resists in a directory with whitespaces in the pathname. Also I saw that wsi.ra.tools.ResourceLoader replaces '%20' in the pathname with ' ' which seems to be the problem here. Why is this done ? Any hints for fixing this problem ? Best Regards, gerd ________________________________________________________________ Gerd Mueller ge...@sm... SMB GmbH http://www.smb-tec.com |
From: Joerg K. W. <we...@in...> - 2003-12-08 14:46:08
|
Hi Gerd, > and try to load a molecule from a file I get an error that > joelib can't load the file atomtypes.txt although the jar contains > it. If I unpack joelib.jar it works. > I found out that the error occurs if the jar resists in a directory > with whitespaces in the pathname. Also I saw that wsi.ra.tools.ResourceLoader > replaces '%20' in the pathname with ' ' which seems to be the > problem here. Why is this done ? Any hints for fixing this problem ? 111. As you can see also the replacement takes only an effect for 'files' which are not contained in a .zip or .jar file ! So the question is, why is this not recognized (line 161) ? Switch log4j.category.wsi.ra.tool.ResourceLoader=INFO to log4j.category.wsi.ra.tool.ResourceLoader=DEBUG in build/log4.properties and src/log4j.properties and try again. Then you could see a little bit more informations ! Otherwise you should add some System.out.println("abc"); to the ResourceLoader class to see why this check fails ! So three way plan: 1. increase verbosity in logging 2. add console informations and recompile sources 3. check again your example. I added the replacement of white space characters (FOR FILES), because other users had the same path problem. So, we must find a way to combine the solutions for both problems at once. 222. Which way are you using for loading your file. ? Stream, SimpleReader, ResourceLoader, ... ? 333. Have you anything changed in joelib.properties ? There you can define another 'atomtype.txt'-path. Typically JOELib uses the resource-load mechanism to be independant from user-paths. Regards, Joerg -- Dipl. Chem. Joerg K. Wegner Center of Bioinformatics Tuebingen (ZBIT) Department of Computer Architecture Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany Phone: (+49/0) 7071 29 78970 Fax: (+49/0) 7071 29 5091 E-Mail: mailto:we...@in... WWW: http://www-ra.informatik.uni-tuebingen.de -- Never mistake motion for action. E. Hemingway |
From: Gerd M. <Ger...@sm...> - 2003-12-09 11:19:05
|
On Mon, 08 Dec 2003 15:51:34 +0100 "Joerg K. Wegner" <we...@in...> wrote: > Hi Gerd, > > > and try to load a molecule from a file I get an error that > > joelib can't load the file atomtypes.txt although the jar contains > > it. If I unpack joelib.jar it works. > > I found out that the error occurs if the jar resists in a directory > > with whitespaces in the pathname. Also I saw that > > wsi.ra.tools.ResourceLoader replaces '%20' in the pathname with ' ' which > > seems to be the problem here. Why is this done ? Any hints for fixing this > > problem ? > > 111. As you can see also the replacement takes only an effect for > 'files' which are not contained in a .zip or .jar file ! Yes, and this seems to be the problem. I've used java.net.URLDecoder to decode the urlToZipArchive in getBytesFromArchive() and everything works fine. So the solution seems to be move the '%20' replacement code a few lines up, so that also archive paths are handled. Also I would recomment to use java.net.URLDecoder instead of using regexp. This way you don't need to care about other %-sign that may occur. best regards, gerd ________________________________________________________________ Gerd Mueller ge...@sm... SMB GmbH http://www.smb-tec.com |
From: Joerg K. W. <we...@in...> - 2003-12-09 11:57:08
|
Hi Gerd, could you please change these things and send me the complete ResourceLoader, so i must not check these things on my own. Thanks and best regards, Joerg > On Mon, 08 Dec 2003 15:51:34 +0100 > "Joerg K. Wegner" <we...@in...> wrote: > > >>Hi Gerd, >> >> >>>and try to load a molecule from a file I get an error that >>>joelib can't load the file atomtypes.txt although the jar contains >>>it. If I unpack joelib.jar it works. >>>I found out that the error occurs if the jar resists in a directory >>>with whitespaces in the pathname. Also I saw that >>>wsi.ra.tools.ResourceLoader replaces '%20' in the pathname with ' ' which >>>seems to be the problem here. Why is this done ? Any hints for fixing this >>>problem ? >> >>111. As you can see also the replacement takes only an effect for >>'files' which are not contained in a .zip or .jar file ! > > > Yes, and this seems to be the problem. I've used java.net.URLDecoder > to decode the urlToZipArchive in getBytesFromArchive() and everything > works fine. So the solution seems to be move the '%20' replacement > code a few lines up, so that also archive paths are handled. Also > I would recomment to use java.net.URLDecoder instead of using > regexp. This way you don't need to care about other %-sign that > may occur. > > best regards, > gerd > > ________________________________________________________________ > Gerd Mueller ge...@sm... > SMB GmbH http://www.smb-tec.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Joelib-help mailing list > Joe...@li... > https://lists.sourceforge.net/lists/listinfo/joelib-help > -- Dipl. Chem. Joerg K. Wegner Center of Bioinformatics Tuebingen (ZBIT) Department of Computer Architecture Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany Phone: (+49/0) 7071 29 78970 Fax: (+49/0) 7071 29 5091 E-Mail: mailto:we...@in... WWW: http://www-ra.informatik.uni-tuebingen.de -- Never mistake motion for action. E. Hemingway |