RE: Update of webapp: does not work with any JVM
I had this problem also. The only way I could get Tomcat 4 to update was to decompress the war into a directory in webapps. Then I use the manager to reload my application. It's all in an ant task, which makes it not very painful: Thanks a lot for the idea. I no longer use Tomcat 4 due to stability issues, I'm using jboss/tomcat3.2.3 bundle which handles hot deployment beautifully. The But supports old API only:( The question to tomcat team: is it registered bug/problem? What are perspectives? Does all this mean Tomcat 4.0.1 is not ready yet for servlet development environment (only for production:)? Cheers, Sergey -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.0.1 not updating the webapp
I think it's a JDK bug. Since the WAR will be opened through a JAR URL, it is cached by the JDK until the JVM is terminated. I tried everything (since it caused another problem), but there's no workaround unless you make the URLs strings different. Cool! OK, I'll try IBM's JDK. I'm not 100% sure, but I don't think that file based JAR URLs have that problem. I use the jar:file://... url. Do you say that I have to unpack my WAR before deploying? Regards, Sergey
RE: Tomcat 4.0.1 not updating the webapp
Are you creating the .WAR on one machine then copying it to a server on another machine? If so, then check that the clocks on the two machines are set to the same time. I've had problems where my compile-machine's clock was running a little slow, which made the .WAR file appear to be older than the already-unpacked directory. In this case, Tomcat figures you've modified the existing directory, so it doesn't unpack the new one. No. Everything is on the same system. The time machine is working properly. But tomcat still does not want to update the application:( Thanks for idea, Sergey
Tomcat 4.0.1 not updating the webapp
Hi all I took 4.0.1 and have the same problem with the updating of webapps. I install my webapp using the manager/install?... and remove using manager/remove?... Everything is fine. Then I install the new version from the same war file (definitely, new version of it), get OK, and in the browser I still see the same _old_ content. It's not browser's fault, I am sure (checked with lynx and telnet localhost 80). It seems that tomcat keeps in memory the old content of classes and jsps. Is there a way to overcome this? BTW, in the webapps directory the content is old too.:( Any help would be appreciated. Thanks is advance, Sergey
policy for classes in WEB-INF/lib/my.jar
Hi all There is my class (bean) in some jar file. I put this file into WEB-INF/lib directory - so my jsps are able to find it. But when I am trying to write to the file /tmp/my.log, I get the security AccessControlException. I added grant codeBase file:${catalina.home}/webapps/myapp/WEB-INF/lib/my.jar!/- { permission java.io.FilePermission /tmp/-, read, write; }; But this does not help. When I had a look at the class loader for this class, I found there are NO repositories associated(?!), so policy rule is not effective here. Are there any ideas how to fix/workaround this? I would not like to give permission java.io.FilePermission /tmp/-, read, write; to all servlets... I run tomcat 4.0 with -security option (since I need RMI). Regards, Sergey The classloader: WebappClassLoader available: delegate: false repositories: required: -- Parent Classloader: StandardClassLoader available: delegate: false repositories: file:/usr/local/tomcat4/lib/jasper-runtime.jar file:/usr/local/tomcat4/lib/naming-factory.jar required: -- Parent Classloader: StandardClassLoader available: Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2] delegate: false repositories: file:/usr/local/tomcat4/common/classes/ file:/usr/local/tomcat4/common/lib/activation.jar file:/usr/local/tomcat4/common/lib/crimson.jar file:/usr/local/tomcat4/common/lib/jaxp.jar file:/usr/local/tomcat4/common/lib/jdbc2_0-stdext.jar file:/usr/local/tomcat4/common/lib/jta-spec1_0_1.jar file:/usr/local/tomcat4/common/lib/ldap.jar file:/usr/local/tomcat4/common/lib/mail.jar file:/usr/local/tomcat4/common/lib/naming-common.jar file:/usr/local/tomcat4/common/lib/naming-resources.jar file:/usr/local/tomcat4/common/lib/servlet.jar file:/usr/local/tomcat4/common/lib/tyrex-0.9.7.0.jar file:/usr/local/tomcat4/common/lib/providerutil.jar required: -- Parent Classloader: sun.misc.Launcher$AppClassLoader@621e42 to
Re: 4.0 RPMs: when
Hi We still have problems with related jars, like jdbc2.0ext, jta, jmx, ldap which are copyrigthed by Sun and so couldn't be included in RPM I see. But if you cannot include these jars - you're always able to include them into dependancies... What's wrong with this solution? Regards, Sergey
4.0 RPMs: when
Hi all I heard a lot of good things about 4.0. But there are no RPMs released:( Can anyone comment the situation with them (or just give URL:)? Regards, Sergey
XML parser: old version
Hi all With Tomcat 3.2.2 RPMS, I got some XML parser. I suspect it is sun's JAXP implementation 1.0. It DOES NOT support namespaces (I found it from the error messages:) so it is not possible to use XSL in JSPs/Beans/servlets. Will it be any problem to use JAXP 1.1? Or Xerces? What is the current policy of using XML parsers in tomcat? Why tomcat does not use Xerces having the same Apache licence? Thanks for any comments Sergey
Re: [POLL] Tomcat 3.x RPMS : Which XML Parser to be put in ? : WAS : XML parser: old version
I launch that poll to see if which XML parser RPMS users want to see included by default. Probably no XML parser should be included. . Just document the fact that admin should synlink necessary jars to the tomcat lib directory. IMHO it is wrong idea to include parser with any java app which requires it. JAXP API makes this unnecessary (definitely unless Tomcat uses some special private API from crimson or xerces). Regards, Sergey
Re: [POLL] Tomcat 3.x RPMS : Which XML Parser to be put in ? : WAS : XML parser: old version
The XML parser should be included in the distro since new and average users MAY never use XML in their apps. OK. My vote is for xerces (it is good and has same licence). Also, it would be good to have the list of tomcat-compatible parsers. At the moment, I tried jaxp 1.1 and latest xerces - they work correct. What about people using IBM's one? MS's one? BTW, for new and average users it is possible to use RPM dependancies. For example, ask xerces (and sun's) people to put their classes to parser.jar and check for this jar in RPM. Another option, RPM pre-install script could try to find existing parser (and fail if there is no one). RPM is rather sophisticated mechanism to deal with this problem... Regards, Sergey
Re: [POLL] Tomcat 3.x RPMS : Which XML Parser to be put in ? : WAS : XML parser: old version
GOMEZ Henri wrote: IBM xml4j is at 99% xerces-j Did MS got a jav parser ? I do not know whether it is JAXP-compatible and native but some MS XML parser does exist... I started think at this that's why my latest xerces-j RPM have a : Provides jaxp 1.1 Great! This is a way! May be next release OK may be next time crimson. I could add such system at install time but what to do when a user got at the same time, crimson and xerces-j ??? Can two installed RPMs provide jaxp 1.1? Is this valid in RPM world? If yes, some post-install script should ask user to choose the parser somehow... Is this possible with RPM technology? Cheers, Sergey
Re: Security exceptions.
Hi It seems it is impossible to grant security permissions to the classes loaded by either org.apache.tomcat.loader.AdaptiveClassLoader or org.apache.jasper.servlet.JasperLoader. At least when I write in the policy file grant codeBase XXX { java.security.AllPermission; }; I get a lot of security exceptions (with either file:/- or http://*/-; codebase). The codebase seems to be null!!! If I write grant { java.security.AllPermission; }; everything is OK. Could anybody comment/fix/document this issue? Regards, Sergey
Security exceptions.
Hi all I am running tomcat 3.2.2 with Apache 1.3.19 using JDK 1.3.1 by Sun. The script /usr/bin/tomcat is called with -security parameter. The file /var/tomcat/conf/tomcat.policy contains, among others, the lines: grant codeBase file:/usr/local/idle/web/- { permission java.security.AllPermission; }; When I try to call some .jsp file which creates the bean from /usr/local/idle/web/WEB-INF/lib/idlebase.jar, I get the exception: Error: 500 Location: /idle/common/jsp/courseList.jsp Internal Servlet Error: javax.servlet.ServletException: access denied (java.io.FilePermission /usr/local/idle/web/WEB-INF/lib/idlebase.jar read) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java) at jsp._0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0._jspService(_0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0.java:180) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java) at org.apache.tomcat.core.Handler.service(Handler.java) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java) at org.apache.tomcat.core.ContextManager.service(ContextManager.java) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java) at java.lang.Thread.run(Thread.java:484) Root cause: java.security.AccessControlException: access denied (java.io.FilePermission /usr/local/idle/web/WEB-INF/lib/idlebase.jar read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272) at java.security.AccessController.checkPermission(AccessController.java:399) at java.lang.SecurityManager.checkPermission(SecurityManager.java:545) at java.lang.SecurityManager.checkRead(SecurityManager.java:890) at java.io.File.isDirectory(File.java:567) at org.apache.tomcat.loader.AdaptiveClassLoader.getResourceAsStream(AdaptiveClassLoader.java) at java.lang.Class.getResourceAsStream(Class.java:1220) at spbtu.util.LogUtil.(LogUtil.java:37) at spbtu.util.LogUtil.(LogUtil.java:23) at jsp._0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0._jspService(_0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java) at org.apache.tomcat.core.Handler.service(Handler.java) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java) at org.apache.tomcat.core.ContextManager.service(ContextManager.java) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java) at java.lang.Thread.run(Thread.java:484) The exception is caused by my class which is trying to read (getResourceAsStream) some resource file existing in the same .jar. Any ideas what's wrong here? Regards, Sergey
JSP, sessions: how to notify bean about the session end?
Hello all My JSPs uses some session-scoped bean. This bean, among other duties, is responsible for logging in and out of some app server. I would like the bean to perform autologout on the session end. Is it possible? How? AFAIK usual finalize can be called ages after the object is really free - so I do not like this way. Any ideas? Regards, Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RMI: part2
So, finally I decided to grant all permission (at least, till Tomcat will handle permissions properly or Sam will find out how to tune tomcat.policy:) Now, I tried to run my servlet (RMI client). I get the ClassCastException. My *_Stub is loaded by RMI properly with all its base classes and interfaces and - there are two interfaces: one loaded by sun.rmi.Loader and another - by AdaptiveClassLoader (by Tomcat). These two classes are absolutely independent, from the JVM's point of view and ... ClassCastException is raised. **stub class: class SPbTU.DLS.Server.Protocol.ClientProtocolImpl_Stub loaded by sun.rmi.server.LoaderHandler$Loader@341960 **remote interface from local classpath: interface SPbTU.DLS.Protocol.ClientProtocol loaded by AdaptiveClassLoader( ) **stub class implements remote interface: false **remote class with all its supers and interfaces class SPbTU.DLS.Server.Protocol.ClientProtocolImpl_Stub loaded by sun.rmi.server.LoaderHandler$Loader@341960 implements interface SPbTU.DLS.Protocol.ClientProtocol loaded by sun.rmi.server.LoaderHandler$Loader@341960 implements interface SPbTU.DLS.Protocol.Protocol loaded by sun.rmi.server.LoaderHandler$Loader@341960 implements interface java.rmi.Remote loaded by null extends class java.rmi.server.RemoteStub loaded by null extends class java.rmi.server.RemoteObject loaded by null implements interface java.rmi.Remote loaded by null implements interface java.io.Serializable loaded by null extends null! Any ideas? I suspect there is something wrong with AdaptiveClassLoader... Regards, Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: RMI
Hi I try to run Tomcat with SecurityManager and policy file. First, I found a bug in tomcat.sh - it passes "-security" option to the class (it's necessary to add one "shift" statement before calling java). Then I found that all session-based jsps give me errors like this (in tomcat console): java.security.AccessControlException: access denied (java.util.PropertyPermission tomcat.sessionid.randomclass read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272) at java.security.AccessController.checkPermission(AccessController.java:399) at java.lang.SecurityManager.checkPermission(SecurityManager.java:545) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278) at java.lang.System.getProperty(System.java:560) at org.apache.tomcat.util.SessionIdGenerator.getIdentifier(SessionIdGenerator.java:124) at org.apache.tomcat.util.SessionIdGenerator.generateId(SessionIdGenerator.java:177) at org.apache.tomcat.util.SessionUtil.generateSessionId(SessionUtil.java:180) at org.apache.tomcat.session.StandardManager.getNewSession(StandardManager.java:379) at org.apache.tomcat.session.StandardSessionInterceptor.newSessionRequest(StandardSessionInterceptor.java:177) at org.apache.tomcat.core.ContextManager.doNewSessionRequest(ContextManager.java:913) at org.apache.tomcat.core.RequestImpl.getSession(RequestImpl.java:478) at org.apache.tomcat.facade.HttpServletRequestFacade.getSession(HttpServletRequestFacade.java:381) at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:173) at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:149) at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:99) at jsp.sessions._0002fjsp_0002fsessions_0002fcarts_0002ejspcarts_jsp_0._jspService(_0002fjsp_0002fsessions_0002fcarts_0002ejspcarts_jsp_0.java:51) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) 2001-03-02 03:45:32 - Ctx( /examples ): Exception in: R( /examples + /jsp/sessions/carts.jsp + null) - java.lang.NullPointerException at jsp.sessions._0002fjsp_0002fsessions_0002fcarts_0002ejspcarts_jsp_0._jspService(_0002fjsp_0002fsessions_0002fcarts_0002ejspcarts_jsp_0.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) So in browser I also get the error: Error: 500 Location: /examples/jsp/sessions/carts.jsp Internal Servlet Error: java.lang.NullPointerException at
Re: RMI
I've just got my serlevt working as an RMI client. To do this I had to edit the tomcat.policy file to give all permissions to everything, and use the rmiSecurityManager. See my earlier posts for more info So it is impossible to publish such a servlet without affecting base Tomcat configuration, isn't it? That's pity:( And I am not sure I want to give AllPermissions. Did you try to refine the permissions? Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RMI
Hi all My 4-tier app uses RMI-based AppServer. I want my JSP to connect to it (using dynamic stub loading). In order to do this I have to install RMISecurityManager, haven't I? Is this legal in Tomcat? Probably, I should provide some policy file? Can my webapp use separate policy (I would not like to change the base Tomcat configuration)? I use JDK 1.3, so AFAIK RMISecurityManager === SecurityManager and uses usual policy files. Any comments are more than welcome. Regards, Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]