• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stripes.jar in the Tomcat (common) lib dir

 
Gabriele Fabbri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gabriele Fabbri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gabriele Fabbri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic