Re: ChromeJarResourceLoader and winXP jdk142 and webstart
denis cardon <[email protected]> Thu, 2 Oct 2003 08:08:39 -0700 (PDT)
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Ross,
thanks a lot for the hint. Fortunatly I have not yet
come across all the problems you are mentioning below
:-) I have been able to cope with my problem by adding
the following line (with the %20):
String jarFileName =ClassUtils.getJarFileName(
anchor );
+ jarFileName = jarFileName.replaceAll("%20"," ");
File file = new File( jarFileName );
JarFile jarFile = new JarFile( file, false );
It looks like the problem arise from the spaces in the
"c:\program files" directory... Looks like a M$
conspiracy... In fact it looks like there is no good
URL-->File conversion method in java. The space
character has been escaped to %20 when calling the
URL.getExternalForm(), but there could be many more
characters that could undergo that transformation...
Seems scary! Perhaps it could be better to go directly
from URL --> JarEntry without going through the
java.io.File concept. What do you think about it?
Cheers,
Denis
--- Ross Wetmore <[email protected]> wrote:
> Again, I don't knwo which caramel you are using, but
> these are two
> possibly relevent fixes I needed to make in Feb.
>
> There was a null pointer returned in the case of
> "to" being "0", and
> the possibly more shaky fix to handle the alternate
> URL syntax form.
> The second patch covered a Luxor change to hand off
> Text rather than
> just String objects - the caramel followup wasn't
> completed. I forget
> if the second caused a null pointer, or just that
> labels and such did
> not show their contents/value.
>
> This is very fuzzy memory of a quickie test, but if
> you bury your
> anchor or whatever path you are searching for down a
> directory level
> or so, rather than having it at a top-level, the
> "to" problem should
> go away. A relative path worked and the absolute
> form failed in this
> case, or something like that.
>
> Cheers,
> RossW
> =====
>
> diff -rub
> caramel-1.0-b1/src/caramel/util/ClassUtils.java
> caramel/src/caramel/util/ClassUtils.java
> --- caramel-1.0-b1/src/caramel/util/ClassUtils.java
> Sun Dec 8 17:25:56 2002+++
> caramel/src/caramel/util/ClassUtils.java Sun Feb
> 16 16:41:53 2003
> @@ -46,9 +46,15 @@
>
> T.debug( "jarUrlString=" + jarUrlString );
>
> - int from = "jar:file:".length();
> + if (jarUrlString.startsWith("jar:file:"))
> + jarUrlString =
> jarUrlString.substring("jar:file:".length());
> + if (jarUrlString.startsWith("jar:"))
> + jarUrlString =
> jarUrlString.substring("jar:".length());
> +
> int to = jarUrlString.indexOf( "!/" );
> + if (0 <= to)
> + jarUrlString.substring( 0, to );
>
> - return jarUrlString.substring( from, to );
> + return jarUrlString;
> }
> }
> diff -rub
> caramel-1.0-b1/src/caramel/util/HtmlOutputter.java
> caramel/src/caramel/util/HtmlOutputter.java
> ---
> caramel-1.0-b1/src/caramel/util/HtmlOutputter.java
> Sun Dec 8 17:25:56 2002+++
> caramel/src/caramel/util/HtmlOutputter.java Sat Feb
> 15 20:29:39 2003
> @@ -66,6 +66,8 @@
> // ignore comments
> else if( obj instanceof String )
> out.write( ( String ) obj );
> + else if( obj instanceof Text )
> + out.write( ((Text) obj).getText() );
> else if( obj instanceof Element )
> outputElement( ( Element ) obj, out );
> else if( obj instanceof EntityRef )
>
>
>
>
> denis cardon wrote:
> > Hi Gerald,
> >
> > the problem seems to arise from the URL-->File
> > conversion that occurs after the
> > caramel.utils.ClassUtil.getJarFileName(...) class.
> > It seems that there are some patterns that are not
> > properly converted (I guess the space which is
> > returned as %20 in the url.getExternalForm() is
> the
> > culprit...)
> >
> > I keep investigating
> >
> > Cheers,
> >
> > Denis
> >
> >
> > --- Gerald Bauer <[email protected]> wrote:
> >
> >>Hi Denis,
> >>
> >>
> >>>I have dumped the stacktrace below. I used latest
> >>>luxor source from CVS. Any ideas? It only happens
> >>
> >>on
> >>
> >>>winXP and on some win2k... Write once, run
> >>
> >>anywhere
> >>
> >>>they said... :-( I'll look further into it
> >>
> >>tomorrow.
> >>
> >> Hard to tell. Does it run without Web Start? If
> >>it
> >>does it might be a class loading issue?
> >>
> >> - Gerald
> >>
> >>
> >>
> >>
> >
> >
>
-------------------------------------------------------
> >
> >>This sf.net email is sponsored by:ThinkGeek
> >>Welcome to geek heaven.
> >>http://thinkgeek.com/sf
> >>_______________________________________________
> >>luxor-xul-user mailing list
> >>[email protected]
> >>
> >
> >
>
https://lists.sourceforge.net/lists/listinfo/luxor-xul-user
> >
> >
> > =====
> > =========================
> > |Denis Cardon, Tranquil I.T. Systems
> > |10 rue du Docteur Bouchard, 49400 Saumur
> > |Tel: +33(0)2.41.67.56.99
> > |Web: http://www.tranquil-it-systems.fr
> > =========================
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product
> search
> > http://shopping.yahoo.com
> >
> >
> >
>
-------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > luxor-xul-user mailing list
> > [email protected]
> >
>
https://lists.sourceforge.net/lists/listinfo/luxor-xul-user
> >
>
>
>
>
-------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> luxor-xul-user mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/luxor-xul-user
=====
=========================
|Denis Cardon, Tranquil I.T. Systems
|10 rue du Docteur Bouchard, 49400 Saumur
|Tel: +33(0)2.41.67.56.99
|Web: http://www.tranquil-it-systems.fr
=========================
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf