• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rules for location of Java .class files

 
Robin Clark
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two different web applications that have different JSPs. However, they both use a common set of java classes that are in a package called vss.
I am having trouble trying to get the JSP to find the vss package unless it is installed under my web application in WEB-INF/classes.
I would like to install the package in a directory that is entirely separate from the Tomcat installation. I did this and then placed the full path name for the vss.jar in my classpath environment variable. I re-started Tomcat.
The application is a bit complicated because it is VXML instead of HTML, in other words it is a voice application, not a web browser application. In any case, suffice it to say that it didn't work with my new configuration. Can someone tell me if there are rules against executing Java classes that are not in the WEB-INF directory structure? Or did I just do something wrong? It is entirely possible because there are so many weird bits and pieces to this application.
For now, I am maintaining two copies of the source code and the compiled classes -- one under each web application's WEB-INF directory.
Thank you!
 
brad balmer
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could just maintain one location for the source and then instead of deploying the .class files in a directory, jar them up and place them in the WEB-INF/lib directory.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most servlet containers will take no heed of the system classpath. To share a library of classes across multiple web applications, each container will provide a common area. In Tomcat, for example, you would jar up your classes and place the jar file in $CATALINA_HOME/shared/lib.
 
Robin Clark
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I think that I will keep the source code under one app and place the vss.jar in my Tomcat common/lib directory.
I forgot that Tomcat ignores the system classpath. As usual I am trying to do too many things at one time so it is hard to see which one of them is causing me problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic