This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I`m develloping a servlets that uses the jini service. When i run the servlet (connecting from a remote browser to the Apache HTTP server where my servlet is running) the jini service doesn`t work. I suppose it happens because I`m not able to set classpath for servlets; In fact if I use the same jini service from command line (using java -cp .... filename.class ) it works well. How can I set classpath for servlets using Apache HTTp server?
Apache itself can not run servlets. You need an external servlet runner such as Tomcat, Resin, JRun etc. and configure a connector between Apache and the servlet runner. This is different for each servlet runner and connector, as is setting the classpath for it. Consult the documentation for your servlet runner to determine how to do these tasks.
I'm also a bit worried by the use of Jini in this question. Is the code in your jar file really a Jini "service", or some client code which looks up and uses a Jini service on a network. If your jar is the actual service, then I'm not sure calling it directly from a servlet makes much sense. If your jar is some Jini client code, you may have other network issues besides the classpath to worry about. Is the server machine normally part of the Jini network?
Hello, Everything in use by a servlet must either be in the WEB-INF\lib or WEB-INF\classes folder. These are the default classpath in case of any servlet container and we cant configure it to use classes outside these folders Rajesh Kumar (SCJP2 - 90%, SCWCD 93%, UML 79% , J2EE 89%)