You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Larry V. Streepy, Jr." <st...@healthlanguage.com> on 2001/06/18 23:18:31 UTC

exception from java task

I'm getting a strange exception when I use the java task:

D:\LE\cplusle\build.xml:1096: java.lang.IllegalAccessException
--- Nested Exception ---
java.lang.IllegalAccessException
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.tools.ant.taskdefs.ExecuteJava.execute(src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java:127)
        at org.apache.tools.ant.taskdefs.Java.run(src/main/org/apache/tools/ant/taskdefs/Java.java:260)
        at org.apache.tools.ant.taskdefs.Java.executeJava(src/main/org/apache/tools/ant/taskdefs/Java.java:123)
        at org.apache.tools.ant.taskdefs.Java.execute(src/main/org/apache/tools/ant/taskdefs/Java.java:87)
        at org.apache.tools.ant.Target.execute(src/main/org/apache/tools/ant/Target.java:153)
        at org.apache.tools.ant.Project.runTarget(src/main/org/apache/tools/ant/Project.java:898)
        at org.apache.tools.ant.Project.executeTarget(src/main/org/apache/tools/ant/Project.java:536)
        at org.apache.tools.ant.Project.executeTargets(src/main/org/apache/tools/ant/Project.java:510)
        at org.apache.tools.ant.Main.runBuild(src/main/org/apache/tools/ant/Main.java:421)
        at org.apache.tools.ant.Main.main(src/main/org/apache/tools/ant/Main.java:149)

Here is the fragment causing the error:

    <java classname="com.cyberplus.util.misc.Dos2Unix">
      <classpath>
        <pathelement location="${install.lib}/${le.jar.fullclient}"/>
      </classpath>
      <arg value="xxx"/>
    </java>

I searched the archives and didn't find a single hit on this exception.
Anyone got any ideas?

Note that when run from the command line, this class is properly loaded
and executes.

-- 
Larry V. Streepy, Jr.
Chief Technical Officer and VP of Engineering

Health Language, Inc.  -- "We speak the language of healthcare"

970/626-5028 (office)           mailto:streepy@healthlanguage.com
970/626-4425 (fax)              http://www.healthlanguage.com

Re: exception from java task

Posted by "Larry V. Streepy, Jr." <st...@healthlanguage.com>.
PLEASE IGNORE THIS: I found that setting fork="yes" avoids the error.
Apparently, the class was calling System.exit() and I guess that was
causing the exception below.

Thanks.

"Larry V. Streepy, Jr." wrote:
> 
> I'm getting a strange exception when I use the java task:
> 
> D:\LE\cplusle\build.xml:1096: java.lang.IllegalAccessException
> --- Nested Exception ---
> java.lang.IllegalAccessException
>         at java.lang.reflect.Method.invoke(Native Method)
>         at org.apache.tools.ant.taskdefs.ExecuteJava.execute(src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java:127)
>         at org.apache.tools.ant.taskdefs.Java.run(src/main/org/apache/tools/ant/taskdefs/Java.java:260)
>         at org.apache.tools.ant.taskdefs.Java.executeJava(src/main/org/apache/tools/ant/taskdefs/Java.java:123)
>         at org.apache.tools.ant.taskdefs.Java.execute(src/main/org/apache/tools/ant/taskdefs/Java.java:87)
>         at org.apache.tools.ant.Target.execute(src/main/org/apache/tools/ant/Target.java:153)
>         at org.apache.tools.ant.Project.runTarget(src/main/org/apache/tools/ant/Project.java:898)
>         at org.apache.tools.ant.Project.executeTarget(src/main/org/apache/tools/ant/Project.java:536)
>         at org.apache.tools.ant.Project.executeTargets(src/main/org/apache/tools/ant/Project.java:510)
>         at org.apache.tools.ant.Main.runBuild(src/main/org/apache/tools/ant/Main.java:421)
>         at org.apache.tools.ant.Main.main(src/main/org/apache/tools/ant/Main.java:149)
> 
> Here is the fragment causing the error:
> 
>     <java classname="com.cyberplus.util.misc.Dos2Unix">
>       <classpath>
>         <pathelement location="${install.lib}/${le.jar.fullclient}"/>
>       </classpath>
>       <arg value="xxx"/>
>     </java>
> 
> I searched the archives and didn't find a single hit on this exception.
> Anyone got any ideas?
> 
> Note that when run from the command line, this class is properly loaded
> and executes.
> 
> --
> Larry V. Streepy, Jr.
> Chief Technical Officer and VP of Engineering
> 
> Health Language, Inc.  -- "We speak the language of healthcare"
> 
> 970/626-5028 (office)           mailto:streepy@healthlanguage.com
> 970/626-4425 (fax)              http://www.healthlanguage.com

-- 
Larry V. Streepy, Jr.
Chief Technical Officer and VP of Engineering

Health Language, Inc.  -- "We speak the language of healthcare"

970/626-5028 (office)           mailto:streepy@healthlanguage.com
970/626-4425 (fax)              http://www.healthlanguage.com

Re: exception from java task

Posted by Peter Donald <do...@apache.org>.
It looks like the method main() is not public 
(protected/private/package/package protected?)


On Tue, 19 Jun 2001 07:18, Larry V. Streepy, Jr. wrote:
> I'm getting a strange exception when I use the java task:
>
> D:\LE\cplusle\build.xml:1096: java.lang.IllegalAccessException
> --- Nested Exception ---
> java.lang.IllegalAccessException
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(src/main/org/apache/tools
>/ant/taskdefs/ExecuteJava.java:127) at
> org.apache.tools.ant.taskdefs.Java.run(src/main/org/apache/tools/ant/taskde
>fs/Java.java:260) at
> org.apache.tools.ant.taskdefs.Java.executeJava(src/main/org/apache/tools/an
>t/taskdefs/Java.java:123) at
> org.apache.tools.ant.taskdefs.Java.execute(src/main/org/apache/tools/ant/ta
>skdefs/Java.java:87) at
> org.apache.tools.ant.Target.execute(src/main/org/apache/tools/ant/Target.ja
>va:153) at
> org.apache.tools.ant.Project.runTarget(src/main/org/apache/tools/ant/Projec
>t.java:898) at
> org.apache.tools.ant.Project.executeTarget(src/main/org/apache/tools/ant/Pr
>oject.java:536) at
> org.apache.tools.ant.Project.executeTargets(src/main/org/apache/tools/ant/P
>roject.java:510) at
> org.apache.tools.ant.Main.runBuild(src/main/org/apache/tools/ant/Main.java:
>421) at
> org.apache.tools.ant.Main.main(src/main/org/apache/tools/ant/Main.java:149)
>
> Here is the fragment causing the error:
>
>     <java classname="com.cyberplus.util.misc.Dos2Unix">
>       <classpath>
>         <pathelement location="${install.lib}/${le.jar.fullclient}"/>
>       </classpath>
>       <arg value="xxx"/>
>     </java>
>
> I searched the archives and didn't find a single hit on this exception.
> Anyone got any ideas?
>
> Note that when run from the command line, this class is properly loaded
> and executes.

-- 
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*