Re: Advice for Hosting Many Individual Webapps?
Mikolaj Rydzewski wrote: Seth Ladd wrote: The frequency is so much that the uptime of all of our applications is affected as we continually take down Tomcat servers in production to deploy a new application (or new version of the application). Because hot deploy does not work (the old favorite OOM error w/ too many redeploys), we bounce the Tomcat server for every redeploy. What about clustering? You could move users to one node of the cluster, update apps in the second one, and then the opposite. Move users to the second node, update the first one and finally allow users to work with two (or more) nodes. Yes, but then how to do you handle class evolution for objects in the session? For example, if I'm clustering two Tomcats, they are sharing Session state. If I upgrade one node in the cluster, and possibly change a class definition of an object that gets stored in the session, I will now have two definitions of the same object (one for the old cluster node and one for the new cluster node). I think there will be serialVersionUID issues there. Advice on how to handle that? Thanks! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice for Hosting Many Individual Webapps?
Allistair Crossley wrote: we used to just schedule updates and let all our staff know there would be a small amount of downtime (for our intranet) but you can't do this on external production servers, so you need to go with either load balancing/clustering that allows you to close a node down *while also* letting sessions complete (e.g BigIP I think may do this). we have a semi-solution using mod_jk's load balancing/sticky sessions. Although closing a node does not wait until sessions are complete, mod_jk still detects the failed node and passes over to the next node gracefully. it's a 1/2 way house to a full solution that you can implement right away. for graceful close down (i.e sessions completing) you need something like BigIP or a commercial application server like BEA which does this for you. I really wish support for hot deployment got sorted out in Tomcat/J2EE servers in general. Although I am a J2EE die-hard I used C# .NET recently for a project and it beats the hell out of J2EE deployment , if we're not careful this will be a big win for .NET. The hot deployment issues isn't a Tomcat issue, or a J2EE issue. It's a fundamental flaw in the JVM. There is just no way to explicitly destroy a classloader (the main cause of OOM exceptions when constantly redeploying apps). Until either we're able to just destroy a classloader, or have isolates/MVM available, we're stuck in this deployment mess. I agree, .NET is way better for developing and deploying apps. And deployment couldn't get more simple that PHP (just copy them over). Why does it have to be so hard for Java? Until Sun wakes up and realizes the JVM wasn't made to host multiple applications, and then fixes it, we're going to be stuck with the current state of things. For instance, having to run each webapp in a separate Tomcat just to minimize downtime for all apps is pretty crazy. The clustering solution seems possible, except I'm worried about two different versions of a class ending up in the session (and this causing serialVersionUID issues). Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice for Hosting Many Individual Webapps?
Asad Habib wrote: .NET and PHP may have better development/deployment environments, but quite frankly I would rather use Java than C# or PHP to develop web applications. Just look at the robust Java open-source frameworks that exist (i.e. Spring, Turbine, Struts, JSF) just to name a few. Also, .NET applications are not multi-platform. There is just no comparison to Java - J2EE rules! No doubt, and this isn't about which rules more. This is a frank discussion regarding issues of hosting many webapps, looking for a real solution. I was merely trying to illustrate how high the bar has been set, and Java should aspire to be as easy /to deploy/ as PHP. It's certainly more powerful. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Advice for Hosting Many Individual Webapps?
Hello, We are finding outselves hosting more and more individual webapps, all running on Tomcat 5.5.9 w/ JDK 1.5. Each of these webapps is developed and deployed on a separate schedule, and the number and frequency of app deployments is increasing. The frequency is so much that the uptime of all of our applications is affected as we continually take down Tomcat servers in production to deploy a new application (or new version of the application). Because hot deploy does not work (the old favorite OOM error w/ too many redeploys), we bounce the Tomcat server for every redeploy. To avoid taking down all of our applications when we need to redeploy a single app, we've begun to deploy each application to their own Tomcat instance. All of these instances are fronted by a single Apache server handling vhosts, logging, etc. We're just curious how common this setup really is. We know we are in an uncommon position, with so many webapps (approaching 20, and growing very fast). We don't want to put all our eggs in one basket, so to speak, so we've begun to split out individual tomcat instances. Anyone else have to handle numerous webapps, with frequent deploys, and have to keep uptime for all apps as high as possible? We hesitate to put all webapps in one tomcat, because to deploy one app means we have to take down all of our apps. This is becoming unacceptable. (not to mention that a memory leak in one app will bring down all the apps living in that tomcat instance) Any tips or tricks would be really appreciated. Or pointers to previous material (I've found some, but nothing that jumped out at me). Thanks very much in advance, Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Monitor Tomcat with SNMP (MRTG etc)?
Dave Morrow wrote: Thanks Seth. I have been reading the documentation on it and it looks like it will give me what I am seeking. One question though, to save time, you wouldn't happen to know where I might find a list of OID's which I could point MRTG at? Just search for JVM MIB on google, you'll find it. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: data push
Paul Wallace wrote: Hi All, I would like server A (TC 5.5) to 'push' streams of data to server B (TC 5.5) at random points in time, and for server B to accept the data when it is received. This is not using request / response, hence I am new to this topic. A couple of questions - what protocol(s) can be used, HTTP? Can anyone point me towards a resource of this nature please? I understand sockets are in the picture - also new to me. You can easily push info by just executing a HTTP POST to some URL on Server B. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: data push
Paul Wallace wrote: Hi Seth, Thanks. And must I open a socket on the client (server B)? Do I attach a listener to it? Forget sockets, we're at a higher level w/ HTTP and URLs. Use the JDK's URLConnection classes (for starters) to open a URL connection. Create a Servlet on Server B that has a doPost() method, for example. That will be your listener. Server A will use the URLConnection to connect to the servlet on Server B and write data to it. At this point, it looks like a socket (input and output streams) except you are talking over HTTP. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: data push
Paul Wallace wrote: Thanks, I have most of that in place already. Currently, server A has a HttpURLConnection open and is talking to the Servlet. I can receive data presumably from an InputStream. How do I write data to the Servlet using the connection I have open? Use the connection.getOutputStream() method and write to it like any other output stream. It will show up on the other side when you pull from the input stream. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Monitor Tomcat with SNMP (MRTG etc)?
Dave Morrow wrote: Does anyone know how to use SNMP tools to monitor a Tomcat server? Are there any open source tools to assist or add this ability? With JDK 5 you can enable the builtin SNMP agent. This can export all the standard JMX attributes of the VM. I don't think there's a way to export anything else, though. At least this gives memory, cpu, etc monitoring. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: strange cache behavior in Tomcat 5.5.9?
Gabriel Belingueres wrote: Hi, In my JSP pages I put the following tags to avoid the browser cache the pages. head meta http-equiv=Expires content=0 / meta http-equiv=Pragma content=no-cache / meta http-equiv=Cache-Control content=no-cache / I wouldn't trust this way. I would always use the below method for manipulating any cache control or general HTTP headers. % response.setHeader(Cache-Control,no-store); response.setHeader(Pragma,no-cache); response.setDateHeader (Expires, 0); % This is the way to do it. Also, it's backwares compatible. This sends actual HTTP headers back to the client in the response. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: accessing global Environment values?
Mark Thomas wrote: Seth Ladd wrote: I am not able to lookup the default simpleValue environment variable form JNDI with a simple JSP file. Is there anything else I have to do to move an Environment variable, from GlobalNamingResources, into the scope of a webapp? Any advice on how to expose GlobalNamingResources's Environment variables into webapps? You could start by reading the documentation for JNDI resources. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html Yes, I read that over and over and I was missing my ResourceLink tag in the context.xml. For some reason, I kept missing it in the documentation. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
accessing global Environment values?
Hello, I have a stock Tomcat 5.5.9 with JDK 1.5. This is a fresh install, nothing has changed. I am not able to lookup the default simpleValue environment variable form JNDI with a simple JSP file. Is there anything else I have to do to move an Environment variable, from GlobalNamingResources, into the scope of a webapp? I placed a JSP file into the webapps/ROOT directory, just for testing (contents below). The last line throws the NamingException because it's not found. When I remove the last line, I'm able to browse the JNDI tree, and I get the following output: From java: : comp: org.apache.naming.NamingContext From java:comp/ : UserTransaction: org.apache.naming.TransactionRef From java:comp/ : env: org.apache.naming.NamingContext From java:comp/ : Resources: org.apache.naming.resources.ProxyDirContext Any advice on how to expose GlobalNamingResources's Environment variables into webapps? Thanks very much, Seth Test JSP File, in webapps/ROOT : % javax.naming.Context ctx = new javax.naming.InitialContext(); javax.naming.NamingEnumeration e = ctx.list(java:); while (e.hasMoreElements()) { out.println(From java: : + e.nextElement() + br); } e = ctx.list(java:comp/); while (e.hasMoreElements()) { out.println(From java:comp/ : + e.nextElement() + br); } e = ctx.list(java:comp/env/); while (e.hasMoreElements()) { out.println(From java:comp/env/ : + e.nextElement() + br); } System.out.println(new javax.naming.InitialContext().lookup(java:comp/env/simpleValue)); % - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
A Resource ObjectFactory as LifecycleListener ?
Hello, I've setup a ObjectFactory for Tomcat's JNDI and Resource system. I'd like that that ObjectFactory to respond to the Tomcat Server shutting down. It appears that a new ObjectFactory is created for every request for the Object, so ObjectFactory itself is not a singleton. That's OK for now. The Object that is returned by the ObjectFactory is a singleton (in a sense) and I'd like that Object to shutdown cleanly when the Server shuts down. One idea I had was to create a Listener that would shut down the singleton. The ObjectFactory would continue to serve the singleton via JNDI. The problem there is I might have to duplicate some class files because the Listener will load its classes from server/lib, while the ObjectFactory will load its classes from common/lib. If I could have the Resource or the ObjectFactory participate as a LifecycleListener, I think it would work very smoothly. I looked through the code, and it doesn't appear possible. Thanks, Seth -- a href=http://www.picklematrix.net/foaf.rdf;Seth Ladd's FOAF/a a href=http://www.foaf-project.org/;What is FOAF?/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A Resource ObjectFactory as LifecycleListener ?
Shapira, Yoav wrote: Hi, Why go through all this? The point of the JNDI Resources part of the Servlet Specification is to allow portable interaction with external resources. Your approach loses all the portability (it's Tomcat-specific) without gaining much of anything. You could do the same stuff in your webapp, instead relying on a portable notification of app shutdown (ServletCotnextListener) and managing your own object creation/destruction. Good question. Because we have a few services we'd like shared between all webapps. While you are correct that getting the service into JNDI is Tomcat specific (which is why I'm pulling for a writable JNDI context :), getting the service out from JNDI is standard. So while we could put all the classes into common/lib and use a singleton pattern, I wouldn't have a way to cleanly shut down the service on app server shutdown (I could be wrong here). Seth -- a href=http://www.picklematrix.net/foaf.rdf;Seth Ladd's FOAF/a a href=http://www.foaf-project.org/;What is FOAF?/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A Resource ObjectFactory as LifecycleListener ?
Shapira, Yoav wrote: Hi, So while we could put all the classes into common/lib and use a singleton pattern, I wouldn't have a way to cleanly shut down the service on app server shutdown (I could be wrong here). You could use a JVM shutdown hook. At least that's portable and not Tomcat-specific. Another alternative would be to externalize the service itself onto a separate server, so you don't need to worry about shutting it down at all ;) Well, that's kind of what we do now. We expose the service via Hessian, so that all webapps can access it (and avoid classloading issues of implementation classes). I was hoping to avoid the overhead and expose as regular classes via JNDI. Seth -- a href=http://www.picklematrix.net/foaf.rdf;Seth Ladd's FOAF/a a href=http://www.foaf-project.org/;What is FOAF?/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bind Object into Global JNDI Within Servlet?
Shapira, Yoav wrote: Hi, The comp:env JNDI context is read-only for webapps. Thanks for the reply! Any chance webapps will be able to bind objects into global JNDI in the future? I've been using Tomcat 5.0.x. Otherwise, any recommendations for sharing objects across webapps that can't be setup using the GlobalResources ? I need to configure some things at startup of my webapp. Thanks! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bind Object into Global JNDI Within Servlet?
That's why we give you a shared classloader repository: $CATALINA_HOME/shared/classes and shared/lib, as explained in the classloader how-to. Things in there are visible to all webapps. You can further enforce patterns like a Singleton so that only one instance of a class exist and is shared among all your webapps. Yeah, the actual bytecode will live in shared/classes. I liked using JNDI because I could lookup the object every time I need it. That allows me to redeploy the owning webapp and rebind the object. The clients won't be affected by that. Using a Singleton in the meantime might be a good way to go in the meantime. We also might just give access to the shared object via Hessian or Burlap. Kinda crazy since we're in the same VM, but I want to be more flexible than a singleton in a shared classpath. Thanks for your tips! I'm pro-GeronimoNaming :) Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.4 Stability
Vy Ho wrote: With SP2 of Windows XP, the computer previously can't handle 50 threads can handle 200 threads now. More than that, I got connection refused error. I've had terrible performance on SP2 (my development box). Unless this is your deployment environment, don't trust or worry about SP2 performance. It's terrible. Testing my application on Linux, with the same Tomcat setup, yields much more pleasurable results. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Realm using LOTS of DB connections
Norris Shelton wrote: We have the manager app for each of our contexts set-up to use the DB to authenticate users. Unfortunately, it is using TONS of connections. Over an 8 min period, it used 1200 connections. We have 2 boxes, each with 16 contexts with their own manager context. Here is what the manager context of each of them looks like: Context docBase=../../server/webapps/manager path=/manager privileged=true Realm className=org.apache.catalina.realm.JDBCRealm You might want to try to DataSourceRealm, which would pull its connection from a pool. Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bind Object into Global JNDI Within Servlet?
Hello, Is it possible to bind objects into global JNDI from within web application code? For instance, I'd like to bind some objects into global JNDI from one webapp so that other webapps will see them. Any tips or tricks would be greatly appreciated! Thanks very much! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
running error page through filter?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I'm having a difficult time running Tomcat managed error-pages through a filter. I'm hoping someone might be able to lend a tip. I've been reassured that this is not a bug, so it gives me hope this is possible. :) from web.xml: filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher !-- specifically handles login pages -- dispatcherREQUEST/dispatcher dispatcherERROR/dispatcher /filter-mapping error-page error-code404/error-code location/WEB-INF/jsp/error404.jsp/location /error-page I've placed debug logic in the sitemesh filter to print out when it gets a request, and I don't receive any print out when the error page is displayed. So I'm fairly certain the filter is not being run. Any other configuration items required to wrap an error in a filter? Thanks very much! Your help is greatly appreciated, Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFA0zRRKZsFSwtW+wIRAvPXAJ9r++ebUZs78jh68963UVskC1d16QCfTCRx 3Wj8dBXYeErS2KELrTn6pdo= =zc5j -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session-timeout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jerald Powel wrote: | Hi all, | | I am experiencing problems with memory management. I load up my app in 10 or 15 browsers where various stuff is put on a session each time. In Windows Task Manager I can see java.exe incrementing by an amount of memory for each browser/app opened. No problem there. In my web.xml I define session-timeout to be 2 minutes. Why after an inactive period of time exceeding 2 minutes, does the memory being used not appear to lessen please? In fact, even I close all browsers the memory being consumed remains at its peak...until a server restart is necessary. Jerald, I don't know the internals of Tomcat's Session management, but there are a few things to think about here that might help. 1) Just by closing the browser does not cause the session to close. 2) You could be putting some shared object into the Session which is not garbage collected when the session itself dies. 3) I believe you can configure a listener to receive an event when a session dies. You could therefore see if they really are being closed. 4) Be careful what you put in the Session. Usually only place small or transient objects into the Session. Don't put any heavy objects, like database connections into the session. 5) There could be a Tomcat bug. :) (unlikely, though) Hope that helps, Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFATPrI5EIB1scRes8RAn7oAJ43yJLv+9GeaQD7LADIuQfk0N5zuQCeJTDl +aFJNg57g77HwvOATT60kB8= =8yG4 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Entity Include Into web.xml w/ Tomcat 5
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I've been precompiling my JSPs w/ ant, and I would like to include the web.xml snippet that results from the ant task into my web.xml. All of the examples of using a DOCTYPE ENTITY I've see are for servlet spec 2.3, which uses a DTD. Is there a way, with servlet spec 2.4 and its XML Schema, to include an XML snippet into the web.xml? For instance, I've been trying versions of this: !DOCTYPE web-app [ ~ !ENTITY compiled_jsps SYSTEM compiled_jsp.xml ] But no luck. Any ideas or tips? Thanks very much! Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFATRFw5EIB1scRes8RAjfFAJ9k+oxWbO4L12Smx4SIhkz5HgTYwQCffLbo VJ8681O0MSQIo8NK7+wfRGg= =68++ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shapira, Yoav wrote: | Howdy, | | |Wow, OK, thanks for the great insight. In other words, it's safe to |assume to always restart Tomcat when deploying webapps. That, of |course, is less than ideal. For testing, that just makes the |development time longer (and more complicated, since now we have to |remember to restart Tomcat every X deployment times). And for |production, of course we don't want to take anything down. | | | In practice, it's also common to have one webapp per tomcat instance, so | that should anything go wrong (e.g. OutOfMemoryError, malicious code), | only one webapp is affected even if you have to restart the tomcat | server. So that above is not bad from that perspective. Thanks for the tip. I agree completely with this one. Hopefully we'll move to this soon. It certainly makes production deployments easier. Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAHpKT5EIB1scRes8RArQXAJ9Nru3aBPjH/WrVJa3CVLzaDqs7swCdFzBx /qgT+4izSep+vF7gkb1bHW0= =tsG6 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Redeployment of War over and over Supported?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, We are running Tomcat 5.0.18 w/ jdk 1.4.2 on Linux. We deploy our wars with the catalina deployer and ant. We automate our builds and deployments for every 30 minutes. So, every half an hour we build and deploy our war to tomcat. This process seems to always force an OutOfMemoryException with Tomcat. ~ Things work great for about half a day, but then always we're able to crash Tomcat. Is automated deployment over and over supported with Tomcat? It's my assumption that if we're able to deploy a war to tomcat w/ the deployer, then we should be able to deploy that war many times. Has anyone else seen this behavior? This is a default install of Tomcat, and right now the way is very simple (no database connections yet). Any tips or hints would be greatly appreciated. Thanks very much! Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAGp6w5EIB1scRes8RAh64AJ9dkjI9V9zPMV/MQm89CSgmLWVS4gCfeyeS qjLwgxSsWR9Y3p08iOkE2iE= =EGSM -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | | Out of curiosity, why every half hour? Seemed like a good round number. No real reason, we just wanted things current. :) | | So there's a memory leak somewhere. Yes, no doubt. I'm trying to discover if it's my app (very well could be) or Tomcat. | Your impression is correct. Note that reloading an application may have | associated memory leaks. For example, look for static references that | are not properly discarded on shutdown. This and related issues have | been discussed many times on this list in the past: perhaps searching | the archives will yield more clues. Yes, I have begun to search the search. Any idea if this is an acknowledged problem of Tomcat? If not, I'll split my time between my webapp and tomcat. If it's a definite problem with Tomcat, then I'll focus my research to Tomcat. Thanks very much! Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAGr1m5EIB1scRes8RAoVvAKCTutqnm4WDXK232kJeBERkwUhXngCfdlUw 8RRlOA/cup+ntT4mCF+IoOQ= =pOzZ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philipp Taprogge wrote: | Hi! | | I don't know if this applies to your webapp, but there is an issue with | the java compiler having a memory leak which can lead to OOM errors when | tomcat has to compile many jsps over and over. A remidy for this is | either to use jikes instead of javac entirely or to set the fork | attribute of the default servlet to true, thus loosing some speed but | preventing the leak. | Thanks very much! This very well could be it. I'll look into how to set fork to true. I'll let you know what we experience, Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAGsIG5EIB1scRes8RAtUaAJ94S8TtbEMr8jL8vmOAlad49T3jkgCeItTR ObMFHEF5DecxpuslZb/I/KM= =r7zn -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redeployment of War over and over Supported?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 | There are some problems with certain webapps (Struts based webapps in | particular). | http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26135 | | More generally, there's no way to force the VM to discard a classloader, | so I think it is unwise to rely on perfect GC when reloading classes. | Since there are meny ways to keep references to classloaders (shared | library, shutdown hook, background thread, ...). | Wow, OK, thanks for the great insight. In other words, it's safe to assume to always restart Tomcat when deploying webapps. That, of course, is less than ideal. For testing, that just makes the development time longer (and more complicated, since now we have to remember to restart Tomcat every X deployment times). And for production, of course we don't want to take anything down. Thanks again, your help is much appreciated! Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAGuIw5EIB1scRes8RAjwIAJ9z4wIepbgDAT10r5gsQhVW+lGh6gCdHDtx yF5EdQL6U4hsUEKPrF07qTU= =N1lR -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting tomcat using ant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Keshav Sarin wrote: | Does anyone know how to start tomcat 5 using ant target? I do this: ~ target name=server.start depends=init ~ exec dir=${tool.tomcat} executable=${basedir}/${tool.tomcat}/bin/startup.sh ~ os=Linux failonerror=yes ~ env key=CATALINA_OPTS value=-Dfile.encoding=UTF-8/ ~ env key=JAVA_OPTS value=-Xmx256m/ ~ /exec ~ /target target name=server.stop depends=init ~ exec dir=${tool.tomcat} executable=${basedir}/${tool.tomcat}/bin/shutdown.sh ~ os=Linux failonerror=yes/ ~ /target YMMV, but it seems to work really well. Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAFvrU5EIB1scRes8RAi6GAJ479A4EyWd4PBGHcEOmiWJC8cwEzQCeN0Tg 9bY7anZGajh+5tCNG832VVk= =Ydh+ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: port info
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ro, Jean S wrote: | Hi, | | I use the following url: | | http://mydomainname.com:8081/mywebapp/ | | But I don't want the user to see the port information so I want to remove it | from url: | | http://mydomainname.com/mywebapp/ | | How do I do that? You can't really do that with just Tomcat, because you've set up Tomcat to listen on 8081. You could use Apache or some proxy device that listens on port 80 to forward requests to Tomcat listening on port 8081. ~ Many people use this type of configuration. Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAAwXU5EIB1scRes8RAjMaAJ9A3FBXNCluUiu7F5SZQolI89TSBgCeImBt a1RKnc9DLhQ/VBCrItuPV7k= =dTAL -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Possible Bug with JSPC with c:import of JSP 2.0 page?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I'm not sure what's really the issue here, and hopefully someone can help explain this. I'm using Tomcat 5.0.16, Suse9, and Sun's JDK 1.4.2. ~ I'm using Ant 1.5.4 and the JSPC tasks from Tomcat. I originally had a single JSP 2.0 file that had this snippet: %@ page language=java % %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % [SNIP] head ~ c:choose ~c:when test=${requestScope.contentType eq ~'application/xhtml+xml'} ~ meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8/ ~/c:when ~c:otherwise ~ meta http-equiv=content-type content=text/html; charset=utf-8/ ~ /c:otherwise ~ /c:choose /head And it worked great. Then, I took out the c:choose../c:choose and placed it into it's own file, which looked like this: %@ page language=java % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % c:choose c:when test=${requestScope.contentType eq 'application/xhtml+xml'} meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8/ /c:when c:otherwise meta http-equiv=content-type content=text/html; charset=utf-8/ /c:otherwise /c:choose And then modified the first file to this: [SNIP] head c:import url=/jsp_include/meta_contentType.jsp/ /head I would then get this error: javax.servlet.ServletException: /jsp_include/meta_contentType.jsp(5,1) According to TLD or attribute directive in tag file, attribute test does not accept any expressions So my question is this: Why would this happen? The solution was the change the taglib from core to core_rt in the imported file. Why would it work inside the main file, but start failing once I took it out and placed it in its own include file? Any ideas or tips? It's working now, but I don't think I should have to make core into core_rt Thanks very much, and sorry for the long setup to the question. :) Seth -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/8yPj5EIB1scRes8RAguRAJ99K/XiL/j1MCQ78zVuqTTFdFtj1wCgigkn ubpK8ZpQVJPtkY955NyZ+Xs= =lE2Y -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Way to get Reference to Servlet from Filter?
Tim Funk wrote: You won't be able to get the servlet reference. A possibility is to define the filter multiple times with different parameters. For example, here is the same class name defined 4 times as 4 different filters. Good idea. Thanks for the helpful response. Since I can't get a reference to the servlet, I've resorted to reading in the web.xml file itself to get any init-params I would need. Thanks! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Way to get Reference to Servlet from Filter?
Hello, I don't think this is possible, but I'm giving it a shot anyway. :) I'd like to get ahold of a servlet reference from within a filter. Is there a way? I have a filter that creates objects and places them within the request scope, but it does it differently for each end-result servlet. I'd like the filter to look at the URI, determine the servlet, and grab the servlet. Then, it can either grab its init-params or just call a special method to get the data it needs. Now, this idea might be broken to begin with. The other idea is to just create a super class for the servlet and handle this base logic from there. If I can use a filter, though, that would be great. Any tips or hints? I hope I wasn't too vague. Thanks very much! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Fwd: Re: [Opensymphony-sitemesh] Problems with SM 2.0.1 Example and Tomcat 5.0.16]
Hello, I'm sorry for the forward, but Scott from Sitemesh thought that a problem I was experiencing was a Tomcat bug. Below is a stacktrace I'm experiencing when running the sitemesh example webapp in Tomcat 5.0.16 (SuSE 9, JDK 1.4.2). Scott thinks it's a Tomcat 5 bug. Would the stacktrace appear to be a problem with the sitemesh example webapp or with Tomcat? Thanks very much for your help, Seth Original Message Subject: Re: [Opensymphony-sitemesh] Problems with SM 2.0.1 Example and Tomcat 5.0.16 Date: Mon, 15 Dec 2003 15:38:59 +1100 From: Scott Farquhar [EMAIL PROTECTED] To: Seth Ladd [EMAIL PROTECTED] CC: [EMAIL PROTECTED] References: [EMAIL PROTECTED] Seth, I believe that Sitemesh runs fine under Tomcat 4, but it hasn't been tested yet on Tomcat 5. From the stack trace, it looks like a Tomcat 5 bug - you should always be able to get a writer from a JSP? Can you try the test suite and see if it works for you? Cheers, Scott Seth Ladd wrote: Hello, I am just experimenting with SiteMesh, and ran into some problems. I have deployed the sitemesh-example.war from the 2.0.1 release to Tomcat 5.0.16. The first problem I have is that the web.xml contains some invalid configs. The url-pattern*/url-pattern should be url-pattern/*/url-pattern. Once I changed this, the war was able to deploy. Then, when I try to access the example webapp, I receive this error: java.lang.IllegalStateException: getOutputStream() has already been called for this response org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:611) org.apache.coyote.tomcat5.CoyoteResponseFacade.getWriter(CoyoteResponseFacade.java:190) javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:156) org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:167) org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:160) org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:214) org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:990) org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:626) com.opensymphony.module.sitemesh.taglib.page.ApplyDecoratorTag.doEndTag(ApplyDecoratorTag.java:254) org.apache.jsp.decorators.main_jsp._jspx_meth_page_applyDecorator_0(main_jsp.java:171) org.apache.jsp.decorators.main_jsp._jspService(main_jsp.java:80) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:169) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:68) I'm not sure how to fix this one. Any ideas or tips? Thanks very much! Seth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]