Connecting Apache And Tomcat

Hi,I am a new user of Tamino 4.1.4.1 and I want to retrieve data from tamino database using Tomcat and pass thru servlet. And I notice there is a instruction named ?Installing the Tamino Passthru Servlet? and I have followed the instruction(I have installed Apache2 and Tomcat 4.1 to C:\Program Files) but I fond there is some difficulties for me. They are :
1. The instruction says :


Then I add

to the end of the httpd.conf.
The question is am I right to add the line to the end of the file?

2. The instruction says :


So I creat a file c:\ Program Files \ Tomcat 4.1\conf\apache-connector.conf with contents such as the following:
LoadModule jk_module "C:\Program Files\Apache Group\Apache2\modules\mod_jk.dll"
AddModule mod_jk.c
JkWorkersFile c:\ Program Files \ Tomcat 4.1\conf\workers.properties
JkLogFile c:\ Program Files \ Tomcat 4.1\logs\mod_jk.log
JkLogLevel info
JkMount /examples/* ajp13
JkMount /examples/servlet/* ajp13
The question is :
At this time I fond there is no mod_jk.dll in the C:\Program Files\Apache Group\Apache2\modules so I downloaded
jakarta-tomcat-connectors-1.2.8-src .But I still cannot find mod_jk.dll . Another question is I also cannot find mod_jk.c and c:\ Program Files \ Tomcat 4.1\logs\mod_jk.log.

So these make me cannot succeed in checking Apache and Tomcat Working Together. Please if any one can help me it would be much appreciated.

Best Regards,
Angular

Hi,
It’s fine to add the “Include…” to the bottom of httpd.conf. You need to download the mod_jk.dll binary. The one I use for Tomcat5.5 and Apache2 came from: >here<. I downloaded “mod_jk_1.2.6_2.0.50.dll” and renamed it to mod_jk.dll as described on the download page.
You don’t need to worry about missing mod_jk.log - this is an output log file which mod_jk produces when it executes.
On windows it is normal for mod_jk.c to be missing so the “apache-connector.conf” file looks like this:

<IfModule !mod_jk.c>
LoadModule jk_module "C:/Program Files/Apache Group/Apache2/modules/mod_jk.dll"
</IfModule>
JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5/conf/jk/workers.properties"
JkLogFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5/logs/mod_jk.log"
JkLogLevel emerg
JkMount /examples ajp13
JkMount /examples/* ajp13
JkMount /webdav ajp13
JkMount /webdav/* ajp13
JkMount /tomcat-docs ajp13
JkMount /tomcat-docs/* ajp13
JkMount /manager ajp13
JkMount /manager/* ajp13


HTH

Hi Bill,
It is very nice of you to help me.I did as what you told me. It does work! So thank you again!

Best regards
Angular

Hi
Firstly I would like to thank to Bill for helping me in Tomcat and Apache configuration. And gladely, I already success in it .But, there is other problem, i don’t konw how to install the Xerces on the windows xp professional.I have downloaded the “Xerces-J-bin.2.6.2.tar.gz” and copoied the "xercesImpl.jar, xmlParserAPIs.jar and xml-apis.jar " to my “C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\lib” .
I added the element as a child of the top-level element in my “C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\web.xml” as below(I have installed the JDK 1.4):


transform
com.softwareag.tamino.passthru.TaminoFilter

contenttype
text/html


allowremote
no


trace
on


log
on


cache
on


transformer
org.apache.xalan.processor.TransformerFactoryImpl





parser
org.apache.xerces.jaxp.SAXParserFactoryImpl





After i made changes to the web.xml configuration file, i closed down Tomcat and restarted it.

Then i inputed the
http://localhost/examples/servlet/transform/tamino/lk/test?_xql=wenshu/@1&_xslsrc=xsl:stylesheet/@1"
into the browser and i can get the backgroound-colour which i definded in the stylesheet.But I can’t get the data of the instance of the “wenshu” doctype.

I think maybe there is something wrong with the xerces setting.It is because after i did as below:

”"

i still got the same result.

Can you tell me how to deal with this problem?

Best Regards
Angular v

Hi,
Here are some checks that should help:


  • Check if your query works without Pass-thru Servlet: http://localhost/tamino/lk/test?_xql=wenshu
    Make a note of the root element of the data which is returned. It should be "ino:response…"
  • Check if the Pass-thru Servlet runs properly: http://localhost/examples/servlet/com.softwareag.tamino.api.servlet.TaminoTest
  • Check if Pass-thru Servlet works without _xslsrc parameter: http: //localhost/examples/servlet/com.softwareag.tamino.api.servlet.TaminoFilter/tamino/lk/test?_xql=wenshu
  • Check that the stylesheet correctly matches the root element of the xml response. It should start matching with something like:
    
    <xsl:template match="/">
    <xsl:apply-templates select="ino:response/xql:result"/>
    </xsl:template>


  • If this doesn’t help, try using a stylesheet like this to understand the xml response data you are trying to match
    <xsl:stylesheet ............>
    <xsl:template match="/">
    <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:stylesheet>


    If this doesn’t work, then you can be pretty sure that you have a system configuration problem and not a stylesheet problem. Conversely, if it does work, it will show you exactly what the source XML document looks like, so you can write a customised transformation for it.


HTH,
Bill

Hi bill,

At first I would like to say thanks to you, I do as you told me, and it does work. I have some questions about retrieving data from Tamino database with a stylesheet designed by myself.

My software configuration is as below:
Windows XP professional with sp2
Tanmio XML server 4.1.4.1
Apache HTTP Server 2.0.48
Apache Tomcat 4.1
JSDK 1.4
Internet Explorer 6.0

When I use a URL without simple Chinese as below:

I can get a correct result. But if I use a URL which contains some simple Chinese words as below:

I got the error message like this:

So I think maybe the problem lies in supporting simple Chinese, if not could you give me some suggestion to solve the problem?

Best Regards,
Angular

Hi,
The original question here was about connecting Tomcat and Apache, and later we moved on to the PassThru Servlet.
Now all of that is working, but the issue has changed to Tamino support for Chinese characters. I think you should raise this question with your local Software AG Support Centre.
Thanks and Best regards
Bill

Hello,

this thread was very helpful and I got the passthru servlet working with Tomcat 4.1, but not with Tomcat 5.0 or 5.5.

Which adjustments do I have to make so I can use it with Tomcat 5.x?

Thanks in advance,
Jo Richter

Hello Jo,
By default, the invoker servlet is disabled in later versions of Tomcat, and the easiest way to make the passthru servlet work (assuming that this is your problem) is to re-enable Tomcat’s invoker servlet. To do this, edit the “web.xml” file in Tomcat’s “conf” directory, find the “servlet” section for the invoker and uncomment it, then find the “servlet-mapping” section and uncomment it. Finally, restart Tomcat. If everything works, great. If not, please start a new topic and give us a bit more detail on the error you receive.
Thanks.

Thank you Bill,

that was exactly my problem. I did everything the same way I did with Tomcat 4, but it just didn’t work with Tomcat 5.x.

Now it works, thank you very much for your help!

Greetings from Germany,
Jo