I believe you would have to upload the JAR file per run to the lib/
sub-folder of the working directory, e.g. to:
/runs/{id}/wd/lib/
See
http://dev.mygrid.org.uk/wiki/display/tav250/REST+API#RESTAPI-Resource:/runs/{id}/wdResource:/runs/{id}/wd/{path%E2%80%A6}
Alternatively you would have to modify the bundled Taverna
installation. It would not work to add it to
webapps/tavernaserver/WEB-INF/lib as that is only used by the Taverna
Server web application - the workflow is executed in a standalone
process using the bundled Taverna Command line.
You can try to add the JAR to
WEB-INF/classes/util/taverna-commandline-enterprise-2.5.0/lib which
will add the library to the system classpath for the command line
tool. The difference between this approach and the first (adding it
to /wd/lib/ per run) is that this system-wide installation can more
easily conflict with Taverna's library - while the wd loading is done
through Taverna's plugin system and is loaded in isolation within the
workflow run.
On 21 July 2014 21:10, Kotliarov, Alex (NIH/NLM/NCBI) [C]
<[email protected]> wrote:
> Hi Alan,
>
>> Did you add json-simple-1.1.1.jar to the user lib directory for the
>> workbench and specify it as a dependency of the beanshell? In the core
>> workbench I get the same error as you get in the server. Which variant of
>> the >
>> workbench are you running? (It says at the top.)
>
> Taverna Workbench Core 2.5.0
>
> I did copy json-simple-1.1.1.jar to the lib directory for the workbench and
> specified it as a dependency for the beanshell. Classloader persistence is
> set to "Shared for whole workflow".
>
>> Donal Fellows who writes the server will reply tomorrow. From your comment
>> about the tomcat library directories, I assume you have write access to the
>> server webapp directory.
>
> I do have write access to the Tomcat's webapp directory and did copy
> json-simple-1.1.1.jar to 'webapps/tavernaserver/WEB-INF/lib'
>
> Thanks,
>
> Alex
>
> -----Original Message-----
> From: Alan R Williams [mailto:[email protected]]
> Sent: Monday, July 21, 2014 3:58 PM
> To: [email protected]
> Subject: Re: [Taverna-users] Taverna 2.5 server / BeanShell / Class:
> JSONObject not found in namespace
>
> On 21-Jul-14 18:57, Kotliarov, Alex (NIH/NLM/NCBI) [C] wrote:
>> Hello,
>
> Hello
>
>> I am trying to execute a workflow run via REST API on Taverna server
>> 2.5 running under Tomcat7.
>>
>> Some of the BeanShell scripts use JSONObject class from
>> json-simple-1.1.1.jar and I get "Class: JSONObject not found in
>> namespace" error:
>>
>> "Processor 'make_payload' - Port 'json_text': Line 4: Sourced file:
>> inline evaluation of: ``import java.io.StringWriter; import
>> org.json.simple.JSONObject; JSONObject obj . . . '' : Typed variable
>> declaration : Class: JSONObject not found in namespace"
>>
>> A script looks like this:
>>
>> import java.io.StringWriter;
>>
>> import org.json.simple.JSONObject;
>>
>> JSONObject obj = new JSONObject();
>>
>> obj.put("submission_id", submission_id);
>>
>> StringWriter out = new StringWriter();
>>
>> obj.writeJSONString(out);
>>
>> json_text = out.toString();
>>
>> In workbench everything works fine.
>
> Did you add json-simple-1.1.1.jar to the user lib directory for the workbench
> and specify it as a dependency of the beanshell? In the core workbench I get
> the same error as you get in the server. Which variant of the workbench are
> you running? (It says at the top.)
>
>> I have tried to put json-simple JAR into tomcat library directories.
>
> Donal Fellows who writes the server will reply tomorrow. From your comment
> about the tomcat library directories, I assume you have write access to the
> server webapp directory.
>
>> Thank you for your help,
>>
>> Alex Kotliarov
>
> Alan
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck Code Sight
> - the same software that powers the world's largest code search on Ohloh, the
> Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> taverna-users mailing list
> [email protected]
> [email protected]
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/about/contact-us/
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> taverna-users mailing list
> [email protected]
> [email protected]
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/about/contact-us/
--
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester
http://soiland-reyes.com/stian/work/ http://orcid.org/0000-0001-9842-9718
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/