You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thangalin <th...@gmail.com> on 2010/11/18 17:04:16 UTC

Tomcat, JasperServer, and JAR files

Hi,

The iReport tool (and hence JasperReports) bundles scores of JAR files
across two different directories. (One of these JAR files conflicts with a
JAR file deployed by Tomcat.)

For development purposes it makes sense to have Tomcat and iReport installed
on the same machine. This poses a maintenance burden in the following
scenarios:

   1. *Bundle JARs with Servlet.* When deploying a JSP or Servlet that uses
   JasperReports, make a build script that packages up all the required JAR
   files into a WAR file before deploying to Tomcat.
   2. *Common libraries.* Copy the JAR files into Tomcat's common library
   directory.

In the first case, multiple applications using JasperReports will result in
a gross waste of resources as each WAR file would have to contain the
entirety of JasperReports. Although this allows for different applications
to use different versions of JasperReports, I believe that to be an uncommon
scenario.

It is possible to write and maintain multiple build scripts that use a
single location of JasperReports as the source of JAR files. This is a
hassle and still does not resolve the problem of having to bundle
JasperReports multiple times.

In the second case, there seems like there is nowhere to put the JAR files
that would not mix with existing JAR files (required by Tomcat). I am
looking for a spot to place all the JasperReports JAR files such that:

   - Upgrades are trivial (erase a directory, copy new version, done)
   - All applications can use it (one version of JasperReports for all
   applications)
   - The JAR files do not mix with other files
   - Maven, Ivy, or Ant is not required to maintain the JARs

Further, this leaves two copies of the JAR files on the development machine:
one in Tomcat's directory and one in iReport's directory hierarchy. I'd
prefer a single copy: the one with iReport. That way, when iReport is
upgraded, Tomcat need only be restarted.

Any ideas how the maintenance burden of multiple copies of JasperReport's
significant number of JAR files can be eliminated?

Many thanks,
Dave

Re: Tomcat, JasperServer, and JAR files

Posted by Mark Thomas <ma...@apache.org>.
On 18/11/2010 18:42, Thangalin wrote:
> Step 2 is a manual process dependent on upgrading iReport, and is a scenario
> I want to avoid.

Modify catalina.properties to restore the shared loader and put the
JasperReport JARs in there.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat, JasperServer, and JAR files

Posted by Thangalin <th...@gmail.com>.
Hi,

> In the first case, multiple applications using JasperReports
> > will result in a gross waste of resources
>
> I would categorize it as a trivial waste of resources.  Have you checked
> the price of disk and RAM lately?
>

Sure. The machine has 8 GB of RAM. 7 GB used by the (100 GB) PostgreSQL; X,
Linux, and Tomcat take up the rest. Are you offering to buy me more RAM? Not
everybody in the world has $120 to throw at more RAM, plus other hardware
upgrades that can ripple down. What is trivial to some might not be a
trivial expense to others.

JasperReports can easily allocate 200 MB per instance (to generate PDFs).
That's 200 MB sitting around in RAM that I would rather not needlessly throw
away per application, when all the applications *must* use the same version
of JasperReports.


> > still does not resolve the problem of having to bundle
> That's not a problem, that's an advantage.
>

And a disadvantage for us non-Rockefeller types. ;-) (You need not mention
developer time vs. hardware expense; it isn't applicable here: there are
times when funding is not available.)


> Which would be unacceptable in any kind of production environment I'm
> familiar with.  I want


I mentioned that this was for a *development environment*.

Basically, I want to have a single copy of iReport that, when upgraded,
upgrades the applications running under Tomcat as well. I have a solution in
place (make a version of setenv.bat that creates the lazy and crutch-like
CLASSPATH environment variable and then passes the variable along), but I
was told that there are other possibilities. I have not yet read any *
practical* solution that require less effort from a maintenance perspective.
That is, the simplest process is:

   1. Upgrade iReport.
   2. Restart Tomcat.

An alternative is (without duplicating, bundling, and deploying gargantuan
WAR files):

   1. Upgrade iReport.
   2. Upgrade the files in Tomcat's common directory.
   3. Restart Tomcat.

Step 2 is a manual process dependent on upgrading iReport, and is a scenario
I want to avoid.

Dave

RE: Tomcat, JasperServer, and JAR files

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Thangalin [mailto:thangalin@gmail.com] 
> Subject: Tomcat, JasperServer, and JAR files

> 1. *Bundle JARs with Servlet.*

This is the proper approach.

> 2. *Common libraries.*

A Really Bad Idea.

> In the first case, multiple applications using JasperReports 
> will result in a gross waste of resources

I would categorize it as a trivial waste of resources.  Have you checked the price of disk and RAM lately?

> Although this allows for different applications
> to use different versions of JasperReports

Probably more common than you think, since developers do not update all applications at the same time, nor do webapps go through test/staging/QA/deployment concurrently.  Deploying separate copies of the library JARs with each webapp insures that the webapps stay independent of each other, avoiding any chance of unwarranted and unexpected interaction with each other - especially important in any kind of secure environment.

> It is possible to write and maintain multiple build 
> scripts that use a single location of JasperReports
> as the source of JAR files. This is a hassle 

Why?  You write the script once and you're done.  I see no hassle here.

> still does not resolve the problem of having to bundle
> JasperReports multiple times.

That's not a problem, that's an advantage.

> I'd prefer a way to only use a single copy: the one with 
> iReport. That way, when iReport is upgraded, Tomcat need 
> only be restarted.

Which would be unacceptable in any kind of production environment I'm familiar with.  I want to be able to restart individual webapps, not forced to do so with the whole server.

>From the previous incarnation of this thread on the dev list:

> Then why call the scripts "setclasspath" when you don't 
> actually set the classpath? ;-)

You're confusing the term classpath - an attribute of every classloader - with the environment variable CLASSPATH - a crutch for the lazy and trap for the unwary.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org