RE: Native library cannot be loaded twice
Hi Andrea, You must make sure your native library is loaded once, thus moving it to another place in the class loader hirerachy. One solution would be to move this class to common/lib. Which isn't re-loaded when reloading your classes. You can also search the tomcat emails for prvious questions regarding this problem. Regards, Tamir -Original Message- From: Andreas Hirner [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 9:38 AM To: Tomcat Users List Subject: Native library cannot be loaded twice Hello, I have a problem calling a native library within a servlet. The library is initialised like that: static { try { System.loadLibrary(mapscript); System.err.println(libmapscript.so loaded); } catch (UnsatisfiedLinkError e) { System.err.println(libmapscript.so not loaded: + e); } } Everything works fine. However, if I make changes to the servlet and reload it via the http://localhost:8080/manager/reload?path=/application call, and ececute the servlet doing http://localhost:8080/application/servlet/servletname I get the following error message listed below. I have to restart Tomcat in order to check any changes made to the servlet. Does anybody know how to solve this problem? Thank you in advance Andy Error Message exception javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli cationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi lterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa lve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa lve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2 344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja va:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcher Valve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja va:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:4 62) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv e.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor .java:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.jav a:1106) at java.lang.Thread.run(Thread.java:484) root cause java.lang.UnsatisfiedLinkError: get_FTString at edu.umn.gis.mapscript.mapscript.get_FTString(Native Method) at edu.umn.gis.mapscript.mapscript.(mapscript.java:767) at edu.umn.gis.mapscript.mapObj.(mapObj.java:227) at demo.doGet(demo.java:75) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli cationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi lterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa lve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa lve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline. java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java :472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943
RE: Can servlet write to file in /WEB-INF?
Hi, Making URLConnection to a directory under WEB-INF, is the same like writing this url in the explorer. However, You can't go directly to any directory under WEB-INF in that way, which justifies your failure of writing to this directory. You can write to files in this directory, if you don't use URLConnection. That's what I think Tamir -Original Message- From: john-paul delaney [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 22, 2002 10:48 AM To: TC user list Subject: Can servlet write to file in /WEB-INF? I was trying to see if I could write to a file in the /WEB-INF directory but I couldn't get it to work - is there a problem with a servlet writing to this directory or is it just me (again ;( ) ? thanks /j-p. URL url = context.getResource(/contextTest.txt); URLConnection con = url.openConnection(); con.setDoOutput(true); OutputStream out = con.getOutputStream(); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out)); pw.println(foo); pw.close(); out.close(); --- JUSTATEST Art Online www.justatest.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SessionListener does not get enough information
Hi Hiran, I just bugged into this problem yesterday. I don't understand why the sessionlistener is designed this way... (Explanation please ?) A workaround I thought, was to use the attributelistener instead. When one attribute I choose is removed, I understand the next step is the session to be removed. So, I use this attribute value for my work. Offcourse, it's not perfect and it might be pronable to mistakes, but this is the fastest way for me to solve the problem. Regards, Tamir -Original Message- From: Software AG [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 1:25 PM To: Tomcat Users List Subject: SessionListener does not get enough information Hi there. I have a web application that stores some information into a database. Now if the transaction is not complete (which means the user did not go through a page asking do you want to save [y/n]?) all stored data shall be dropped again. I detect this dropped transaction with a SessionListener, since after some time all inactive sessions are discarded. The problem is now that when the SessionListener.sessionDestroyed method is called, all attributed have already been removed from the session, so I do not really know what data needs to be deleted. In my eyes the real solution is to change the code in StandardSession.expire() to first fire the event and then clear the attributes. But I do not want to rely on anyone installing that web application to have a modified version of Tomcat. Does anyone know about an elegant workaround for this problem? Hiran -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ?? Class Loaders, Static Initializers, Open Files ??
Hi Tony, Here is my notion: What you're using is tomcat automatic class reloading. When you compile class MyServlet tomcat drop it's current class loader and creates a new one which loads all your classes again. I think, if you should try to remove you class XXX outside of web-inf/classes and put it tomcat_home/common/lib in a jar. Then, tomcat won't reload your XXX class, and your static file will be ok. try it. Tamir -Original Message- From: Tony LaPaso [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 8:25 AM To: [EMAIL PROTECTED] Subject: ?? Class Loaders, Static Initializers, Open Files ?? Hi all, This is a core Java language issue but its roots are in servlets. I have a servlet (running on Tomcat v4.0.3), MyServlet, which calls Class.forName(XXX) in it's init() method. Now class XXX has a static initializer that opens a file for output and keeps it open. Later, I change the code in MyServlet and recompile it. The Tomcat notices the change and automatically loads the new version of MyServlet, using a different class loader than was used for the previous version. But when the new version of MyServlet calls Class.forName(XXX), the static initializer in XXX cannot open the file because the previous version has it open. So even though the first class loader is being dropped/abandoned, there is still a class loaded by that class loader (class XXX) that has a file open. And of course, I do not have the code for XXX. Is there any way to specify, either to the JVM or to Tomcat, that the file opened by XXX's static initializer should be closed? I'm guessing this is just the way it works. The previous class loader will be GCed, as will the previous version of MyServlet, but the file opened by XXX stays open until the VM goes down... Thanks... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Classloader question
Hi, I had many problems with classloaders using tomcat 3.3.1. I think you shouldn't be suprised by the LinkageError, cause you actually load this class twice, once by the context class loader and second by the apps class loader. What I don't remember is the hirarcy between these two class loaders (maybe you can check in the archives, and understand better what's happening). What I don't understand is why using two different versions of the same class. Isn't it some kind of troublemaker? Tamir -Original Message- From: Mario Felarca [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 7:06 AM To: [EMAIL PROTECTED] Subject: Classloader question Hello, I have a situation with Tomcat 3.3a where I am trying to allow a specific servlet context to load a version of a class from within their WEB-INF/classes directory, while other contexts on the server use a different version of that class that is loaded by the apps classloader. I can currently get the context classloader to actually load the correct class, however later on during init, I am getting a java.lang.LinkageError saying that the specific class that is being loaded twice is violating the loader constraints. Can anyone point me to any resources that would help me solve this problem? Any similar experiences or ideas would be greatly appreciated. Thanks in advance, Mario- __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Classloader question
Hi Larry, As I understand the additionalJars attribute, it can actually state jars outside the WEB-INF/lib or WEB-INF/classes that will be reloaded by tomcat when one of the jars in changed. Is it also relevant for Catalina ? (Is there a way to state jars to be reloaded there too ?) Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 2:18 PM To: 'Tomcat Users List' Subject: RE: Classloader question The classloader diagram is found at: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html#configuring_ classes Because Tomcat 3.3.x uses the JDK delagation model for classloading, classes in the apps classloader take priority over WEB-INF/classes and WEB-INF/lib. I don't think your approach will work because of this. However, there is an alternate trick that might work if you want to give it a try. Instead of placing the shared classes in the apps class loader, place them somewhere else and include them in the webapp class loader using the additionalJars attribute of the LoaderInterceptor11. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.html#LoaderInterc eptor11 I believe the additionalJars attribute will take directories as well as jars. I also believe the additionalJars will be searched after WEB-INF/classes, so a different version of a class in WEB-INF/classes will take priority over classes added by additionalJars. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 4:06 AM To: 'Tomcat Users List' Subject: RE: Classloader question Hi, I had many problems with classloaders using tomcat 3.3.1. I think you shouldn't be suprised by the LinkageError, cause you actually load this class twice, once by the context class loader and second by the apps class loader. What I don't remember is the hirarcy between these two class loaders (maybe you can check in the archives, and understand better what's happening). What I don't understand is why using two different versions of the same class. Isn't it some kind of troublemaker? Tamir -Original Message- From: Mario Felarca [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 7:06 AM To: [EMAIL PROTECTED] Subject: Classloader question Hello, I have a situation with Tomcat 3.3a where I am trying to allow a specific servlet context to load a version of a class from within their WEB-INF/classes directory, while other contexts on the server use a different version of that class that is loaded by the apps classloader. I can currently get the context classloader to actually load the correct class, however later on during init, I am getting a java.lang.LinkageError saying that the specific class that is being loaded twice is violating the loader constraints. Can anyone point me to any resources that would help me solve this problem? Any similar experiences or ideas would be greatly appreciated. Thanks in advance, Mario- __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ?? Class Loaders, Static Initializers, Open Files ??
Hi Charlie, That's a good idea. When I wrote my answer, what I had in mind is loading of jni using System.LoadLibrary, which can't be unloaded (Afaik ???) Tnx. -Original Message- From: Cox, Charlie [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 3:05 PM To: 'Tomcat Users List' Subject: RE: ?? Class Loaders, Static Initializers, Open Files ?? you can move it to \common\lib which is loaded by a different class loader, but then it will be visible to all contexts. Using a static initializer like that will also cause problems if you try to use the manager to control your app since manager drops the classloader and creates a new one when you reload. maybe instead of a static initializer, you can use a servlet's init() and have it load on startup. This way you can use a class and utilize the destroy() method to do your cleanup. Charlie -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 3:36 AM To: 'Tomcat Users List' Subject: RE: ?? Class Loaders, Static Initializers, Open Files ?? Hi Tony, Here is my notion: What you're using is tomcat automatic class reloading. When you compile class MyServlet tomcat drop it's current class loader and creates a new one which loads all your classes again. I think, if you should try to remove you class XXX outside of web-inf/classes and put it tomcat_home/common/lib in a jar. Then, tomcat won't reload your XXX class, and your static file will be ok. try it. Tamir -Original Message- From: Tony LaPaso [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 8:25 AM To: [EMAIL PROTECTED] Subject: ?? Class Loaders, Static Initializers, Open Files ?? Hi all, This is a core Java language issue but its roots are in servlets. I have a servlet (running on Tomcat v4.0.3), MyServlet, which calls Class.forName(XXX) in it's init() method. Now class XXX has a static initializer that opens a file for output and keeps it open. Later, I change the code in MyServlet and recompile it. The Tomcat notices the change and automatically loads the new version of MyServlet, using a different class loader than was used for the previous version. But when the new version of MyServlet calls Class.forName(XXX), the static initializer in XXX cannot open the file because the previous version has it open. So even though the first class loader is being dropped/abandoned, there is still a class loaded by that class loader (class XXX) that has a file open. And of course, I do not have the code for XXX. Is there any way to specify, either to the JVM or to Tomcat, that the file opened by XXX's static initializer should be closed? I'm guessing this is just the way it works. The previous class loader will be GCed, as will the previous version of MyServlet, but the file opened by XXX stays open until the VM goes down... Thanks... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Classloader question
Hi Larry, Tnx for your information, I'm afraid I can't use this feature as It's not compatible with other version of tomcat... Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 3:10 PM To: 'Tomcat Users List' Subject: RE: Classloader question I haven't actually tested the additionalJars feature with respect to reloading. It was orignally added with non-changing jars in mind, jasper.jar specifically. You may have to also specify use11Loader=true for jar reloading to work. I'm not aware of an equivalent feature in Tomcat 4.x. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 9:18 AM To: 'Tomcat Users List' Subject: RE: Classloader question Hi Larry, As I understand the additionalJars attribute, it can actually state jars outside the WEB-INF/lib or WEB-INF/classes that will be reloaded by tomcat when one of the jars in changed. Is it also relevant for Catalina ? (Is there a way to state jars to be reloaded there too ?) Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 2:18 PM To: 'Tomcat Users List' Subject: RE: Classloader question The classloader diagram is found at: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.htm l#configuring_ classes Because Tomcat 3.3.x uses the JDK delagation model for classloading, classes in the apps classloader take priority over WEB-INF/classes and WEB-INF/lib. I don't think your approach will work because of this. However, there is an alternate trick that might work if you want to give it a try. Instead of placing the shared classes in the apps class loader, place them somewhere else and include them in the webapp class loader using the additionalJars attribute of the LoaderInterceptor11. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.htm l#LoaderInterc eptor11 I believe the additionalJars attribute will take directories as well as jars. I also believe the additionalJars will be searched after WEB-INF/classes, so a different version of a class in WEB-INF/classes will take priority over classes added by additionalJars. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 4:06 AM To: 'Tomcat Users List' Subject: RE: Classloader question Hi, I had many problems with classloaders using tomcat 3.3.1. I think you shouldn't be suprised by the LinkageError, cause you actually load this class twice, once by the context class loader and second by the apps class loader. What I don't remember is the hirarcy between these two class loaders (maybe you can check in the archives, and understand better what's happening). What I don't understand is why using two different versions of the same class. Isn't it some kind of troublemaker? Tamir -Original Message- From: Mario Felarca [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 7:06 AM To: [EMAIL PROTECTED] Subject: Classloader question Hello, I have a situation with Tomcat 3.3a where I am trying to allow a specific servlet context to load a version of a class from within their WEB-INF/classes directory, while other contexts on the server use a different version of that class that is loaded by the apps classloader. I can currently get the context classloader to actually load the correct class, however later on during init, I am getting a java.lang.LinkageError saying that the specific class that is being loaded twice is violating the loader constraints. Can anyone point me to any resources that would help me solve this problem? Any similar experiences or ideas would be greatly appreciated. Thanks in advance, Mario- __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Updating files without restarting Tomcat
Hi, In order for tomcat to reload your files, you have to add reloadable=true to your application context in server.xml. However, this will cause tomcat to restart each time one of yout classes has been changed or one of the jars in WEB-INF/lib. Not only, it'll effect performance, but creating a new class loader isn't so obvious, and might cause problems (If you use jni, for example). good luck, Tamir -Original Message- From: cbarnes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 12:16 PM To: Tomcat Users List Subject: Updating files without restarting Tomcat I am using Tomcat 4. I have a .properties file in my WEB-INF/classes part of my work tree, which is read in using a ResourceBundle. My problem is that if I update this properties file it does not recognise the new version until I have restarted Tomcat. Is there a config value I can change so that I don't have to restart Tomcat each time I change the properties file? If there is can it apply to only certain files or sections of the application? I don't want Tomcat to check if .class files have changed everytime it uses them as this isn't necessary and will obviously effect performance. Thanks, Catharine -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: applet to servlet problem - JVM problem ?
Hi, I've checked again my applet and ensured that I'm calling openConnection each time. However, I've discovered that when I'm running this applet using java-plugin it works well(all the servelt requests are called simoulatnously). Nevertheless, I still would like it to work without the plug-in. Does anybody have something close that works without the plugin ? I'd really appreciate your help. Tnx, Tamir -Original Message- From: Toru Watanabe [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 3:22 AM To: Tomcat Users List Subject: Re: applet to servlet problem tamir java.io.InputStreamReader is = new tamir java.io.InputStreamReader(con.getInputStream()); ^^^ Do each thread uses their own con? each thread must create URLConection newly inside run() if each thread need to connect to server in the same time. regards, Watanabe. In the message applet to servlet problem D054B0637615D611967000D0B78059CB0254F4@IBM3000 tamir [EMAIL PROTECTED] wrote: tamir Hello everybody, tamir I'm quite sure it's not tomcat problem, however, I give it a shot, mainly tamir because I know all the people here tamir usually have great ideas... tamir I'm using tomcat 3.3.1b. tamir I've an applet that runs several threads. Each thread calls to the server tamir using URLConnection. tamir Everything works fine, however, only 2-3 threads can simoulantously achieve tamir the tamir server, and the rest are waiting. When one thread finishes, the other one tamir can connect the server. tamir The stuck command is: tamir java.io.InputStreamReader is = new tamir java.io.InputStreamReader(con.getInputStream()); tamir I'm using the Applet tag to run my applet. tamir Do you have any clues for me ? tamir Best regards, tamir Tamir tamir -- tamir To unsubscribe: mailto:[EMAIL PROTECTED] tamir For additional commands: mailto:[EMAIL PROTECTED] tamir Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
applet to servlet problem
Hello everybody, I'm quite sure it's not tomcat problem, however, I give it a shot, mainly because I know all the people here usually have great ideas... I'm using tomcat 3.3.1b. I've an applet that runs several threads. Each thread calls to the server using URLConnection. Everything works fine, however, only 2-3 threads can simoulantously achieve the server, and the rest are waiting. When one thread finishes, the other one can connect the server. The stuck command is: java.io.InputStreamReader is = new java.io.InputStreamReader(con.getInputStream()); I'm using the Applet tag to run my applet. Do you have any clues for me ? Best regards, Tamir -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
tomcat reloading log4j
Hi everybody, I tried my luck at log4j group by no help there. Well, now I'm going upstage to tomcat I'm facing a strange problem when using log4j under tomcat 3.3.1 on Solaris. Log4j works with no problem for me. However, when I use the auto-reload option of tomcat to perfrom reload to my classes (when some class is compiled), I receive the following errors: log4j:WARN Failed to set property conversionPattern to value %5p [%t] %c - %m%n . java.lang.ClassCastException@c4e792 log4j:WARN Failed to set property threshold to value WARN. Conversion to type [class org.apache.log4j.Priority] failed. log4j:WARN Failed to set property conversionPattern to value %d %p [%x %t] - %m %n. java.lang.ClassCastException@3f4a21 log4j:WARN Failed to set property file to value /export/home/movious/mss/mss-se rver/WEB-INF/logs/mss-server.log. java.lang.ClassCastException@1bda67 log4j:WARN File option not set for appender [LOG]. log4j:WARN Are you using FileAppender instead of ConsoleAppender? log4j:ERROR Either Filename or DatePattern options are not set for [LOG]. log4j:WARN Failed to set property threshold to value ERROR. Conversion to type [class org.apache.log4j.Priority] failed. the log4j.jar sits in WEB-INF/lib. Please help me with any piece of information. Tnx Tamir my log4j.properties file is: # #Mon Sep 24 15:29:29 IST 2001 log4j.rootCategory=DEBUG log4j.categoryFactory=com.movious.log.DBCategoryFactory # categories log4j.category.com.movious=DEBUG, A1 , LOG log4j.appender.A1.layout.ConversionPattern=%5p [%t] %c - %m%n log4j.appender.A1.Threshold=WARN log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout ### db appender ### # min priority error for db appender log4j.appender.DB.Threshold=ERROR log4j.category.DB.com.movious=ERROR,DB log4j.category.DB.com.movious.pluginsoap=INFO,DB # class name for db appender log4j.appender.DB=com.movious.log.DatabaseLog log4j.appender.LOG.File=c:/movious/mss/mss-server/WEB-INF/logs/mss-server.lo g log4j.appender.LOG=org.apache.log4j.DailyRollingFileAppender log4j.appender.LOG.layout=org.apache.log4j.PatternLayout log4j.appender.LOG.layout.ConversionPattern=%d %p [%x %t] - %m%n log4.appender.LOG.DatePattern='.'-MM-dd-a log4j.appender.Portlet.Threshold = DEBUG,false -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: reloading classes - rephrase
Hi again, I still have some questions about the reloading classes mechanizem... I checked tomcat 3.3.1-b1, for a few days, and I still couldn't make my mind clear about when classes are refreshed and when not. When I compiled classes to web-inf/classes, they were refreshed all the time!!!. GOOD! However, when I override an existing jar file at web-inf/lib, tomcat wasn't always refreshed. I couldn't decide when it was refreshed and when not. I'd really apperciate your comments for this subject or correct me if i'm wrong. Tnx in advance, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:54 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase There were some reloading problems encountered with URLClassLoader in Tomcat 3.3. A new attribute, use11Loader, was added to LoaderInterceptor .../ as a workaround. If you can, give Tomcat 3.3.1 Beta 1 a try with use11Loader=true and see if you still have the problem. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.html#LoaderInterc eptor11 for details. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 2:10 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hello again, Thank you very much for your quick response. I read your answer and tried to refresh classes in the web-inf/lib. Nevertheless, when I override an already existing myxxx.jar file (in web-inf/lib) with a newer version tomcat 3.3 gets crazy. Our application is loading a class from myxxx.jar using Class.forName and activates some methods in it. Everything is going well until we override myxxx.jar with a newer jar (class interface hasn't been changed). Tomcat is refreshed well (although, losing session), however, when accessing again the class in the jar, I get the following exception: 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( /movious + /portlet + null ) - java.lang.ClassFormatError: com/movious/NivPortlet (Truncated class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:495) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U nknown Source) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un known Source) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown Sourc e) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Unknown S ource) at java.lang.ClassLoader.loadClass(ClassLoader.java:260) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at com.movious.api.portlets.PortletManager.getClass(PortletManager.java: 578) at com.movious.api.portlets.PortletManager.createClip(PortletManager.jav a:532) at com.movious.api.portlets.PortletManager.getData(PortletManager.java:2 88) at com.movious.api.portlets.PortletServlet.doPost(PortletServlet.java:11 9) at com.movious.api.portlets.PortletServlet.doGet(PortletServlet.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source) at org.apache.tomcat.core.Handler.invoke(Unknown Source) at org.apache.tomcat.core.Handler.service(Unknown Source) at org.apache.tomcat.facade.ServletHandler.service(Unknown Source) at org.apache.tomcat.core.ContextManager.internalService(Unknown Source) at org.apache.tomcat.core.ContextManager.service(Unknown Source) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection( Unknown Source) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source) at java.lang.Thread.run(Thread.java:579) Am i doing something wrong Dear Guru ??? Tnx -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 6:22 PM To: Tomcat Users List Subject: Re: reloading classes - rephrase On Thu, 14 Feb 2002, tamir wrote: Date: Thu, 14 Feb 2002 10:54:15 +0200 From: tamir [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: reloading classes - rephrase Hi there, I've a simple question, hope there's a simple answer. Is it possible to do autoreload for classes not found in WEB-INF/classes or WEB-INF/lib without restarting tomcat or reloading my web-app classes ? (I
RE: reloading classes - rephrase
Hey there, Tnx, for the quick answer. I meant to the first option of replacing a jar. However, it probably made a problem because the class also existed in web-inf/classes (and i moved it to the jar...), which made tomcat confused. I checked it again, and it worked. TNX!!! The only thing that still bothers me, is what will happen, if I'm adding a new jar to web-inf/lib ? Will tomcat be able to recognize it ? Thank you, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 8:04 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Does override an existing jar refer to replacing a jar with a newer version of the jar or adding a class in WEB-INF/classes to override the class in a jar? The first should work. Adding a new class won't work because the DependClassLoader only checks for out of date against the file, jar or class, that the class was loaded from. Thus, if the class was loaded from a jar, only the jar would be checked to see if a newer version of the jar was available. If the class is loaded from a jar, it isn't smart enough to go looking for class files that may or may not exist. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 12:41 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hi again, I still have some questions about the reloading classes mechanizem... I checked tomcat 3.3.1-b1, for a few days, and I still couldn't make my mind clear about when classes are refreshed and when not. When I compiled classes to web-inf/classes, they were refreshed all the time!!!. GOOD! However, when I override an existing jar file at web-inf/lib, tomcat wasn't always refreshed. I couldn't decide when it was refreshed and when not. I'd really apperciate your comments for this subject or correct me if i'm wrong. Tnx in advance, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:54 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase There were some reloading problems encountered with URLClassLoader in Tomcat 3.3. A new attribute, use11Loader, was added to LoaderInterceptor .../ as a workaround. If you can, give Tomcat 3.3.1 Beta 1 a try with use11Loader=true and see if you still have the problem. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.htm l#LoaderInterc eptor11 for details. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 2:10 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hello again, Thank you very much for your quick response. I read your answer and tried to refresh classes in the web-inf/lib. Nevertheless, when I override an already existing myxxx.jar file (in web-inf/lib) with a newer version tomcat 3.3 gets crazy. Our application is loading a class from myxxx.jar using Class.forName and activates some methods in it. Everything is going well until we override myxxx.jar with a newer jar (class interface hasn't been changed). Tomcat is refreshed well (although, losing session), however, when accessing again the class in the jar, I get the following exception: 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( /movious + /portlet + null ) - java.lang.ClassFormatError: com/movious/NivPortlet (Truncated class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:495) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U nknown Source) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un known Source) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown Sourc e) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Unknown S ource) at java.lang.ClassLoader.loadClass(ClassLoader.java:260) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at com.movious.api.portlets.PortletManager.getClass(PortletManager.java: 578) at com.movious.api.portlets.PortletManager.createClip(PortletManager.jav a:532) at com.movious.api.portlets.PortletManager.getData(PortletManager.java:2 88) at com.movious.api.portlets.PortletServlet.doPost(PortletServlet.java:11 9) at com.movious.api.portlets.PortletServlet.doGet(PortletServlet.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java
RE: reloading classes - rephrase
Hi, Tnx for your information. It was VERY useful. touching the web.xml sounds like a tricky thing, but that's the reason we're programmers, isn't it ? Tnx again Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 9:54 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase It would pick up the new jar if the web application is reloaded, though simply adding the new jar won't trigger the reload. However, touching the web.xml file should do the trick. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 2:59 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hey there, Tnx, for the quick answer. I meant to the first option of replacing a jar. However, it probably made a problem because the class also existed in web-inf/classes (and i moved it to the jar...), which made tomcat confused. I checked it again, and it worked. TNX!!! The only thing that still bothers me, is what will happen, if I'm adding a new jar to web-inf/lib ? Will tomcat be able to recognize it ? Thank you, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 8:04 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Does override an existing jar refer to replacing a jar with a newer version of the jar or adding a class in WEB-INF/classes to override the class in a jar? The first should work. Adding a new class won't work because the DependClassLoader only checks for out of date against the file, jar or class, that the class was loaded from. Thus, if the class was loaded from a jar, only the jar would be checked to see if a newer version of the jar was available. If the class is loaded from a jar, it isn't smart enough to go looking for class files that may or may not exist. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 12:41 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hi again, I still have some questions about the reloading classes mechanizem... I checked tomcat 3.3.1-b1, for a few days, and I still couldn't make my mind clear about when classes are refreshed and when not. When I compiled classes to web-inf/classes, they were refreshed all the time!!!. GOOD! However, when I override an existing jar file at web-inf/lib, tomcat wasn't always refreshed. I couldn't decide when it was refreshed and when not. I'd really apperciate your comments for this subject or correct me if i'm wrong. Tnx in advance, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:54 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase There were some reloading problems encountered with URLClassLoader in Tomcat 3.3. A new attribute, use11Loader, was added to LoaderInterceptor .../ as a workaround. If you can, give Tomcat 3.3.1 Beta 1 a try with use11Loader=true and see if you still have the problem. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.htm l#LoaderInterc eptor11 for details. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 2:10 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hello again, Thank you very much for your quick response. I read your answer and tried to refresh classes in the web-inf/lib. Nevertheless, when I override an already existing myxxx.jar file (in web-inf/lib) with a newer version tomcat 3.3 gets crazy. Our application is loading a class from myxxx.jar using Class.forName and activates some methods in it. Everything is going well until we override myxxx.jar with a newer jar (class interface hasn't been changed). Tomcat is refreshed well (although, losing session), however, when accessing again the class in the jar, I get the following exception: 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( /movious + /portlet + null ) - java.lang.ClassFormatError: com/movious/NivPortlet (Truncated class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:495) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U nknown Source) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un known Source) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown Sourc e
RE: reloading classes - rephrase
Hey, I was so enthusiastic to check tomcat 3.3.1 b1 and it really solved the problem!!! It's like this fix especially made for us :)-. Thank you !!! However, I've still one open question concerned the reloading: After the jar file is reloaded successfully, the previous session is lost. That's strange, cause I only save there String variables. Does it have any solution ? Tnx, Tamir -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:54 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase There were some reloading problems encountered with URLClassLoader in Tomcat 3.3. A new attribute, use11Loader, was added to LoaderInterceptor .../ as a workaround. If you can, give Tomcat 3.3.1 Beta 1 a try with use11Loader=true and see if you still have the problem. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.html#LoaderInterc eptor11 for details. Cheers, Larry -Original Message- From: tamir [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 2:10 PM To: 'Tomcat Users List' Subject: RE: reloading classes - rephrase Hello again, Thank you very much for your quick response. I read your answer and tried to refresh classes in the web-inf/lib. Nevertheless, when I override an already existing myxxx.jar file (in web-inf/lib) with a newer version tomcat 3.3 gets crazy. Our application is loading a class from myxxx.jar using Class.forName and activates some methods in it. Everything is going well until we override myxxx.jar with a newer jar (class interface hasn't been changed). Tomcat is refreshed well (although, losing session), however, when accessing again the class in the jar, I get the following exception: 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( /movious + /portlet + null ) - java.lang.ClassFormatError: com/movious/NivPortlet (Truncated class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:495) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U nknown Source) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un known Source) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown Sourc e) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Unknown S ource) at java.lang.ClassLoader.loadClass(ClassLoader.java:260) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at com.movious.api.portlets.PortletManager.getClass(PortletManager.java: 578) at com.movious.api.portlets.PortletManager.createClip(PortletManager.jav a:532) at com.movious.api.portlets.PortletManager.getData(PortletManager.java:2 88) at com.movious.api.portlets.PortletServlet.doPost(PortletServlet.java:11 9) at com.movious.api.portlets.PortletServlet.doGet(PortletServlet.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source) at org.apache.tomcat.core.Handler.invoke(Unknown Source) at org.apache.tomcat.core.Handler.service(Unknown Source) at org.apache.tomcat.facade.ServletHandler.service(Unknown Source) at org.apache.tomcat.core.ContextManager.internalService(Unknown Source) at org.apache.tomcat.core.ContextManager.service(Unknown Source) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection( Unknown Source) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source) at java.lang.Thread.run(Thread.java:579) Am i doing something wrong Dear Guru ??? Tnx -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 6:22 PM To: Tomcat Users List Subject: Re: reloading classes - rephrase On Thu, 14 Feb 2002, tamir wrote: Date: Thu, 14 Feb 2002 10:54:15 +0200 From: tamir [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: reloading classes - rephrase Hi there, I've a simple question, hope there's a simple answer. Is it possible to do autoreload for classes not found in WEB-INF/classes or WEB-INF/lib without restarting tomcat or reloading my web-app classes ? (I mean i put my classes OUTSIDE the web-app). I'm using tomcat 3.3, but can do the advance to 4.02 if needed. Tnx Alot for any information
RE: reloading classes - rephrase
Thanks for the information. right now, jar's reloading is quite good enough. bye Tamir -Original Message- From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 10:43 AM To: Tomcat Users List Subject: AW: reloading classes - rephrase There is not mutch you can do about that at the moment. Future versions of tomcat might be able to recreate the session after reload. But for now the session is lost, because not only your variables get lost but also all internal variables that describe the state of te session. -Urspr?ngliche Nachricht- Von: tamir [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 18. Februar 2002 09:45 An: 'Tomcat Users List' Betreff: RE: reloading classes - rephrase snip/ However, I've still one open question concerned the reloading: After the jar file is reloaded successfully, the previous session is lost. That's strange, cause I only save there String variables. Does it have any solution ? snip/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
reloading classes - rephrase
Hi there, I've a simple question, hope there's a simple answer. Is it possible to do autoreload for classes not found in WEB-INF/classes or WEB-INF/lib without restarting tomcat or reloading my web-app classes ? (I mean i put my classes OUTSIDE the web-app). I'm using tomcat 3.3, but can do the advance to 4.02 if needed. Tnx Alot for any information! -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: reloading classes - rephrase
Hello again, Thank you very much for your quick response. I read your answer and tried to refresh classes in the web-inf/lib. Nevertheless, when I override an already existing myxxx.jar file (in web-inf/lib) with a newer version tomcat 3.3 gets crazy. Our application is loading a class from myxxx.jar using Class.forName and activates some methods in it. Everything is going well until we override myxxx.jar with a newer jar (class interface hasn't been changed). Tomcat is refreshed well (although, losing session), however, when accessing again the class in the jar, I get the following exception: 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( /movious + /portlet + null ) - java.lang.ClassFormatError: com/movious/NivPortlet (Truncated class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:495) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U nknown Source) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un known Source) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown Sourc e) at java.security.AccessController.doPrivileged(Native Method) at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Unknown S ource) at java.lang.ClassLoader.loadClass(ClassLoader.java:260) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at com.movious.api.portlets.PortletManager.getClass(PortletManager.java: 578) at com.movious.api.portlets.PortletManager.createClip(PortletManager.jav a:532) at com.movious.api.portlets.PortletManager.getData(PortletManager.java:2 88) at com.movious.api.portlets.PortletServlet.doPost(PortletServlet.java:11 9) at com.movious.api.portlets.PortletServlet.doGet(PortletServlet.java:37) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source) at org.apache.tomcat.core.Handler.invoke(Unknown Source) at org.apache.tomcat.core.Handler.service(Unknown Source) at org.apache.tomcat.facade.ServletHandler.service(Unknown Source) at org.apache.tomcat.core.ContextManager.internalService(Unknown Source) at org.apache.tomcat.core.ContextManager.service(Unknown Source) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection( Unknown Source) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source) at java.lang.Thread.run(Thread.java:579) Am i doing something wrong Dear Guru ??? Tnx -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 6:22 PM To: Tomcat Users List Subject: Re: reloading classes - rephrase On Thu, 14 Feb 2002, tamir wrote: Date: Thu, 14 Feb 2002 10:54:15 +0200 From: tamir [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: reloading classes - rephrase Hi there, I've a simple question, hope there's a simple answer. Is it possible to do autoreload for classes not found in WEB-INF/classes or WEB-INF/lib without restarting tomcat or reloading my web-app classes ? (I mean i put my classes OUTSIDE the web-app). I'm using tomcat 3.3, but can do the advance to 4.02 if needed. Tnx Alot for any information! The answer is simple: no. Java provides no mechanism for unloading a class that has already been loaded. The way that reloading is implemented for a webapp is to throw away the entire class loader used to load that webapp, and starting over again. If we did that for shared classes, however, you'd have to restart *all* webapps because they would all need to be thrown away. If you want to take advantage of the auto-reload capability to update classes in a webapp, you *must* put those classes in /WEB-INF/classes, or in a JAR file in /WEB-INF/lib. Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
tomcat classloader problem - again
Hi guru's. My Team and I are currently struggling a classloader problem, It happens in tomcat version 3.3 and the new 4.02. And it goes like this: Inside our /WEB-INF/lib we have an xxx.jar that includes some classes , Now these classes are being load dynamically using classForName. And everything works Fine. Now we are updating this jar to new jar version (the classes interface have not change) And Tomcat goes mad. In catalina we get Root Cause: java.lang.NoClassDefFoundError: sun/reflect/MethodAccessorImpl Now my question is: Is it legal to do this ? If not what other option do I have to automatically reload classes inside jar files ? Really Really Thanks In Advance Niv Maman Vice President, RD Movious Tel: +972-9-8858555 (ext. 204) Fax: +972-9-8858556 Mobile: +972-54-830880 Email: [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
HELP: class reloading or hot deployment with tomcat / Catalina ?????
Hi there, I'd really apperciate if anybody can give me a hint or how to relate this issue to tomcat. I've been struggling with this problem for two days now. I wonder if any one have a solution. I'm using Tomcat 3.3, but would apperciate any solution with Tomcat 4.02 The problem: How to perfrom hot deployment for a jar file, which sits outside the web-inf/lib (or class outside web-inf/classes). I'd like this jar to be auto-reloaded, without my project to be reloaded. When I put this jar inside web-inf/lib it reloads the whole server and the session is lost. It causes many troubles, and also the files in the jar file can't be accessed from outside. I tried to create my own classload using URLClassLoader inherited from Thread.currentThread().getContextClassLoader(), so the new created class will know all the classes created by tomcat at web-inf/classes. Then I create the class and everything goes well. My problem is that the class isn't reloaded when I put the new jar in the directory. Here is my code: ClassLoader ccl = Thread.currentThread().getContextClassLoader(); URL [] jarFile = new URL[1]; jarFile[0] = new URL(new String(/movious/portlets/mss_+className+.jar)); System.out.println(before loader); loader = new URLClassLoader(jarFile,ccl); // System.out.println(after loader); Class c = loader.loadClass(className); Object o = c.getConstructors()[0].newInstance(new Object[] {aData}); System.out.println(after load class+o); //clip = (APortletItf) o; //clip.init(aPortletData); return (APortletItf)o; Each time I create a new class loader, however, the same class file is retieved. When I restart tomcat, It offcourse works ok. Tnx again for you help and support Tamir -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
problems with Catalina on solaris (unix)
Hi everybody, I'm using tomcat 4.0.1 on Windows NT without problems, and very satisifed from it. However, when I copied catalina to solaris on unix I faced some problems: First of all, I couldn't run any jsp's, because of this exception: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFact ory.java:116) at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImp l.java:278) I realized this problem origin was because Xerces.jar and Xalan.jar were in my WEB-INF/LIB. So, I moved the files to $TOMCAT_HOME/common/lib (and also tried $TOMCAT_HOME/lib). This solved the jasper exception, but I got a new exception, when my code tried to use this classes to parse xml documents: 2001-11-27 10:20:40 StandardContext[/movious]: Servlet /movious threw load() exception javax.servlet.ServletException: Servlet.init() for servlet portal threw exception at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3267) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.start(StandardHost.java:612) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:505) at org.apache.catalina.startup.Catalina.start(Catalina.java:776) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) - Root Cause - java.lang.LinkageError: Class org/w3c/dom/Document violates loader constraints at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo ader.java:1534) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav a:852) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1273) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1156) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at com.movious.utils.ExConfig.getParm(ExConfig.java:42) at com.movious.utils.SharedConnectionPool.getSharedPool(SharedConnectionPool.ja va:31) at com.movious.constants.DBConstants.init(DBConstants.java:38) at com.movious.portal.init(portal.java:105) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3267) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3384) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.start(StandardHost.java:612) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:505) at org.apache.catalina.startup.Catalina.start(Catalina.java:776) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) I also tried running my code on tomcat 3.2.3 on solaris and this problems didn't happen at all. Any advice would be appreciated, Tamir -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]