See embedded comments and responses below.

"Zacharias J. Beckman" wrote:

> Happy new year! Almost. Hope you all had a Merry Christmas...
>
> I've recently started using the Apache group's mod_jserv and the Sun/Apache
> Tomcat release. I've been pulled into using this because our new EJB server
> (Sapphire/Web) doesn't support built-in services such as HTTP (well, not as
> a full-blown web server) like our other EJB server (WebLogic) does. So, I'm
> a little new to this environment and have a few general questions... First,
> vaguely about the future of JSP via the Sun/Apache aliance, then more
> technical regarding how to load balance JSPs and keep the Sapphire/Web EJB
> server in the loop...
>
> Tomcat?
>
> It seems that Tomcat and Apache are going to "merge." Does anyone know if
> this is true?

I would look at Tomcat as the "successor" to Apache JServ.  JServ supports the
servlet 2.0 API, while Tomcat already supports 2.2.

In terms of merging, there was progress (in early 1999, before Jakarta was
announced) towards a new component based architecture for Apache JServ.  The
same basic approach was just proposed for Tomcat on the TOMCAT-DEV maililng
list -- we're going to take the best ideas from Apache JServ forward and merge
them with the Tomcat code base.

> And furthermore, according to the Tomcat pages, it's going to
> be the reference implementation of JSP/servlets.

This is already true.  If you go to Sun's pages, you will see that there is no
longer a new JSWDK version -- the download pages now have you go get Tomcat.
If you download the Java2 Enterprise Edition (J2EE) reference implementation,
it has Tomcat embedded within it to provide the servlet/JSP functionality.

> Sounds great... so, based
> on this, I should be using Tomcat with Apache if I want to be heading in the
> right direction. Is this all the right assumption?
>

That would be a good assumption.

The initial development effort was focused on making Tomcat work with the same
MOD_JSERV Apache module used to connect to Apache JServ (to minimize the effort
required to switch).  Essentially, what Apache JServ calls a "zone" becomes a
"context path" in Tomcat terminology.  The next stages will be to improve the
performance of this connector, of the Tomcat container itself, and add other
functionality as needed.

>
> Also regarding Tomcat: While I don't have any solid performance figures yet
> (relative to WebLogic) it seems that our new environment
> (Apache/JSP/servlets/Tomcat) is not performing as well as the all-in-one
> solution of WebLogic.

> Does anyone have any comments on this? Performance is
> a huge concern for us--just slightly below "cross-platform multi-server
> support," so naturally I want to tackle this problem the best possible way.
>

This does not surprise me.

The key issue is the term "reference implementation", which is what Tomcat was
even before it was released as open source.  The whole focus of the developers
was to illustrate ***correct*** functionality, not to create a high performance
servlet container.  Now that it is open source, we can add high performance as
a design goal.  But Tomcat has a lot of room to improve in this area (the new
proposed architecture will also help).

>
> What I've done thus far...
>
> At this point, and keeping in mind that performance is a critical concern,
> I've configured Apache as our web server and am taking advantage of its
> various features in this regard. In addition, the Tomcat JSP/servlet engine
> has been installed (into Apache) so that it can handle servlets and JSP
> pages. Works great, so far. The next hurdle is "properly" getting
> Sapphire/Web integrated. This leaves me with a few high-level questions:
>
> 1. Will Apache/Tomcat perform better as the servlet runner, JSP compiler? [I
> think so, but don't have much evidence for this].
>

I'm not familiar with Sapphire/Web, so I cannot really give you any suggestions
in this regard.

>
> 2. Is there any problem having Apache/Tomcat do this, yet invoking EJB
> objects and other Sapphire/Web services? [I hope not, but this is very vague
> configuration territory to me...]
>

You should be able to access an EJB server from client servlets (and JSP pages)
running inside Tomcat, just like you can from any client Java application.  If
the other Sapphire/Web services have an API that is accessible through TCP/IP
sockets (or RMI, or CORBA) then you should be able to access them.

>
> 3. To keep performance up, I want to avoid Sapphire's SaCGI.cgi generic load
> balance broker, which is the driving force behind this: know I can use a
> Sapphire servlet rather than invoking the SaCGI.cgi script every time I
> start a servlet. This, at least, should be a significant performance gain...
> but is there a better way? [This is Apache on Linux, by the way; NT is not
> an option].

Good OS choice :-).

I don't know enough about Sapphire/Web to comment on the "SaCGI.cgi" stuff.

Apache JServ supports a form of load balancing that lets you host the same set
of servlets in more than one JVM, on the same host machine or on different host
machines.  Documentation details are in the FAQ-O-MATIC at
<http://java.apache.org>.  I do not know if you can plug in Tomcat instead, but
it seems likely that this would work.

>
>
> OK, now the more technical questions:
>
> Again, the concern is performance. My feeling is that using the Tomcat JSP
> engine is going to be more powerful (and current, with servlet 2.2 and JSP
> 1.1 compliance) than using Sapphire/Web's JSP engine. So, what I'm embarking
> on setting up is an environment where Apache/Tomcat compiles JSP pages. BUT,
> I still need to forward some servlets to Sapphire/Web. This is where I'm
> getting a bit confused:
>
> 1. Is there any problem having Apache/Tomcat do all of the servlet running
> and JSP compiling, but still use EJBs and other server-oriented embedded
> objects? Sapphire/Web is (I believe) a compliant EJB server, but does this
> mean I have to hand all servlets to it for execution?
>

It seems to me that servlet running and EJB serving are two completely
different concepts.  Aren't your servlets and JSP pages acting as
EJB *clients*?  If so, there should be no problem accessing the EJB server from
servlets running in Tomcat.

>
> 2. Assuming that I do have to hand some servlets to Sapphire/Web, how can I
> configure Apache/Tomcat to do this? I have a vague idea of setting up a
> handler for a specific type of file (such as *.sjsp or something), then
> sending those EJB-oriented JSPs off to Sapphire for handling. But this seems
> redundant and inelegant... so I think it's the wrong thing to do.
>

Haven't got a clue -- but I don't see why it would be necessary, either.

>
> 3. But, even if I can seamlessly use Apache/Tomcat for all servlet running,
> there is one thing I need to hand off to Sapphire/Web: Load balancing. So,
> how can I configure Apache/Tomcat to run certain load-balanced content in
> Sapphire, yet run other servlets internally? Here, I'm guessing that I
> simply set up an alias to the load balance broker servlet (from Sapphire)...
> this seems straightforward, but I'm hoping someone out there is doing
> something similar to this...
>

It seems unlikely to me that you could integrate with Sapphire/Web's load
balancer for servlet execution, yet still run the servlets in Tomcat -- but I
suppose it might be possible.  As mentioned above, you might investigate the
Apache JServ approach to load balancing for servlets, while still utilizing the
Sapphire/Web support for load balancing EJBs.

>
> 4. And finally, the biggest question that I have no clue on: Will there be
> any problem using the Apache/Tomcat engine (servlets 2.2 and JSP 1.1) with
> Sapphire/Web's 6.2 release, which (again, I believe) is trailing behind by a
> revision or two? Or can I mix and match with impunity?
>

That's obviously a question for them (Sapphire/Web) to answer.

In the general case, if their servlet support is based on the 2.0 servlet API,
you are going to have some significant limitations on what servlets can do
running inside Sapphire -- things like RequestDispatcher were added in 2.1, and
this is pretty important to good servlet/JSP application design.

>
> Anyone's experience in regard to the above would be very interesting readinf
> or me. Thanks for any input... your help is appreciated!
>
> --
> Zacharias J. Beckman - [EMAIL PROTECTED] - (U.S.) 305-281-8701
> Creative Sun Inc., Publishing for the Internet - http://www.creativesun.com
>

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to