File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Stripes.jar in the Tomcat (common) lib dir Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Stripes.jar in the Tomcat (common) lib dir" Watch "Stripes.jar in the Tomcat (common) lib dir" New topic
Author

Stripes.jar in the Tomcat (common) lib dir

Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Is it possible to put the stripes.jar inside the Tomcat common lib directory?
I moved the stripes.jar and commons-logging.jar files in that dir and setup everything as I did for other libraries, like for example the JDBC Connector.
The application is not deployed in tomcat, it's compiled but not deployed.
I also tried moving the stripersist libraries but I'm still getting the same.
Is it mandatory to have stripes jar file inside the application lib dir?

Thanks,
Gabriele Fabbri


OverZero Software
[url]www.overzero.it[/url]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41104
    
  45
I suppose it's possible that Stripes assumes that the application code is loaded by the same classloader as Stripes itself (which it wouldn't if Stripes is in TOMCAT_HOME/common).

If a web app doesn't get deployed at startup then there are generally exceptions or error messages in the log files that provide a clue as to what's (not) going on.


Ping & DNS - my free Android networking tools app
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Yes, I solved the problem.
I forgot to move some other jar files that were apparently needed.

Thanks,
Gabriele Fabbri
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Gabriele Fabbri wrote:Yes, I solved the problem.
I forgot to move some other jar files that were apparently needed.

Thanks,
Gabriele Fabbri


What all did you have to move? I think Ulf is on the right track with regards to class loaders.


GenRocket - Experts at Building Test Data
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Finally I moved ALL the jar files from the application's lib directory to the Tomcat lib.
I was missing the cos.jar, but at the end I moved Hibernate libs and jstl jars as well.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41104
    
  45
Seriously, you shouldn't do that. What if some other web app needs to use a different version of any of these libraries? What was wrong with keeping the Stripes jar in WEB-INF/lib to begin with?
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Ulf Dittmer wrote:Seriously, you shouldn't do that. What if some other web app needs to use a different version of any of these libraries? What was wrong with keeping the Stripes jar in WEB-INF/lib to begin with?


Yes, in fact this is my doubt.
I mean, I'm planning to have several instances of the same application on the server, and I don't want to have 8Mb of libraries duplicated for each of them.
I thought that a possible solution was to move those libraries into the tomcat lib directory, but you are right: it can happen that in some month I will develop a new version of the app. using an updated version of Stripes or Hibernate (and it can be that it is not backward compatible...).
So, what I should do?

Thanks,
Gabriele
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41104
    
  45
8MB of disk space is not worth thinking about for even one minute (so unless you have 100000 instances...).

Memory consumption is something to think about, but Stripes is fairly small, and so probably not worthy of optimizations in this regard. That said, the cos.jar and commons-logging.jar libraries can probably go into the common directory without problems.
Gabriele Fabbri
Ranch Hand

Joined: Dec 05, 2008
Posts: 30
Ulf Dittmer wrote:8MB of disk space is not worth thinking about for even one minute (so unless you have 100000 instances...).

Memory consumption is something to think about, but Stripes is fairly small, and so probably not worthy of optimizations in this regard. That said, the cos.jar and commons-logging.jar libraries can probably go into the common directory without problems.


And what about Hibernate? It's quite huge (16 jars, more than 5Mb). I would like to have it shared, but if you suggest to keep it inside the application dir I trust you...

Thanks,
Gabriele Fabbri
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stripes.jar in the Tomcat (common) lib dir
 
Similar Threads
where to put my "mysql-5.0.3-bin.jar" file
Getting Connection Refused on HttpURLConnection
I think execute method is not executed...(confused)
Proper use of /shared/lib
Using a jar inside my application