You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Horace A. Vallas, Jr." <ha...@hav.com> on 2003/04/15 22:12:54 UTC

using jacl and tcljava with tomcat - was Re: problem calling tcl from jsp (maybe OT)

Hi all - just as info (and to get it in the archive and maybe a FAQ somewhere)
I found that to get jacl and tcljava jars to work with tomcat (3.3.1 anyway)
I had to do the following...

1. place the jacl and tcljava jars in $JAVA_HOME/jre/lib/ext

2. remove the jacl and tcljava jar's from the classpath (not sure this
    is absolute requirement but it works)

3. remove the jacl and tcljava jar's from the tomcat container dirs
    (i.e. apps, common etc.)

4. it is OK to leave the jacl and tcljava jar's in local WEB-INF/lib

after this, jacl is able to find the init.tcl file located in the
jacl.jar file and things work like a charm -- in jsp, in beans,
taglibs etc.

I was using tomcat 3.3.1 and Java HotSpot Client VM Blackdown-1.3.1_02a-FCS
with javc/tcljava 1.2.6 (also tried 1.3 though it's, apparently, not ready
for prime time)


Horace A. Vallas, Jr. wrote:
> Hi folks -- I had this working but moved my server and, in rebuilding
> I seem to have whacked something.
> 
> when I try calling tcl from a jsp I get an error like...
> 
>    javax.servlet.ServletException: unexpected TclException:
>         tcl.lang.TclException: cannot read resource 
> "/tcl/lang/library/init.tcl"
>    at 
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460) 
> 
>    ...
> 
> I've tried putting init.tcl all over the place but cannot seem to
> find anywhere that it can be seen (have checked permissions etc.).
> 
> Does anyone have any ideas how I can make the init.tcl visible
> to jsp's? (tomcat-3.3.1 btw) the jacl, blend and tcljava jars are in the
> system classpath as well as in WEB-INF/lib.
> 
> little jsp snipit example would be like...
> 
> <html><head> <title>Test eval of tcl code in .jsp</title>
> <%@ page import="tcl.lang.*;" %>
> </head><body bgcolor="#ffffff"><h1>Test eval of tcl code in .jsp</h1>
> Let's try evaluating some tcl code from within a JSP ...
> <p>
> <%
>     Interp interp;
>     interp = new Interp();
>     interp.eval("package require java");
>     String result = "";
>     try {
>         String s1 = "set a [split {kicker} {}];";
>         out.println("<p>==================<p>Test #1: Simple split<p>");
>         out.println("<b>" + s1 + " ==></b><br>");
>         interp.eval(s1);
>         result = interp.getResult().toString();
>         out.println(result);
> 
> etc. etc. etc.
> 


-- 
Horace                            ...once known as "Kicker" :-)
================================================================
...drop by and chat if I'm online       http://www.hav.com/chat/
================================================================
Horace Vallas   hav.Software                 http://www.hav.com/
                 P.O. Box 354                         hav@hav.com
                 Richmond, Tx. 77406-0354     voice: 281-341-5035
                 USA                            fax: 281-341-5087

Thawte Web Of Trust Notary in SW Houston, Tx.
http://www.hav.com/?content=/thawteWOTnotary.htm
================================================================
What is a Vet? ... He is the barroom loudmouth, dumber than five
wooden planks, whose overgrown frat-boy behavior is outweighed a
hundred times in the cosmic scales by four hours of exquisite
bravery near the 38th parallel. ...   - Unknown
================================================================