We looked at this yesterday, and it turned out to be a class loader
problem because the JAR imported had classes compiled for Java 6, but
the unit tests were running with Java 5.

(Verified by running the beanshell script directly as Java code and
part of the JUnit tests)

We should investigate why that bit of the exception trace didn't show up.


On Mon, Apr 6, 2009 at 11:38, Paolo Missier <[email protected]> wrote:
> I have the following beanshell script:
>
>  <script>import info.ipaw.pc3.PSLoadWorkflow.*;
>
> boolean IsCSVReadyFileExistsOutput =
> LoadAppLogic.IsCSVReadyFileExists("/Users/paolo/Documents/myGRID/OPM/PC3/SampleData/J062941");
>
> if (IsCSVReadyFileExistsOutput) fileExists = "true";
> else fileExists = "false";
> </script>
>
> where LoadAppLogic.IsCSVReadyFileExists is a static method.
>
> This executes correctly from a snapshot workbench when I deposit the
> external jar file info.ipaw.pc3.PSLoadWorkflow.jar into the lib/
> directory relative to the workbench app root.
>
> I then execute the same workflow from eclipse using a Junit test called
> ProvenanceCaptureTest. I have tried:
>
> - adding the jar file to a newly created lib/ directory and then adding
> the jar to the project java build path
> - adding the jar file to a newly created lib/ directory and then adding
> the jar to the classpath in the run configuration for ProvenanceCaptureTest
>
> in all cases I get the following exception:
>
> <error message="Uncaught exception while invoking
> net.sf.taverna.t2.activities.beanshell.beanshellactiv...@5f1c5e"
> type="INVOCATION"><cause>java.lang.ClassLoader.defineClass1(Native Method)
> java.lang.ClassLoader.defineClass(ClassLoader.java:675)
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> java.security.AccessController.doPrivileged(Native Method)
> java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> java.lang.ClassLoader.loadClass(ClassLoader.java:316)
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
> java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
> java.lang.Class.forName0(Native Method)
> java.lang.Class.forName(Class.java:242)
> bsh.classpath.ClassManagerImpl.classForName(Unknown Source)
> bsh.NameSpace.classForName(Unknown Source)
> bsh.NameSpace.getImportedClassImpl(Unknown Source)
> bsh.NameSpace.getClassImpl(Unknown Source)
> bsh.NameSpace.getClass(Unknown Source)
> bsh.Name.consumeNextObjectField(Unknown Source)
> bsh.Name.toObject(Unknown Source)
> bsh.Name.toObject(Unknown Source)
> bsh.Name.invokeMethod(Unknown Source)
> bsh.BSHMethodInvocation.eval(Unknown Source)
> bsh.BSHPrimaryExpression.eval(Unknown Source)
> bsh.BSHPrimaryExpression.eval(Unknown Source)
> bsh.Interpreter.eval(Unknown Source)
> bsh.Interpreter.eval(Unknown Source)
> bsh.Interpreter.eval(Unknown Source)
> net.sf.taverna.t2.activities.beanshell.BeanshellActivity$1.run(BeanshellActivity.java:153)
> java.lang.Thread.run(Thread.java:613)
> </cause></error>
>
>
> -Paolo
>
> ------------------------------------------------------------------------------
> _______________________________________________
> taverna-hackers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/taverna-hackers
> Developers Guide: http://www.mygrid.org.uk/usermanual1.7/dev_guide.html
> FAQ: http://www.mygrid.org.uk/wiki/Mygrid/TavernaFaq
>



-- 
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
taverna-hackers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/taverna-hackers
Developers Guide: http://www.mygrid.org.uk/usermanual1.7/dev_guide.html
FAQ: http://www.mygrid.org.uk/wiki/Mygrid/TavernaFaq

Reply via email to