[ http://issues.apache.org/jira/browse/XALANJ-1686?page=all ]
Brian Minchau updated XALANJ-1686:
----------------------------------
Version: 2.5Dx
(was: Latest Development Code)
> Minor Exception try block error
> -------------------------------
>
> Key: XALANJ-1686
> URL: http://issues.apache.org/jira/browse/XALANJ-1686
> Project: XalanJ2
> Type: Bug
> Components: transformation, Xalan-interpretive
> Versions: 2.5Dx
> Environment: Operating System: All
> Platform: All
> Reporter: Lukas Zapletal
> Assignee: Xalan Developers Mailing List
> Priority: Minor
>
> Dears
>
> sorry to trouble you on your official mail but I`m not in the list and I do
> not
> want to subscribe enything
> incl. bugzilla or any other compicated forms (why all open source projects
> doesn`t have any anonymous email
> address allowing us to report bugs and recomendations without strained
> subscribe
> forms -- IMHO lots of users
> give it up at the beginning).
>
> Ok. I found a small mistake in the Xalan-J source
> org.apache.xalan.xslt.Process.
>
> There are some try-catch blocks in the code that parses URIRESOLVER and
> ENTITYRESOLVER parameters. The
> exceptions should be ClassNotFoundException cnfe but somebody changed this to
> Exception cnfe. Well this is not
> bad author just needed to handle more exceptions but I found a problem.
>
> I spent 4 hours of fining why my Xalan reports an error about not finding my
> resolver class. I solved it only
> by debugging the code. My JRE 1.4.2 was always loading RT.JAR with old xalan
> and
> in this situation my new
> resovler was not compatible with this old Xalan. BUT! The Xalan always
> reported
> the resolver class could not
> be found.... It made harder to locate the problem for me and it will make it
> harder for any other user with 1.4
> JRE.
>
> You should split the exception into two ones. One should report
> ClassNotFoundException and one could report
> ClassCastException. This can make a life much easyier for users with Java 1.4
> or
> higher...
>
> Here`s the problem part code (ASF license, visit www.apache.org for more
> information about the license):
>
> package org.apache.xalan.xslt;
>
> public class Process
> {
> ......
>
> if("-URIRESOLVER".equalsIgnoreCase(argv[i]))
> {
> if(i + 1 < argv.length)
> {
> try
> {
> uriResolver = (URIResolver)Class.
> forName(argv[++i], true,
> ClassLoader.getSystemClassLoader()).newInstance();
> tfactory.setURIResolver(uriResolver);
> }
> catch(Exception cnfe) // HERE! YOU CAN SEE
> ANYBODY CHANGED IT
> {
>
> System.err.println(XSLMessages.createMessage("ER_CLASS_NOT_FOUND_FOR_OPTION",
> new Object[] {
> "-URIResolver"
> }));
> doExit(-1);
> }
> } else
> {
> System.err.println(XSLMessages.
> createMessage("ER_MISSING_ARG_FOR_OPTION", new
> Object[] {
> "-URIResolver"
> }));
> doExit(-1);
> }
> } else
>
> ......
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]