Tomcat and Pass thru servlet

Hi,
Just wanna more explaination about Tomcat and Pass thru servlet. In tamino description -http://developer.softwareag.com/tamino/passthru/Default.htm i’ve noticed that there are 6 main step how to retrieved data from tamino database using Tomcat and pass thru servlet.

My question is:
I have Apache Tomcat 4.0 and already installed Tamino 2.1.2 in my PC as server.

1)The first thing is I’m going to create simple form from HTML, then pass it to store it in Tamino. Then, from client side, I want to retrieved back the data that I’ve submitted from Tamino database. Which part of this Pass thru servlet will involve and how?

2) Can anybody explain to me how XSLT processor involve? is it possible if i use xt to do this XSLT part?

Thank you , till then, I hope can learn more about Tomcat and pass thru servlet if anybody can give me sample about that. Bye

Best Regards,

Siti Salmah Md Kassim

I assume you’re looking at the new version of the Passthru servlet (4.1.1) that’s just been released? This is specifically tested with Tomcat, and the installation instructions explain how to use it with Tomcat, though you can still use other servlet engines if you prefer.

The passthru servlet allows you to specify an XSLT stylesheet that transforms your XML query results into HTML for display at the browser. You can use any JAXP-conformant XSLT processor, for example Xalan or Saxon, and there’s also a driver that allows people to continue to use xt, which was the only XSLT processor supported in earlier releases of Passthru.

I hope this helps you get started, if you have specific problems, please post them here.

Michael Kay



Hi Micheal,
Hope you will details to me about the driver that allow people to continue use xt…how can I get that driver and how to use it? as I can see xt only can be use if we manually create the new file name and then run it through xt (by dos prompt)… please give me some explaination about this…

Siti Salmah Md Kassim

The driver for xt (called xtdriver.jar) is included in the Passthru download, as are instructions for using it.

xt, like other XSLT processors, has a Java API as well as a command line interface. The Passthru servlet uses this API to control the transformation. It also keeps a cache of compiled stylesheets, so that when you do many transformations using the same stylesheet, the stylesheet is only compiled once.

Michael Kay



:(…I still have asking you this question, I think this is quite basic one, …
1) How I configure this new release pass thru servlet 4.1.1? I already have the old version in folder /SDK/Pass thru servlets…? Should I copy the new one and only put that in same folder?
Then how can I test my Pass thru servlet, wether
it is working or not?

Thanx

Siti Salmah Md Kassim

I would be inclined to install the new servlet without overwriting the old one, even if it’s a test installation rather than a live one. You should be able to do this most easily by creating a new web application directory for it. You could also put it in the existing directory, since all the Java classes in the new servlet have different names from the old: all you need to do is to create new entries for the new servlet (and a new alias) in the web.xml file. Once everything is working you can change the servlet alias to the old one, so that existing applications use the new servlet.

Michael Kay

Hello,
Can you give me one example how to test my application is working or not with new version one, so I can see wether it is working or not from the sample of appilcation. I can use it as my example.
Thanks a lot





Siti Salmah Md Kassim

You can’t really test that everything is working except by testing against an actual Tamino database. It’s therefore difficult to give a simple example. There are a number of sample databases that are in common use, but none that seems to be universal.

A useful intermediate step is to check that the passthru servlet is working in the absence of Tamino. That is, specify a URL with _xmlsrc and _xslsrc parameters that are both URLs of documents that can be statically served by the web server, rather than from Tamino. All you need for this is an XML document and matching stylesheet. You’ll find examples issued with most of the XSLT processors, typically in a directory called “samples”.

Michael Kay

Hi, can you give some solution to overcome my problmes with Apache Jserv…I already installed JServ1.1 in my server, but the test page doesn’t not come out, I know my installation have problem, but where, can you give some suggestion?





Siti Salmah Md Kassim

I already ask about the Apache JServ, but since no answer, I have another question, about connecting Apache and Tomcat. In the documentation, there state that:

First, add the following line to httpd.conf in the /conf/ directory of the web server installation (for example, c:\Program Files\Apache Group\Apache\conf):

Include c:\TOMCAT\conf\apache-connector.conf
Now create the file c:\TOMCAT\conf\apache-connector.conf with contents such as the following:

LoadModule jk_module “C:\Program Files\Apache Group\Apache\modules\mod_jk.dll”
AddModule mod_jk.c
JkWorkersFile c:\TOMCAT\conf\workers.properties
JkLogFile c:\TOMCAT\logs\mod_jk.log
JkLogLevel info
JkMount /examples/* ajp13
JkMount /examples/servlet/* ajp13

The module mod_jk.dll (or mod_jk.so on a UNIX platform) is a plug-in to Apache that handles the communication between the Apache web server and Tomcat. The same module works with both Tomcat 3 and Tomcat 4. Check that the module is present in the /modules/ directory within the Apache installation: if not, you can get more information about this module, including download instructions, from http://jakarta.apache.org/tomcat/tomcat-3.3-doc/mod_jk-howto.html.

The mod_jk module is specific to Tomcat; if you use a different servlet container, you will need a different connector module. For example, if you use JServ you will need the older module mod_jserv.

The JkMount instructions ensure that all URLs of the form /examples/* or /examples/servlet/* are directed to the servlet container using the ajp13 protocol.

Next, create the file workers.properties in the Tomcat /conf/ directory. This gives Tomcat information about where to listen for requests from the Apache web server. A minimal example is shown below:

#
# Simple worker configuration file
#

workers.tomcat_home=“C:\TOMCAT”
workers.java_home=“C:\j2sdk1.4.0”
ps=/

worker.list=ajp13

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

Checking that Apache and Tomcat are Working Together
It should now be possible to invoke the TaminoTest servlet via the Apache web server. Start up both Apache (on Windows, use the Services dialog within the Administrative Tools section of the Control Panel) and Tomcat (as described above).

Check if Apache is running by typing the following into the address bar of the web browser:

http://localhost/

Now try:

http://localhost/examples/servlet/com.softwareag.tamino.passthru.TaminoTest

I already follow this instruction, but still cannot receive the test page of pass thru servlet, is there any solution? ANd about the mod_jk, is it I have download it if I don’t have it in my C:\Program Files\Apache Group\Apache\modules\mod_jk.dll.

Can you details to me step by step what should I check to receive the pass thru servlet test page…

Best Regards,

Siti Salmah Md Kassim

The URL http://localhost/examples/servlet/com.softwareag.tamino.passthru.TaminoTest
is testing several components all at once, so it might be helpful to break this down into smaller tests.

First,
http://localhost:8080 should connect to Tomcat and give you a Jakarta Project home page, assuming Tomcat is listening on port 8080.

Second, try one of the Servlet examples available from this home page, for example:
http://localhost:8080/examples/servlet/HelloWorldExample

Then try the passthru servlet test class:
http://localhost:8080/examples/servlet/com.softwareag.tamino.passthru.TaminoTest
This will load and execute class com.softwareag.tamino.passthru.TaminoTest from the Tomcat webapp called examples. To make this work, you need to have copied passthru.jar into the Tomcat webapps/examples/WEB-INF/lib directory or you will get ClassNotFound-type exceptions.

Finally you can test Apache to Tomcat integration by removing the explicit port 8080 from the last request:
http://localhost/examples/servlet/com.softwareag.tamino.passthru.TaminoTest

If any of these tests fail, please tell us exactly how they fail.

HTH

Hi Bill,
Thanks, all my test page according to your suggestions are working. Next step is configuring my pass thru servlet, right?
Thanx a lot.
:slight_smile:




Siti Salmah Md Kassim

I hope that you already solved your apache+tomcat problem, but…

While you’ve mentioned that you did installed JServ, so, have you already removed all jserv-related directives?
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/mod_jk-howto.html#s71

Hi,
That is another problme actually, thanks for remind me. But, how can I know there is related jserv in my server? I don’t know which mod_jk I must have, because there are a lot of file to choose, which one?




Siti Salmah Md Kassim

Hi,
That is another problem actually, thanks for remind me. But, how can I know there is related jserv in my server? I don’t know which mod_jk I must have, because there are a lot of file to choose, which one?




Siti Salmah Md Kassim

The most simplest way to check all the jserv directive is,

1. remove the mod_jserv.dll in your apache’s modules directory
2. start apache by apache.exe (don’t use net start apache), if you still have jserv directive, apache will warn you, with the exact line number

Please find the following detail documentation about configuring Apache 2.0 + Tomcat 4.x,
http://www.galatea.com/flashguides/apache-tomcat-24-win32.xml

Instead of building mod_jk.dll yourself, there are some ready-to-use, either download it at http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/win32/i386/ or use your own, as far as yours is NOT compiled for EAPI.

Lun

Hello Lun,
There is no mod_jserv.dll in my APache modules, so what should I do?




Siti Salmah Md Kassim

Hi,
Before this, all my test page on Pass thru servlet are working, but, a yesterday, I’m not success at the last page. I can’t trace which part that I fail, but, for the last part, that is connecting Apache and Tomcat, I can’t get the test page…why? by the way is there any connection with tha Apache Tomcat 4.0 that I use now? Please explain to me…:slight_smile:

http://localhost/examples/servlet/com.softwareag.tamino.passthru.TaminoTest





Siti Salmah Md Kassim

Please see if there is "ApJServMount … " or “include …jserv.conf”, etc. in your httpd.conf, if not, I think your apache conf is “clear” enough to use mod_jk then.

BTW, what have you change by your “before this” to make the test page stop from working? in fact, may I know what version of apache and tomcat are you using now? I believe you are using Tomcat 4 by your very first post, and I hope you are not using Netscape,

Quote:
[There is a known problem with Netscape 4.7.x, mod_jk and Apache 2.0. When access a Tomcat page using Netscape 4.x, part of the page displays, the browser hangs, and eventually displays “Document done” without showing the entire page. This is NOT fixed in 2.0.36, as I reported earlier.]

I’m using apache 1.3.26+tomcat 3.3a, I have my passthru running well. If you are using apache 2.x+tomcat4.x, have you following the link I posted before? Does this page works?

http://localhost/examples/

If yes, apache+tomcat working. Remember, always start Tomcat before apache, and whenever you change tomcat setting, both tomcat and apache should be restart. Shutdown apache first, then restart tomcat, then start apache.

Lun

First, thanks to Lun and to Bill Leeney for trying to help “buha” with this problem. I’ve been lurking, but haven’t been able to add much that’s useful.

Configuring Apache and Tomcat is one of those things where either everything works perfectly first time, or it fails with error messages that are very hard to diagnose. I would try to get rid of all trace of JServ and mod_jserv here, which seems to be a distraction that is confusing the issue. Step back for a moment:

1: is Apache working, when used on its own, without Tomcat?

2: is Tomcat working, when used on its own, without Apache? (ie. do the example servlets work?)

3: is Tomcat working, when used via Apache? If not, the problem is to do with the mod_jk module and the linking of the Tomcat and Apache configuration files. Try to follow the instructions given in the Tomcat distribution exactly, for the simplest possible scenario, and build up from there.

Michael Kay