• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache-Tomcat Integration

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to integrate Tomcat3.2.1 and Apache1.3.9 to work with JSP and Oracle. I have installed mod_jserv also as server adapter. Appropriate changes were done in the tomcat.conf file in Tomcat and httpd.conf of Apache.
In httd.conf the following lines were added:
include d:/jakarta-tomcat-3.2.1/conf/tomcat-apache.conf
include d:/jakarta-tomcat-3.2.1/conf/tomcat.conf
I start Tomcat and then Apache, in starting Apache I get the syntax error in line where the line is
ApjServManual on
Could you help me out!!!
Thanks in advance,
Suresh.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
U have to download ApacheServModule.dll (not sure about he name)
from jakarta.apache.org
and put in a folder .
read the installation notes for tomcat server.
Xavier
 
Venkat Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Xavier VS:
hi,
U have to download ApacheServModule.dll (not sure about he name)
from jakarta.apache.org
and put in a folder .
read the installation notes for tomcat server.
Xavier


Thanks for ur reply,I have installed ApacheJservModule.dll . I placed my Html and Jsp files in the htdocs directory of Apache. I am not able to redirect the request to Tomcat for serving the dynamic content. My request is being served if I place the Jsp file in Tomcat's webapps/examples/... directory. How could I respond for a request for JSP file without placing it in Tomcat?
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there,
Mail me i will give u entire files regarding this.
bye
regards
ganesh
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a short snip from a document I made for myself after a few weeks of figuring things out.
Tomcat uses server.xml to load up contexts. A context in simplest terms, is that which appears after http://localhost:8080/ By default, Tomcat will create a context with the same name as each of the folders under the webapps directory. So if you want to group together a "JSP application" under http://localhost:8080/mySite then place the mySite folder inside of webapps, and Tomcat will create this context for you. If your folder is somewhere else on the hard drive, you can still have Tomcat load it, but you must specify it in server.xml


Partial listing of server.xml...
NOTE: It is very important to place Context statements within the appropriate XML tags. You must place a new <Context> tag within the <ContextManager> tag.
.
.
.
<Context path="/mySite"
docBase="C:\aFolder\someFolder\myFolder"
debug="0"
reloadable="true">
</Context>

Hopefully you can manage to understand how to modify this file.
 
Venkat Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mike.
It really worked, I am able to direct my request for .jsp to Tomcat. But I am hooked up with another problem in porting it completely. I have some .class files for .jsp . Earlier I placed them in "\webapps\examples\WEB-INF\classes" of Tomcat, It was fine. Where should i place my class files now in Apache to make my Apache+Tomcat serve the .jsp file.
Thanks in advance,
Manne.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
same place as before, you shouldn't have to move them.

In your case, your 'JSP application' is the entire folder 'examples'. You can move this entire folder intact to anywhere on your harddrive, including the Apache htdocs directory. As long as you specify in web.xml for Tomcat, then the class files will be found.

I have tested this on my system. It works. My web.xml looks like this...
 
Venkat Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There was not much success this time..and I am repeatedly getting the same error. I placed my Java Class files directory as before ie in "\webapps\examples\WEB-INF\classes" and modified the web.xml file by adding the following lines:
<ContextManager debug="0" workDir="work" showDebugInfo="true" >
<Context path="\mysite"
docBase="c:\Program Files\Apache Group\Apache\htdocs\mysite"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
</ContextManager>
The error I get is:
org.apache.jasper.JasperException: Unable to compile class for JSPD:\jakarta-tomcat-3.2.1\work\localhost_8080%2Falscsite\_0002fsearch_0002fparaSearch_0002ejspparaSearch_jsp_0.java:16: Package pool not found in import.
where "pool" is my folder of class files placed in the directory mentioned earlier.
Please help me out,
Manne.

[This message has been edited by Venkat Manne (edited May 31, 2001).]
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One small thing... it should be <Context path="/mysite" not \mysite

This sounds like a packaging problem. Before you moved directories around, did you have this web application working at all? I can't see the JSP import statement, but let's say you have <%@ page import="pool.myPoolClasses.PoolMgr"%>

then under the web-inf/classes directory, you'd have to have pool/myPoolClasses/PoolMgr.class

And also, PoolMgr.java would need the package statement 'package pool.myPoolClasses;'

If all of this is done (if this site worked before you moved it) then I'm not sure of the problem.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wait, I just realized something.

You have your class files in the wrong web application.

You have to consider each folder under webapps as separate and distinct. Tomcat does. If you place class files for application 'a' in the web-inf/classes folder of application 'b', then they will not be found.

If your site is: docBase="c:\Program Files\Apache Group\Apache\htdocs\mysite"

Then you need a mysite/web-inf/classes folder, and move your 'pool' folder here.
 
Venkat Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Earlier I placed 'mysite' in "\webapps\examples\" and the class files as said in my earlier note. Now "mysite" is shifted to "\htdocs\" of Apache. My class files fails to get imported. I created the seperate directory as shown above by you. Still they are failing. Any suggestions to continue..hope some from you.
Thanks in advance,
Manne.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just so it's clear:

This is what you should have - A directory structure like this:
C:/Program Files/Apache Group/Apache/htdocs/mySite/web-inf/classes

A web.xml file that contains this:
Your jsp pages should be under:
C:/Program Files/Apache Group/Apache/htdocs/mySite
Your class files should be in their proper directories (matching their respective packages) starting:
C:/Program Files/Apache Group/Apache/htdocs/mySite/web-inf/classes

If all of this is so, then I don't know what the problem is. Make sure you have your *.class file at the correct level in the folders. Other than that, I don't know what's wrong.
[This message has been edited by Mike Curwen (edited May 31, 2001).]
 
Venkat Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mike.
It really worked, I am able to redirect the requests and everything is fine. Hope to talk to you soon.
Thanks again,
Suresh.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic