RE: Non-servlet class cannot access jar file in ./WEB-INF/lib when a Servlet does
Jose, I have a similar servlet which initializes a singleton class to load the Tomcat resources for AXIS web service. The servlet is loaded at startup. This singleton class uses classes from a jar file located in WEB-INF/lib. MY servlet and singleton and other classes are in WEB-INF/classes. In production environment, servlet and all other classes are in jar under WEB-INF/lib and these classes use other classes in another jar in WEB-INF/lib. It works fine. Probably having two classes with same name is the problem, but how is that possible to have two classes with same name in the same package? If they are in two different packages, you need to refer that class with complete package structure, eg : package.className = new package.className(); -Sabitha Jose Maria Ramirez Martinez a écrit : Hi, everybody I have the next problem: A servlet calls a non-servlet class, and this non-servlet class imports classes from a jar file, but the classloader does not find the class from the jar file (so when I call the servlet from an internet browser, I get a NoClassDefFoundException) But if a servlet class imports the same classes from the jar, the class loader does find them... I've tried some ways to solve this problem, like: a) unpacking the classes from the jar (this works, but I had the problem that 2 different jars contained a file with the same name stored in the same directory, so one would replace the other, and the class fails) b) I thought it would be a security problem so I ran tomcat with a SecurityManager, but it didn't solve the problem.. does somebody has any idea why this is happening??? can somebody help me to solve this... thanks in advance Jose Maria ___ $0 Web Hosting with up to 200MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem with setting path for config files
You can declare a variable in Catalina.sh with your path and append it to the classpath. -Original Message- From: Raviteja Veerla [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 05, 2005 11:26 AM To: tomcat-user@jakarta.apache.org Subject: problem with setting path for config files Hi all, I am having a problem with setting the path for config files. I am building a webservices in java using a 3rd party java API. this third party API requires few config files(xml files) to be present in the class path, so that they can read from those config files. i am developing these on a windows 2000 machine but the server environment is linux. on windows machine, i added the path of these config files in the setclasspath.bat as shown below. set CLASSPATH=%JAVA_HOME%\lib\tools.jar;C:\ConfigFiles\conf this worked perfectly fine, but when i do the same in the setclasspath.shon the linux machine. it does not compile the jws files as it would not find tools.jar file, apparently its not seperating the paths after the semi colon. can anyone help me in this regard and suggest me on how to go about it. thanks Ravi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat on Unix - error message at shutdown
Hi, Every time I stop tomcat 5.0 on Unix , it gives the following error. I think this issue is already been discussed, but I could not find any link to the solution. I would appreciate if you could help me solving this issue. Sep 23, 2005 1:31:22 PM org.apache.jk.common.ChannelSocket acceptConnections WARNING: Exception executing accept java.net.SocketException: Invalid argument at java.net.PlainSocketImpl.socketSetOption(Native Method) at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:240) at java.net.Socket.setSoLinger(Socket.java:814) at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:300) at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638) at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:847) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:683) at java.lang.Thread.run(Thread.java:534) thanks sanugu