portals-pluto-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricky_fr...@peoplesoft.com
Subject Has anyone tried the latest castor?
Date Sat, 20 Nov 2004 15:58:32 GMT
I tried replacing the castor-0.9.4.1-xml.jar with the latest release from
www.castor.org, castor-0.9.5.4-xml.jar, and ran into what looks like
incompatible changes in castor behavior. But since I'm a newbie to castor I
thought I would ask the list.

With the latest release, the loadMapping( String fileName ) method used in
the pluto portalImpl services (ex: portlet definition registry) all get
"file not found" because castor double-adds the path of the file by the
time they get around to calling the castor DTDResolver.resolveEntity. Is
this making sense to anyone? Does anyone have more on this?

The workaround I put on my system is to just call loadMapping( InputSource
) with an already opened stream instead...

So for example this:

        try
        {
            this.mappingPortletXml.loadMapping(_mapping);
        }
        catch (Exception e)
        {
            log.error("Failed to load mapping file "+_mapping,e);
            throw e;
        }

Becomes this:

        // changed loadMapping call from passing in full path to
InputSource instead
        // castor-0.9.5.4 can't handle full file names... sets base and
still appends full path
        FileInputStream fis = null;
        try
        {
            fis = new FileInputStream(_mapping);
            InputSource src = new InputSource(new
BufferedInputStream(fis));
            this.mappingPortletXml.loadMapping(src);
        }
        catch (Exception e)
        {
            log.error("Failed to load mapping file "+_mapping,e);
            throw e;
        }
        finally
        {
            try {
                if( fis != null )
                    fis.close();
            } catch( Exception x ) {}
        }



Mime
View raw message