You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Steve Brewin <sb...@synsys.com> on 2003/06/18 16:24:46 UTC

External Jars for Scripting

Hi,

I'm testing a ScriptingMailet that uses BSF (Bean Scripting Framework) to
run scripts that define mailet logic.

This requires one dependant jar - bsf.jar, and optional jars for each of the
scripting languages used, such as jython.jar, NetRexxC.jar and rhino.jar.

What, if any, is the policy for packaging such jars? bsf.jar should probably
be added to /lib, but what about the optional jars? Unless I'm missing
something, they have to end up in the .sar file to be found at runtime. This
doesn't make them very optional!

Is there a smart way around this?

-- Steve


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


RE: External Jars for Scripting

Posted by Steve Brewin <sb...@synsys.com>.
> From: Josip Almasi [mailto:joe@vrspace.org]
> Sent: 18 June 2003 15:36
> To: James Developers List
> Subject: Re: External Jars for Scripting
> Easy way is -Djava.ext.dirs.
> 
Thanks, that works fine!

-- Steve


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


RE: External Jars for Scripting

Posted by Steve Brewin <sb...@synsys.com>.
Noel,

> You are missing something.  :-)  This is for a Mailet, therefore as of
> version 2.2, you ought to be able to put them into
> SAR-INF/lib, courtesy of
> the new loader.

Using 2.1.3 as my development baseline. Will test against latest 2. and 3.
builds once I'm happy my code is good.

Anyway, making good progress. This works...

<mailet match="All" class="ScriptedMailet">
   <language>javascript</language>
   <init>mailetBean.log("Hello World");</init>

<service>mailetBean.log(mailetBean.getMail().getSender().toString());</servi
ce>
   <destroy>mailetBean.log("Goodbye Cruel World");</destroy>
</mailet>

ScriptedMatcher next.

-- Steve


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


RE: External Jars for Scripting

Posted by "Noel J. Bergman" <no...@devtech.com>.
> What, if any, is the policy for packaging [additional] jars?  bsf.jar
> should probably be added to /lib, but what about the optional jars?
> Unless I'm missing something, they have to end up in the .sar file
> to be found at runtime. This doesn't make them very optional!

You are missing something.  :-)  This is for a Mailet, therefore as of
version 2.2, you ought to be able to put them into SAR-INF/lib, courtesy of
the new loader.

	--- Noel


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


Re: External Jars for Scripting

Posted by Josip Almasi <jo...@vrspace.org>.
Steve Brewin wrote:
> 
> This requires one dependant jar - bsf.jar, and optional jars for each of the
> scripting languages used, such as jython.jar, NetRexxC.jar and rhino.jar.
> 
> What, if any, is the policy for packaging such jars? bsf.jar should probably
> be added to /lib, but what about the optional jars? Unless I'm missing
> something, they have to end up in the .sar file to be found at runtime. This
> doesn't make them very optional!
> 
> Is there a smart way around this?

A smart classloader would be the smartest way, and if you come up with 
some please let me know.
Easy way is -Djava.ext.dirs.

Regards,
Josip


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