cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Madu" <andrewm...@gmail.com>
Subject Re: Xhtml and Ajax...no go!!
Date Mon, 12 Mar 2007 12:46:47 GMT
Hi,
seems the problem is situated around this little snippet of code:

    private static final String CHARSET_LOOKUP_CLASS =

"org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class";

   .......

    private CharsetFactory() {
        super();
        this.unknownCharset = new UnknownCharset();

        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        URL url = loader.getResource(CHARSET_LOOKUP_CLASS);

        ......

    private void loadCharsetsFromJar(URL url) {
        try {
            String file = url.getFile();
            String mtch = file.substring(file.indexOf('!'));
            file = file.substring(5, file.indexOf('!'));
            mtch = mtch.substring(2, mtch.lastIndexOf('/') + 1) + "cs_";

            ZipFile zip = new ZipFile(file);
            Enumeration enumeration = zip.entries();
            while (enumeration.hasMoreElements()) {
                ZipEntry entry = (ZipEntry)enumeration.nextElement();
                String name = entry.getName();
                if ((! name.startsWith(mtch)) ||
                    (! name.endsWith(".class"))) continue;
                name = name.substring(mtch.length());
                name = ".cs_" + name.substring(0, name.length() - 6);
                name = this.getClass().getPackage().getName() + name;
                loadCharset(name);
            }
        } catch (IOException exception) {
            throw new CharsetFactoryException("Unable to access JAR \""
                                          + url.toString() + "\"",
exception);
        }
    }

As very few others are reporting any problems with this issue I am presuming
it could potentially be a permissions issue that is at work here. I have
checked the permissions of cs_US_ASCII.class and have not detected anything
wrong.

Any ideas?

--
Regards

Andrew

On 12/03/07, Bertrand Delacretaz <bdelacretaz@apache.org> wrote:
>
> On 3/12/07, Andrew Madu <andrewmadu@gmail.com> wrote:
>
> > ...it would seem that this problem:
> >
> > "Unable to access JAR "jar:file:/C:/Program Files/jboss-
> > 4.0.3/server/default/deploy/jbossweb
> > -tomcat55.sar/ROOT.war/WEB-INF/lib/cocoon-
> serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class
> "
> >
> > has been an issue for a number of years!:
>
> Sure. See http://www.codeconsult.ch/bertrand/archives/000072.html.
>
> -Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message