You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Torok Edwin (JIRA)" <xa...@xml.apache.org> on 2007/09/28 13:28:50 UTC

[jira] Created: (XALANJ-2403) EnvironmentCheck.checkEnvironment throws exception when Ant is not present

EnvironmentCheck.checkEnvironment throws exception when Ant is not present
--------------------------------------------------------------------------

                 Key: XALANJ-2403
                 URL: https://issues.apache.org/jira/browse/XALANJ-2403
             Project: XalanJ2
          Issue Type: Bug
          Components: Xalan
    Affects Versions: 2.7
         Environment: Linux edwin-t-new 2.6.22.1-cfs-v19 #1 SMP PREEMPT Tue Jul 17 12:46:51 EEST 2007 i686 GNU/Linux
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
            Reporter: Torok Edwin
            Priority: Trivial


boolean environmentOK = (new EnvironmentCheck()).checkEnvironment (new PrintWriter(System.err));

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at org.apache.xalan.xslt.ObjectFactory.findProviderClass(ObjectFactory.java:506)
	at org.apache.xalan.xslt.EnvironmentCheck.checkAntVersion(EnvironmentCheck.java:994)
	at org.apache.xalan.xslt.EnvironmentCheck.getEnvironmentHash(EnvironmentCheck.java:224)
	at org.apache.xalan.xslt.EnvironmentCheck.checkEnvironment(EnvironmentCheck.java:167)

Problem is that in Environmentcheck.java (even in latest SVN version), there is a try/catch block for Exception.
But NoClassDefFoundError is an Error, not Exception.

To fix this Throwable should be catched, instead of exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2403) EnvironmentCheck.checkEnvironment throws exception when Ant is not present

Posted by "Torok Edwin (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530984 ] 

Torok Edwin commented on XALANJ-2403:
-------------------------------------

Relevant portion from EnvironmentCheck.java:
 try
    {
      final String ANT_VERSION_CLASS = "org.apache.tools.ant.Main";
    ....
      Class clazz = ObjectFactory.findProviderClass(
        ANT_VERSION_CLASS, ObjectFactory.findClassLoader(), true);
    }
    catch (Exception e)
    {
      h.put(VERSION + "ant", CLASS_NOTPRESENT);
    }

> EnvironmentCheck.checkEnvironment throws exception when Ant is not present
> --------------------------------------------------------------------------
>
>                 Key: XALANJ-2403
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2403
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>         Environment: Linux edwin-t-new 2.6.22.1-cfs-v19 #1 SMP PREEMPT Tue Jul 17 12:46:51 EEST 2007 i686 GNU/Linux
> java version "1.6.0_02"
> Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
> Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
>            Reporter: Torok Edwin
>            Priority: Trivial
>
> boolean environmentOK = (new EnvironmentCheck()).checkEnvironment (new PrintWriter(System.err));
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/AntMain
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> 	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> 	at org.apache.xalan.xslt.ObjectFactory.findProviderClass(ObjectFactory.java:506)
> 	at org.apache.xalan.xslt.EnvironmentCheck.checkAntVersion(EnvironmentCheck.java:994)
> 	at org.apache.xalan.xslt.EnvironmentCheck.getEnvironmentHash(EnvironmentCheck.java:224)
> 	at org.apache.xalan.xslt.EnvironmentCheck.checkEnvironment(EnvironmentCheck.java:167)
> Problem is that in Environmentcheck.java (even in latest SVN version), there is a try/catch block for Exception.
> But NoClassDefFoundError is an Error, not Exception.
> To fix this Throwable should be catched, instead of exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org