Re: Launching an embedded Tomcat from Maven 1.x
Since you are using Embedded, your class needs to be loaded by the same ClassLoader that loads Tomcat. You might want to look at the examples for loading Tomcat from ant in commons-modeler, as an alternative way of doing what you want. Alonso Dominguez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there! I'm working to embed a Tomcat server as a servlet container inside an Avalon Framework with a Loom engine. I looked for information how to launch the Catalina service from Java and finally I wrote the next file: package org.jlabase.framework.tomcat.startup; import java.io.File; import java.net.InetAddress; import org.apache.catalina.*; import org.apache.catalina.connector.*; import org.apache.catalina.realm.*; import org.apache.catalina.startup.*; import org.apache.tomcat.util.*; import org.jlabase.framework.tomcat.*; /** * @author a href=mailto:[EMAIL PROTECTED]A. Alonso Dominguez/a * @version 1.0 */ public class TomcatImpl implements Tomcat { private String path = null; private Embedded catalina = null; private Host host = null; private Context rootContext; private int port = 8080; public String getPath() { return path; } public void setPath(String value) { path = value; } public int getPort() { return port; } public void setPort(int value) { port = value; } public void start() throws Exception { Engine engine = null; // Create an embedded server catalina = new Embedded(); catalina.setCatalinaHome(getPath()); // Set the MemoryRealm MemoryRealm mr = new MemoryRealm(); catalina.setRealm(mr); // Create an engine engine = catalina.createEngine(); engine.setDefaultHost(localhost); // Create a default virtual host host = catalina.createHost(localhost, getPath() + /webapps); engine.addChild(host); // Create the ROOT context rootContext = catalina.createContext(, getPath() + /webapps/ROOT); rootContext.setReloadable(false); rootContext.addWelcomeFile(index.jsp); host.addChild(rootContext); // Create the Manager context Context managerCtx = catalina.createContext(/manager, getPath() + /webapps/manager); managerCtx.setPrivileged(true); host.addChild(managerCtx); // Assemble the container hierarchy catalina.addEngine(engine); // TODO Repair the Connector bug String addr = null; Connector connector = null; InetAddress address = null; try { connector = new Connector(); connector.setSecure(false); address = InetAddress.getLocalHost(); if(address != null) { IntrospectionUtils.setProperty(connector, address, address.toString()); } IntrospectionUtils.setProperty(connector, port, new Integer(getPort()).toString()); } catch(Exception e) { e.printStackTrace(); } connector.setEnableLookups(false); catalina.addConnector(connector); catalina.start(); // Starts the embedded server } public void stop() throws Exception { catalina.stop(); } public static void main(String args[]) { System.out.println(Creating server instance...); TomcatImpl tomcat = new TomcatImpl(); tomcat.setPath( new File(System.getProperty(jlbframework.tomcat.home, System.getProperty(basedir, .))).getAbsolutePath() ); try { System.out.println(Using CATALINA_HOME = + tomcat.getPath()); System.out.println(Starting server on port + tomcat.getPort()); tomcat.start(); //tomcat.catalina.setAwait(true); } catch(Exception e) { e.printStackTrace(); } } } My intention is to configure the Catalina service from this class and use a simple Ant-like script in Maven to launch the main method of this class. So, my next step was write the maven.xml file, this is: project xmlns:ant=jelly:ant xmlns:j=jelly:core xmlns:u=jelly:util default=loom:sar goal name=jlbframework:tomcat-init ant:path id=tomcat.classpath j:forEach var=artifact items=${pom.artifacts} j:set var=dependency value=${artifact.dependency} / j:if test=${dependency.getProperty('sar.bundle')=='true'} ant:fileset dir=${maven.repo.local}/${dependency.artifactDirectory}/jars prefix=lib ant:echoAdding artifact: ${dependency.artifact} to the Tomcat classpath./ant:echo ant:include name=${dependency.artifact} / /ant:fileset /j:if /j:forEach ant:pathelement path=${jlbframework.tomcat.home}/conf / /ant:path /goal goal name=jlbframework:tomcat-start prereqs=jar:jar,jlbframework:tomcat-init ant:echoStarting Tomcat in stand-alone mode.../ant:echo ant:java jar=${maven.build.dir}/${maven.final.name}.jar fork=true maxmemory=15M failonerror=true classpathref=tomcat.classpath ant:sysproperty key=basedir value=${basedir} / ant:sysproperty key=jlbframework.home value=${jlbframework.home} / ant:sysproperty key=jlbframework.tomcat.home value=${jlbframework.tomcat.home} / /ant:java /goal /project And this are the contents of the project.properties file: jlbframework.home=${basedir}/../.. jlbframework.tomcat.home=${basedir} maven.xdoc.date=left maven.xdoc.version=${pom.currentVersion} maven.eclipse.resources.addtoclasspath=true
Re: SingleSignOn and Form Authentication
On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: After the authetication and login I want to redirect to a Menu Page not to any page requested earlier. Using default form authentication tomcat redirects to the page requested not to the page I want (e.g Menu Page). That's the behavior that I want ... so I'have never looked further ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository
Hi all, I'd greatly appreciate your thoughts on the following issue (and the proposed solution ): When adding a jar file (eg, foo/bar.jar) to the class loader's repository it treats as a directory and therefore it cannot load any classes from this jar. The following explains why it happens. org.apache.catalina.startup.ClassLoaderFactory is responsible for creating class loader instances. Each instance is of org.apache.catalina.loader.StandardClassLoader type, which in its turn extends java.net.URLClassLoader: - public class StandardClassLoader extends URLClassLoader - ClassLoaderFactory#createClassLoader(File unpacked[], File packed[], URL urls[], ClassLoader parent) is the actual method that creates class loaders. The very first argument to this method contains jar files or directories ( that is where the name unpacked comes from ). ClassLoaderFactory#createClassLoader method adds File.separator to the end of the jar file path ( file.getCanonicalPath() + File.separator ) when constructing a URL instance to represent a jar file and then adds a string representation of a newly created URL to its list of repositories ( list.add(url.toString()) ) : - if (unpacked != null) { for (int i = 0; i unpacked.length; i++) { File file = unpacked[i]; if (!file.exists() || !file.canRead()) continue; if (debug = 1) log( Including directory or JAR + file.getAbsolutePath()); URL url = new URL(file, null, file.getCanonicalPath() + File.separator); list.add(url.toString()); } } - For instance, if unpacked argument contains '/home/aa/lib/velocity.jar' then a URL object is 'file:/home/aa/lib/velocity.jar/' - a forward slash / (which is a Unix file separator) has been added to the url. After ClassLoaderFactory#createClassLoader adds all repositories to its repository list it converts this list to array and constructs StandardClassLoader with it: - String array[] = (String[]) list.toArray(new String[list.size()]); StandardClassLoader classLoader = null; if (parent == null) classLoader = new StandardClassLoader(array); - StandardClassLoader( String[] ) constructor converts each repository found in the given array argument to a URL object: - protected static URL[] convert(String input[], URLStreamHandlerFactory factory) { . url[i] = new URL(null, input[i], streamHandler); . } - For instance, if the repositories array of String type contains 'file:/home/aa/lib/velocity.jar/' then a URL object is 'file:/home/aa/lib/velocity.jar/'. If the repository holds a path on Windows machine then the URL object would have all backslashes replaced all with forward slashes ( URL object crated with new URL(null, file:I:\lib\velocity.jar\, streamHandler) would have file:I:/lib/velocity.jar/ string representation ). Once StandardClassLoader( String[] ) converts repository array of a String type into a URL type it calls its super constructor, which in fact is a URLClassLoader( URL[] ). However, the contract for URLClassLoader( URL[] ) constructor indicates that Any URL that ends with a '/' is assumed to refer to a directory. and therefore a jar file gets ignored by the loader. For instance, if the repositories array contains 'file:/home/aa/lib/velocity.jar/' url object the URLClassLoader( URL[] ) constructor treats this url as a directory and therefore a jar file is never properly loaded. Therefore, a File.separator that got added to a jar file in ClassLoaderFactory#createClassLoader method made it invalid because the actual class loader assumes that this jar file is a directory. == Proposed solution ==
Pb with thread and http-connector
Hi, I'm running tomcat 4.1.31 on HP-UX 11i with the HotSpot JVM 1.4.2_02. I'm using a Coyote HTTP/1.1 Connector. I'm investigating the following memory issue : the heap size grows until the -Xmx value and then the I have a java.lan.OutOfMemory exception. Using HPjmeter to profile my appliation, I discovered that tomcat creates new http thread and destroys the older. The number of thread is stable (betwenn 5 and 10). I don't understand that behavior and I suspect that it's related with my memory issue. Someone has an idea on that behavior ? Is it a normal one ? How can I configure tomcat (or the coyote connector) to log why it creates and kills thread ? Thank you for your help Xavier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository
From: Akoulov, Alexandre [IT] [mailto:[EMAIL PROTECTED] Subject: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository ClassLoaderFactory#createClassLoader(File unpacked[], File packed[], URL urls[], ClassLoader parent) is the actual method that creates class loaders. The very first argument to this method contains jar files or directories ( that is where the name unpacked comes from ). From what I can tell, it's the _second_ argument that should contain .jar files; the first is for directories only. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with servlets
Hi guys... I was trying to run an application, and I've got the following message: 21/04/2005 10:06:33 org.apache.catalina.core.ApplicationContext log INFO: Marking servlet Auth as unavailable 21/04/2005 10:06:33 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet Auth java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class Auth with modifiers at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.Class.newInstance0(Class.java:344) at java.lang.Class.newInstance(Class.java:303) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) 21/04/2005 10:08:45 org.apache.catalina.core.StandardWrapperValve invoke INFO: Servlet Auth is currently unavailable What could be the problem? The Auth servlet is just a simple test that I'm making, here is its source code: import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; class Auth extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String username = req.getParameter (username); String password = req.getParameter (password); PrintStream browser = new PrintStream (res.getOutputStream()); browser.println (html); browser.println (headtitleOk.../title/head); browser.println (bodyUSerName: + username + brPassword: + password + br/body/html); } } Regards, -- Adriano Monteiro Marques www.gopython.com.br [EMAIL PROTECTED] I'm FREE... Are you? (PYTHON powered) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache_MaxClients, AJP_maxThreads and jkWorker.cachesize
On Wed, 20 Apr 2005 19:12:17 +0200 Mladen Turk [EMAIL PROTECTED] wrote: Lionel Farbos wrote: Thank you again. So it means than I can have 1 local JkShmFile on my web1 and other local JkShmFile on my web2. But, if, in web1_jkStatus, I disable 1 worker from my cluster (loadbalancer), I also have to disable it from my web2_jkStatus ? Right ? Well, you can try to use the single shm file. It won't hurt trying ;) Frankly never tested that on NSF and with multiple httpd's. So, tell us if it works. Sorry Mladen, but when I put 1 shm file on a nfs mount, it doesn't work :-( So, I use 1 local shm file/web but I use a script to invoke, in one time, the disable or enable of worker on each web_jkStatus. Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with servlets
public class Auth extends HttpServlet -Original Message- From: Adriano Monteiro [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:31 AM To: tomcat-user@jakarta.apache.org Subject: Problems with servlets Hi guys... I was trying to run an application, and I've got the following message: 21/04/2005 10:06:33 org.apache.catalina.core.ApplicationContext log INFO: Marking servlet Auth as unavailable 21/04/2005 10:06:33 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet Auth java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class Auth with modifiers at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.Class.newInstance0(Class.java:344) at java.lang.Class.newInstance(Class.java:303) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) 21/04/2005 10:08:45 org.apache.catalina.core.StandardWrapperValve invoke INFO: Servlet Auth is currently unavailable What could be the problem? The Auth servlet is just a simple test that I'm making, here is its source code: import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; class Auth extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String username = req.getParameter (username); String password = req.getParameter (password); PrintStream browser = new PrintStream (res.getOutputStream()); browser.println (html); browser.println (headtitleOk.../title/head); browser.println (bodyUSerName: + username + brPassword: + password + br/body/html); } } Regards, -- Adriano Monteiro Marques www.gopython.com.br [EMAIL PROTECTED] I'm FREE... Are you? (PYTHON powered) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to enable GC with Tomcat Service Manager
Folks, The closer we could get so far is to define the following JVM Option to the Tomcat Manager Service: -Xloggc:path_to_log_file Which does not explain me why it does not pick up the -verbose:gc . Maybe I need to wait for another life! Guillaume - Original Message - From: Guillaume Lahitette [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: How to enable GC with Tomcat Service Manager Date: Wed, 20 Apr 2005 22:37:02 +0100 Hi, I'm running Tomcat as a Windows service using Tomcat Service Manager 0.2.8 (http://web.bvu.edu/staff/david/index.jsp?section=softwaresubsection=tcservcfgpage=overview). I'm now trying to enable the garbage collector output but am simply not getting any GC info in /cygdrive/D/jakarta-tomcat-4.1.24/logs/Tomcat4124_out.log. I've pasted the config below. Has anyone got any success with it? Guillaume. - Configuration Service name Tomcat4124 Catalina home D:\jakarta-tomcat-4.1.24 Catalina base D:\jakarta-tomcat-4.1.24 Tomcat config file D:\jakarta-tomcat-4.1.24\conf\server.xml Use security manager 0 Security policy file D:\jakarta-tomcat-4.1.24\conf\catalina.policy Java home c:\j2sdk1.4.1 JVM Path c:\j2sdk1.4.1\jre\bin\server\jvm.dll Classpath D:\jakarta-tomcat-4.1.24\bin\bootstrap.jar;D:\jakarta-tomcat-4.1.24\common\lib;c:\j2sdk1.4.1\lib\tools.jar Temp directory D:\jakarta-tomcat-4.1.24\temp System.out file D:\jakarta-tomcat-4.1.24\logs System.err file D:\jakarta-tomcat-4.1.24\logs Initial heap Max heap Stack size JVM server Additional JVM option -verbose:gc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
digester understanding again...
Hello all, Here I come again with my digester :)) So, I have my xml file, I have created my digester and all the needed classes for my xml tags, and do a digester.parse(). Still here all is ok. I start Tomcat 5.0 and look to the log file. All seems ok, my xml file is consumed, all the classes are instancied etc...etc... My question: If I have an xml file like this computer brand name=compcool modelfaster_than_all/model serialnumber1248965serialnumber /brand brand name=pcassociated modelvery_expensive/model serialnumber34564serialnumber /brand brand name=pcassociated modelexpensive_too/model serialnumber99serialnumber /brand /computer how can I get after in my Java code the serial number of the model expen sive_too for example??? How can I be sure to get the good data as I have two identical brand names? Thank you for your help. Regards, Manuel ps: I know that for someones the question seems to be very basic but remember when you were beginner and be kind to me This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
So let me get this straight, LeeAnn is specifying a maximum heap size of 512MB and a minimum size of 128MB. It looks like the heap doesn't get adjusted up when the servlets are initializing? Thus she needs to increase her minimum heapsize, so something like -Xms512m should fix it? -ryan -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 8:35 PM To: Tomcat Users List Subject: Re: OutOfMemoryError - 100 thread limit? ok, I just tried starting tomcat with the default heap size and 18 instances of my webapp and it got OOME just as you see. If I set my heap to -Xms256m -Xmx512m I'm able to load the 18 webapps just fine. the total memory used after all the webapps are loaded is 152Megs. the total number of webapps is 25 webapps including the default tomcat webapps and a few more. so basically you'll need to set the heap larger enough and it should work. If i do some math, we can calculate a rough estimate for the min heap (154 - 64)/25 = 3.6megs so basically, you'll need to multiply the number of webapps by 4 megs to figure out the heap setting. peter lin On 4/20/05, LeeAnn Pultz [EMAIL PROTECTED] wrote: when you say 50 threads, do you mean 50 separate web applications? My concern right now is that we seem to be limited to 17-18 copies of our web app on a particular installation of tomcat. And that is just hitting the login page - not doing any work. Practically, for applications with many users, we may be limited to 7-10 copies of our application on a tomcat. Maybe I'm expecting too much? Perhaps that's a reasonable number of concurrent webapps that can be run on a tomcat? But if that is the case, it would be good to know what the limiting factor is, if it's not number of threads or amount of memory. thanks for much for your help! At 05:48 PM 4/20/2005, you wrote: ahh ok. .. my confusion. back to the problem you see. I've tested tomcat with 30-40 threads without any problems in the past. Even with heavy weight JSTL tags in JSP's, I'm able to go up to 50 threads with tomcat4.1. I'll try hitting tomcat's status servlet with 50 threads tonight and see what happens. peter On 4/20/05, LeeAnn Pultz [EMAIL PROTECTED] wrote: I think we've gotten things a bit confused :) The application itself is not thread intensive - our original tests show that each separate copy of the web application started up 3 active threads. Further testing, when we added in debugging code that would spin up dozens of threads just to see if we could cause the tomcat to get the error if we started one application up and had tons of threads, showed that we could get 800+ threads with no problems (no outofmemory errors) and that the problem does not in fact seem to be specifically related to the number of threads the application creates. In fact, regardless of whether each instance of the application spins up 3 threads (real situation) or 10+ (debug code only) threads, we still get the out of memory error not when we hit a certain number of threads, but actually when we hit a certain number of servlets having been initialized. Testing a very simple servlet, I can start up 25 instances of the servlet with no OOM error. Testing our application's servlet, I can only start up 17-18 instances of the servlet before getting an OOM error. At this point I am going through our standard application servlet, trying to isolate what work it does that may cause a problem when we do it 17 or 18 times on one installation of tomcat. At 05:16 PM 4/20/2005, you wrote: if your application is thread heavy, I would recommend changing it so that one thread can manage several processes. creating 800+ threads is going to hit a scalability and reliability wall very quickly. In general, you want to make sure the number of threads remain constant under constant load. If it doesn't the server will eventually crash as you currently see. I'm guessing the application is using threads to handle async processes, which is good, but spawning new threads with every request isn't going to work. hope that helps peter On 4/20/05, LeeAnn Pultz [EMAIL PROTECTED] wrote: We tried a new test :) We added code that spins up 8 threads inside just a plain servlet that doesn't do anything else. When I fire up 10 different instances of that servlet, I get hundreds of threads printing out as being active - and no out of memory errors. So we added the same code to our (slightly more complex) application servlet, and did the same thing. Now the reported number of threads is much higher, but I still get an OutOfMemory error at the same number of new instances fired up (between 17-18 sites started up). Active Threads : WHEN STARTING INIT() 617 [GC 57193K-46096K(129792K), 0.0353880 secs]
Tips regarding security and configuration
hi, I have a fedora core 2 system with the standard tomcat/jakarta/mod_jk2 rpms installed. I am looking for tips regarding the configuration, specially with security and virtual hosting practices. regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? So let me get this straight, LeeAnn is specifying a maximum heap size of 512MB and a minimum size of 128MB. It looks like the heap doesn't get adjusted up when the servlets are initializing? Thus she needs to increase her minimum heapsize, so something like -Xms512m should fix it? Probably not, since I suspect she's running out of perm gen space. IIRC, the perm gen size is calculated from -Xmx, which is already at 512m. Using the PrintGCDetails will tell us for sure. If that shows perm gen space to be exhausted, then adjusting -XX:MaxPermSize should fix it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Missing JNDI resource params after deployment.
I have the following in a file called ems.xml in my META-INF directory. After deploying this application, the JNDI resource is listed for the application in the administration screen, but none of the ResourceParams are associated with it. Have I got something wrong in the context file? Thanks in advance. Dave Context path=/ems reloadable=true docBase=/home/dhicks/projects/ems/build/webapp workDir=/home/dhicks/projects/ems/build/webapp/WEB-INF/work Logger className=org.apache.catalina.logger.SystemOutLogger verbosity=4 timestamp=true/ Resource name=jdbc/emsDb auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/emsDb parameternameusername/namevaluesa/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/namevaluenet.sourceforge.jtds.jdbc.Driver/value/parameter parameternameurl/namevaluejdbc:jtds:sqlserver://psg01:1433/dchems;user=sa/value/parameter /ResourceParams /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tips regarding security and configuration
Mbneto, Security is necessary, virtual hosting is neat. If you were a bit more specific, we could be also. Fritz -Original Message- From: mbneto [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 7:09 AM To: tomcat-user@jakarta.apache.org Subject: Tips regarding security and configuration hi, I have a fedora core 2 system with the standard tomcat/jakarta/mod_jk2 rpms installed. I am looking for tips regarding the configuration, specially with security and virtual hosting practices. regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
my 2 bits. when I tried to replicate the issue LeeAnn saw, it was pretty clearn the JVM can't resize the heap fast enough to account for the large number of webapps being loaded. simply increasing the initial heap should solve the problem. peter On 4/21/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? So let me get this straight, LeeAnn is specifying a maximum heap size of 512MB and a minimum size of 128MB. It looks like the heap doesn't get adjusted up when the servlets are initializing? Thus she needs to increase her minimum heapsize, so something like -Xms512m should fix it? Probably not, since I suspect she's running out of perm gen space. IIRC, the perm gen size is calculated from -Xmx, which is already at 512m. Using the PrintGCDetails will tell us for sure. If that shows perm gen space to be exhausted, then adjusting -XX:MaxPermSize should fix it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with servlets
Oh man... I can't believe... Why the hell those java language developers do that with us? There is no need of this... It's sad and painful develop something in JAVA Regards... 2005/4/21, Molden, Robert (GE Infrastructure) [EMAIL PROTECTED]: public class Auth extends HttpServlet -Original Message- From: Adriano Monteiro [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:31 AM To: tomcat-user@jakarta.apache.org Subject: Problems with servlets Hi guys... I was trying to run an application, and I've got the following message: 21/04/2005 10:06:33 org.apache.catalina.core.ApplicationContext log INFO: Marking servlet Auth as unavailable 21/04/2005 10:06:33 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet Auth java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class Auth with modifiers at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.Class.newInstance0(Class.java:344) at java.lang.Class.newInstance(Class.java:303) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) 21/04/2005 10:08:45 org.apache.catalina.core.StandardWrapperValve invoke INFO: Servlet Auth is currently unavailable What could be the problem? The Auth servlet is just a simple test that I'm making, here is its source code: import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; class Auth extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String username = req.getParameter (username); String password = req.getParameter (password); PrintStream browser = new PrintStream (res.getOutputStream()); browser.println (html); browser.println (headtitleOk.../title/head); browser.println (bodyUSerName: + username + brPassword: + password + br/body/html); } } Regards, -- Adriano Monteiro Marques www.gopython.com.br [EMAIL PROTECTED] I'm FREE... Are you? (PYTHON powered) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Adriano Monteiro Marques www.gopython.com.br [EMAIL PROTECTED] I'm FREE... Are you? (PYTHON powered) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
Peter Lin reproduced and fixed the problem LeeAnn is seeing, and said If I set my heap to -Xms256m -Xmx512m I'm able to load the 18 webapps just fine. the total memory used after all the webapps are loaded is 152Megs. He didn't mention anything about adjusting the perm gen space. -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:19 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? So let me get this straight, LeeAnn is specifying a maximum heap size of 512MB and a minimum size of 128MB. It looks like the heap doesn't get adjusted up when the servlets are initializing? Thus she needs to increase her minimum heapsize, so something like -Xms512m should fix it? Probably not, since I suspect she's running out of perm gen space. IIRC, the perm gen size is calculated from -Xmx, which is already at 512m. Using the PrintGCDetails will tell us for sure. If that shows perm gen space to be exhausted, then adjusting -XX:MaxPermSize should fix it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
for what it's worth, adjusting the perm gen space rarely helps. I did a ton of benchmarks back in 2002 using all sorts of -X combinations and it rarely helped. You have to really know the memory allocation pattern to effectively tune perm gen space. adjusting the new eden may help, but again that requires quite a bit of profiling to really understand how an application is allocating memory. peter On 4/21/05, J. Ryan Earl [EMAIL PROTECTED] wrote: Peter Lin reproduced and fixed the problem LeeAnn is seeing, and said If I set my heap to -Xms256m -Xmx512m I'm able to load the 18 webapps just fine. the total memory used after all the webapps are loaded is 152Megs. He didn't mention anything about adjusting the perm gen space. -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:19 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? So let me get this straight, LeeAnn is specifying a maximum heap size of 512MB and a minimum size of 128MB. It looks like the heap doesn't get adjusted up when the servlets are initializing? Thus she needs to increase her minimum heapsize, so something like -Xms512m should fix it? Probably not, since I suspect she's running out of perm gen space. IIRC, the perm gen size is calculated from -Xmx, which is already at 512m. Using the PrintGCDetails will tell us for sure. If that shows perm gen space to be exhausted, then adjusting -XX:MaxPermSize should fix it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? Peter Lin reproduced and fixed the problem LeeAnn is seeing, and said If I set my heap to -Xms256m -Xmx512m I'm able to load the 18 webapps just fine. the total memory used after all the webapps are loaded is 152Megs. He didn't mention anything about adjusting the perm gen space. Nor is he running the same webapps that LeeAnn is using (as far as I know), so that's a bit of an apples and oranges comparison. Also, his conjecture that the JVM couldn't keep up doesn't fit with my understanding of object allocation and GC in a HotSpot JVM. If needed, the JVM simply suspends all the application threads and does a full GC. Again, the -XX:+PrintGCDetails will tell us what's really going on. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
I may not be running the same app LeeAnn is running, but my webapp is fairly heavy and creates several threads per webapp. Even if it's not an apples-to-apples comparison, it's still a worth while trick to try. if it doesn't work, then back to square one :) if it does, then LeeAnn can go back to work. peter On 4/21/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Subject: RE: OutOfMemoryError - 100 thread limit? Peter Lin reproduced and fixed the problem LeeAnn is seeing, and said If I set my heap to -Xms256m -Xmx512m I'm able to load the 18 webapps just fine. the total memory used after all the webapps are loaded is 152Megs. He didn't mention anything about adjusting the perm gen space. Nor is he running the same webapps that LeeAnn is using (as far as I know), so that's a bit of an apples and oranges comparison. Also, his conjecture that the JVM couldn't keep up doesn't fit with my understanding of object allocation and GC in a HotSpot JVM. If needed, the JVM simply suspends all the application threads and does a full GC. Again, the -XX:+PrintGCDetails will tell us what's really going on. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? if it doesn't work, then back to square one :) It would be even better to get some real data with the -XX:+PrintGCDetails, so we can stop speculating... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
authentication
Hi, I'd like to exclude a few actions from authentication. Is there a simple way to do this without having to put those actions in a new namespace. Here is a sample of my web.xml, security-constraint web-resource-collection web-resource-namefoodorigins/web-resource-name url-pattern*.jsp/url-pattern url-pattern*.action/url-pattern /web-resource-collection auth-constraint role-nameFlowers User/role-name role-nameMill User/role-name /auth-constraint /security-constraint - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: localhost Context files and path = /
Doug, Finally, you have solved the problem that has vexed me for days. Thanks. Joe -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 5:20 PM To: Tomcat Users List Subject: Re: localhost Context files and path = / This is not allowed in Tomcat 5.5.x http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Do not declare the path if the path is null or / in the context unless you are doing a static in the server.xml With that in mind think about the fact that there is already a context element in the server.xml This is the context element for the app you are trying to deploy. Modify it to suit your needs. Unlike the others that are declared in the war, the context for the ROOT app is in the server.xml and nowhere else. Doug - Original Message - From: Joe Bautista [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, April 20, 2005 8:02 PM Subject: localhost Context files and path = / Hi all, I've been trying to deploy Sakai 1.5 on my Tomcat 5.5.7. One of the Contexts, sakai-dispatch, is supposed to replace the ROOT Context. My CATALINA_HOME/conf/catalina/localhost/sakai-dispatch.xml file contains the following code: Context path=/ docBase=f:/usr/local/sakai/sakai-dispatch crossContext=true Realm className=org.sakaiproject.dav.DavRealm / /Context When I move this code into my CATALINA_HOME/conf/server.xml file, Sakai works. At first I thought sakai-dispatch.xml is not being read, so I added some garbage to sakai-dispatch.xml, but upon running CATALINA_HOME/bin/startup.bat the output window gave me some error messages based on the Digester. My conclusion is this: sakai-dispatch.xml is working, but for some reason it's not letting me set the path to /. Any ideas? Joe Bautista Fuller Seminary Programmer/Analyst - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
I, for one, am awaiting LeeAnn's response with abated breath. =) -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:53 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? if it doesn't work, then back to square one :) It would be even better to get some real data with the -XX:+PrintGCDetails, so we can stop speculating... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat forgets a session attribute when reloading context
Hi 'catters. I am having a small but annoying behavior in Tomcat. Tested on 5.0.28 and 5.5.9. I posted this as bug 34547 but a developer thinks it's not a bug. I use Eclipse 3.02 for development, along the Sysdeo Tomcat Plugin and Freemarker for MVC. My context path is set to be reloadable, and when i am coding, if i make some change to the code, the context gets reloaded by the plugin, and a session attribute gets null'ed. The weirdest thing is that not all of the session attributes are nulled. Just this one we will call user. I will try to explain what happens with pseudocode. When the users log on to my application, this happens: ForumUser user = run_sql_here; ForumUser is a bean with some properties. That query stores: -a user id (int) -a timezone (string) -a language (string) All of the other attributes in the object are not used at this time. session.setAttribute(logged_user_name,username); session.setAttribute(permission,permissions); if (user!=null) { session.setAttribute(userpreferences,user); } This is the ONLY time that attribute gets set. It ONLY gets removed when the session is invalidated. When i change code and the context gets reloaded, the user attribute gets null, and the other 2 attributes (permission and logged_user_name) are OK If i don't reload the context, everything is OK. Does anyone have any idea of what is going on? Do you guys need my code? I will gladly do whatever test you need me to do to resolve this. It is very annoying to keep logging out and back in to test new code so my session gets corrected Why this doesn't look like a bug? Tomcat deletes an object in my session. If it would delete all objects, then i wouldn't have posted this, since i would have thought that reloading a context would delete the whole session. I think my code is ok since i just set that attribute (the one that gets null) at login. -- Francisco Javier León Arosemena X Semestre de Lic. en Computación Maracaibo, Edo. Zulia, Venezuela - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
Good Morning everyone :) Apparently I'm one of the few on the west coast - sorry for the delay this morning. I added the PrintGCDetails line to my CATALINA_OPTS and got a bit more information - although I'm afraid I'm not sure if this is the information Chuck was looking for? My catalina.out file showed the following lines just before tomcat tipped over at 17 sites: Attempting to Open Log File: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site17/WEB-INF/logs/EVJ.log Successfully finished init in SesameServlet. [Full GC [Tenured: 43103K-45066K(116544K), 0.6647620 secs] 55017K-45066K(129792K), 0.6648170 secs] [GC [DefNew: 11826K-1236K(13248K), 0.0184770 secs] 56893K-46303K(129792K), 0.0185260 secs] Start Init Method. The CONFIG_FILE from web.xml is : WEB-INF/configuration/Configuration.properties Using Configuration FILE: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site18/WEB-INF/configuration/Configuration.properties Successfully created a SesameConfig object from FILE: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site18/WEB-INF/configuration/Configuration.properties SesameProjectDir: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site18/WEB-INF Attempting to Open Log File: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site18/WEB-INF/logs/EVJ.log Successfully finished init in SesameServlet. [GC [DefNew: 13076K-686K(13248K), 0.0199470 secs] 58143K-46974K(129792K), 0.0199950 secs] [GC [DefNew: 12523K-1408K(13248K), 0.0300140 secs] 58810K-48267K(129792K), 0.0300740 secs] [Full GC [Tenured: 46859K-48385K(116544K), 0.6326870 secs] 50745K-48385K(129792K), 0.6327540 secs] [Full GC [Tenured: 48385K-47888K(116544K), 0.7671290 secs] 48385K-47888K(129792K), 0.7671810 secs] [Full GC [Tenured: 47888K-47924K(116544K), 0.6296020 secs] 48999K-47924K(129792K), 0.6296660 secs] [Full GC [Tenured: 47924K-47930K(116544K), 0.6508840 secs] 47939K-47930K(129792K), 0.6509620 secs] [Full GC [Tenured: 47930K-47930K(116544K), 0.6475860 secs] 47931K-47930K(129792K), 0.6476490 secs] [Full GC [Tenured: 47930K-47912K(116544K), 0.7901650 secs] 47932K-47912K(129792K), 0.7902320 secs] I will try increasing the Xms parameter now, although I believe we did try that earlier in the debugging process. More in a bit. At 08:25 AM 4/21/2005, you wrote: I, for one, am awaiting LeeAnn's response with abated breath. =) -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:53 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? if it doesn't work, then back to square one :) It would be even better to get some real data with the -XX:+PrintGCDetails, so we can stop speculating... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
Ok, this time I used -Xms512m -Xmx512m with the same results - Successfully created a SesameConfig object from FILE: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site19/WEB-INF/configuration/Configuration.properties SesameProjectDir: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site19/WEB-INF [Full GC [Tenured: 45429K-48110K(466048K), 0.6853640 secs] 80819K-48110K(518464K), 0.6854250 secs] [Full GC [Tenured: 48110K-47709K(466048K), 0.7746580 secs] 48119K-47709K(518464K), 0.7747100 secs] Right on the 18th site spin-up - I'm not getting OutOfMemory errors in the catalina.out trace, but the servlet didn't load and gave me an error in the browser: pe Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet ExtraView threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:536) root cause java.lang.OutOfMemoryError note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs. At 08:25 AM 4/21/2005, you wrote: I, for one, am awaiting LeeAnn's response with abated breath. =) -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:53 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? if it doesn't work, then back to square one :) It would be even better to get some real data with the -XX:+PrintGCDetails, so we can stop speculating... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115
Re: OutOfMemoryError - 100 thread limit?
wow, your webapp must be pretty heavy and have lots of jar and/or classes. The behavior that I saw was that 16 of the webapps would load with the default JVM heap settings. When I went to Tomcat's manager page, and click start, I got a similar OOME and the webapp would not start. At that point, there was nothing I could do to get it to start. once I shut down tomcat, change the heap and restart, tomcat was able to load all the webapps. Here's a trick that might help. Start tomcat, but with only 10 copies of your webapp. look at the total memory used and substract 64meg. Divide that number by 10 and see what the memory requirements are for each webapp. (Total mem - 64mb ) / number of webapps = mem per webapp. once you have that, you can figure what you really need. if the total for 18 webapps is less than 512Mb, it means something else is happening, which means you can rule out Tomcat as the cause. Since all tomcat does is start the webapp and call the servletContextListeners, it really isn't doing much. hope that helps peter On 4/21/05, LeeAnn Pultz [EMAIL PROTECTED] wrote: Ok, this time I used -Xms512m -Xmx512m with the same results - Successfully created a SesameConfig object from FILE: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site19/WEB-INF/configuration/Configuration.properties SesameProjectDir: /usr/local/extraview/stage2/jakarta-tomcat-5.0.28/webapps/site19/WEB-INF [Full GC [Tenured: 45429K-48110K(466048K), 0.6853640 secs] 80819K-48110K(518464K), 0.6854250 secs] [Full GC [Tenured: 48110K-47709K(466048K), 0.7746580 secs] 48119K-47709K(518464K), 0.7747100 secs] Right on the 18th site spin-up - I'm not getting OutOfMemory errors in the catalina.out trace, but the servlet didn't load and gave me an error in the browser: pe Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet ExtraView threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:536) root cause java.lang.OutOfMemoryError note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs. At 08:25 AM 4/21/2005, you wrote: I, for one, am awaiting LeeAnn's response with abated breath. =) -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:53 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? if it doesn't work, then back to square one :) It would be even better to get some real data with the -XX:+PrintGCDetails, so we can stop speculating... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat forgets a session attribute when reloading context
It's possible that your User object is not serializing correctly. As I understand things: when contexts are reloaded, the sessions are serialized first, the context reloads, and the sessions are restored from their serialized form. If one of your attributes doesn't make it through this process, then the Session itself is not invalidated; you just don't get that particular attribute back. I've seen this happen on my own web-app. -Original Message- From: Francisco J. León [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 9:51 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat forgets a session attribute when reloading context Hi 'catters. I am having a small but annoying behavior in Tomcat. Tested on 5.0.28 and 5.5.9. I posted this as bug 34547 but a developer thinks it's not a bug. I use Eclipse 3.02 for development, along the Sysdeo Tomcat Plugin and Freemarker for MVC. My context path is set to be reloadable, and when i am coding, if i make some change to the code, the context gets reloaded by the plugin, and a session attribute gets null'ed. The weirdest thing is that not all of the session attributes are nulled. Just this one we will call user. I will try to explain what happens with pseudocode. When the users log on to my application, this happens: ForumUser user = run_sql_here; ForumUser is a bean with some properties. That query stores: -a user id (int) -a timezone (string) -a language (string) All of the other attributes in the object are not used at this time. session.setAttribute(logged_user_name,username); session.setAttribute(permission,permissions); if (user!=null) { session.setAttribute(userpreferences,user); } This is the ONLY time that attribute gets set. It ONLY gets removed when the session is invalidated. When i change code and the context gets reloaded, the user attribute gets null, and the other 2 attributes (permission and logged_user_name) are OK If i don't reload the context, everything is OK. Does anyone have any idea of what is going on? Do you guys need my code? I will gladly do whatever test you need me to do to resolve this. It is very annoying to keep logging out and back in to test new code so my session gets corrected Why this doesn't look like a bug? Tomcat deletes an object in my session. If it would delete all objects, then i wouldn't have posted this, since i would have thought that reloading a context would delete the whole session. I think my code is ok since i just set that attribute (the one that gets null) at login. -- Francisco Javier León Arosemena X Semestre de Lic. en Computación Maracaibo, Edo. Zulia, Venezuela - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
silly question, does this webapp have like thousands of JSP and servlets and preload the JSP's? peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBCRealm Configuration
I got the Exception when starting tomcat. What's wrong with it? Peiyun --- Realm className=org.apache.catalina.realm.JDBCRealm driverName=oracle.jdbc.driver.OracleDriver connectionURL=jdbc:oracle:thin:@111.111.111.111:1521:x connectionName=X connectionPassword=XX userTable=X_USERS userNameCol=ID userCredCol=PASSWORD userRoleTable=X_USER_ROLES roleNameCol=ROLE debug=99 / Exception opening database connection java.sql.SQLException: oracle.jdbc.driver.OracleDriver at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:589) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:663) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4248) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488) at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:800) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608) at java.lang.Thread.run(Thread.java:534) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Consecutive threads
Tomcat running stand-alone pretty much out-of-the box. I have a servlet which initially presents a form to users. When the form is submitted it runs one of a number of possible queries on an Oracle database. Some queries return immediately while others take up to 20 minutes to run. The servlet itself does nothing very time-consuming an so consequently spends most of its time waiting for executeQuery to return. If I run a long query, followed by a series of short queries ( different browsers/pcs ) then the latter all wait for the long query to return rather than completing first as I expected. Why are the threads apparently processed consecutively and where do I need to look to change this behaviour? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBCRealm Configuration
Put your classes.zip in tomcat\common\lib Regards Guru -Original Message- From: Jiang, Peiyun [mailto:[EMAIL PROTECTED] Sent: 21 April 2005 17:16 To: 'Tomcat Users List' Subject: JDBCRealm Configuration I got the Exception when starting tomcat. What's wrong with it? Peiyun --- Realm className=org.apache.catalina.realm.JDBCRealm driverName=oracle.jdbc.driver.OracleDriver connectionURL=jdbc:oracle:thin:@111.111.111.111:1521:x connectionName=X connectionPassword=XX userTable=X_USERS userNameCol=ID userCredCol=PASSWORD userRoleTable=X_USER_ROLES roleNameCol=ROLE debug=99 / Exception opening database connection java.sql.SQLException: oracle.jdbc.driver.OracleDriver at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:589) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:663) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4248) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8 23) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer. java:903) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:7 6) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc her.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j ava:488) at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483 ) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.j ava:800) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:119) at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:80 0) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processC hildren(ContainerBase.java:1619) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processC hildren(ContainerBase.java:1628) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(Cont ainerBase.java:1608) at java.lang.Thread.run(Thread.java:534) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
Not a silly question :) We have 1 servlet that is the main entry point, everything else is done with standard java classes. We have no jsp's. At 09:13 AM 4/21/2005, you wrote: silly question, does this webapp have like thousands of JSP and servlets and preload the JSP's? peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
Possible success! I went back to my weblogic installation which I was successfully able to open up 25 sites to see what it was doing when starting up. It had -XX:MaxPermSize=128m in the process description. I added that to my catalina_opts and I got past the 18 site limitation of just firing them up. Can anyone give me any information on what this does? Is this the perm gen that Chuck mentioned before? Are there any caveats to setting this memory option? thanks! LeeAnn At 09:13 AM 4/21/2005, you wrote: silly question, does this webapp have like thousands of JSP and servlets and preload the JSP's? peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FileUpload
Hi, I am trying to use FileUpload but i keep getting an Access denided error when i try to write things and i was wondering is there anyway around it...here is the error Http Satus 404 - C:\AtrowkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemans (Access is denied) type Status report message C:\ArtworkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemand (Access is denied) description The requested resource (C:\ArtworkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemand (Access is denied)) is not available. Any suggestions woudl be greatly appreciated Andrew Paliga Junior Project Manager IBM Toronto Media Design Studio Phone: (905) 413-2024
Re: OutOfMemoryError - 100 thread limit?
glad I was wrong and you found a solution. http://java.sun.com/docs/hotspot/VMOptions.html I'm just guessing here, but by forcing the maxPermSize to 128, it leaves more space for the eden and prevents classes from getting promoted to perm. Atleast that's logical explanation I can think of. Another way to get the heap to resize in larger increments and prevent it from getting smaller is to set the -XX:MinHeapFreeRatio. peter lin On 4/21/05, LeeAnn Pultz [EMAIL PROTECTED] wrote: Possible success! I went back to my weblogic installation which I was successfully able to open up 25 sites to see what it was doing when starting up. It had -XX:MaxPermSize=128m in the process description. I added that to my catalina_opts and I got past the 18 site limitation of just firing them up. Can anyone give me any information on what this does? Is this the perm gen that Chuck mentioned before? Are there any caveats to setting this memory option? thanks! LeeAnn At 09:13 AM 4/21/2005, you wrote: silly question, does this webapp have like thousands of JSP and servlets and preload the JSP's? peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Consecutive threads
On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If I run a long query, followed by a series of short queries ( different browsers/pcs ) then the latter all wait for the long query to return rather than completing first as I expected. A quick guess would be that your first query starts a transaction and locks some DB-resources, and the following queries have to wait for them to become unlocked. --- Cheers, Kenneth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reloading a host from the IP address manager
Hello there. I have Tomcat setup with a few different Hosts. Each webapp needs a new URL so it gets its own Host entry. Not weird. But what gets difficult is that I cannot reload each of these Hosts. http://12.34.56.78/manager/reload?path=/myapp That works if I have: tomcat-home/webapps/myapp/ But not if I have: tomcat-home/webapps/myapp/ROOT/ I have to go to: http://www.myapp.com/manager/reload?path=/ But I don't want to have the manager app accessible on my live apps. Also, my production servers are load balanced, so I have to reload two to four servers if I do this. Also, for each Host that I create, I have to then make sure that the tomcat-home/conf/Catalina/www.myapp.com/ folder has a manager.xml in it. This gets to be a headache when you have 8 apps on the machine. Is there a better way to do this? How does everyone else reload apps when they deploy new content? (I am deploying a few files each time, not a new .war file.) Thanks a lot. Charlie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
This is a really interesting and confusing problem... Can you tell how much memory the OS is actually committing to Java? ie Check the resident stable set (RSS) = how much of the virtual memory space has been physically commited to memory. # ps axl|grep java 0 501 2623 1 21 0 1264252 79112 - Sl ? 0:09 /usr/java/jre1.5.0_02/bin/java -Xmx1000m The above says I have 1264252KB allocated but only 79112KB committed to physical memory. I'm curious what yours looks like. I know the the JVM reported it was using less memory, but I'd be curious to see what the OS thinks. Maybe even try raising your maximum heap size to say 1024MB? Which JVM are you using again? Which other JVMs have you tried? -ryan PS I just checked a production instance, and it looks like: $ ps axl|grep java 0 101 24243 1 16 0 2275516 906312 322497 Sl ?465:48 /opt/sun-jdk-1.4.2.07/bin/java ~900MB of over 2GB of virtual memory commited, it's apparently got quite a few threads running: $ ps ax -L |grep java|wc -l 2016 How does your application compare when it runs out of memory? -Original Message- From: LeeAnn Pultz [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 11:21 AM To: Tomcat Users List Subject: Re: OutOfMemoryError - 100 thread limit? Not a silly question :) We have 1 servlet that is the main entry point, everything else is done with standard java classes. We have no jsp's. At 09:13 AM 4/21/2005, you wrote: silly question, does this webapp have like thousands of JSP and servlets and preload the JSP's? peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: LeeAnn Pultz [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? It had -XX:MaxPermSize=128m in the process description. Ahah, as they say. Can anyone give me any information on what this does? Is this the perm gen that Chuck mentioned before? Yes, this controls the size of the permanent generation. The permanent generation portion of the heap is where class objects (instances of java.lang.Class) are allocated. If you have a lot of classes - which app servers frequently do - the size of this space needs to be increased. A quick scan of the 1.4.2 HotSpot source shows the default value to be 64m. Are there any caveats to setting this memory option? Other than it subtracts from the total heap space for normal object, no. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple services in single Tomcat instance
Thanks for the response. However, it still didn't work. I assume the changes you made were to remove the leading / from the docBase. I am guessing the problem is that my Host elements have the same name, and the second one is overriding the first. Unfortunately, it looks like the Host elements need to have the same name as I think the name must represent a name that the local DNS recognizes. At this point, we are just going to live with a single Service that uses both ports. The reason for trying this in the first place was that we wanted to use our firewall to allow one port to be accessible from the outside that would see our public applications, while the second port would be accessible only within our company. This port would allow access to some internal applications. We are using Tomcat security to password-protect the access anyway, but we were hoping have the additional security of not allowing any traffic from the outside at all. (By the way, I think we could accomplish what we want with 2 Tomcat installations, but there are other reasons why that is not desirable.) -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 2:12 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance Try this Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 16:58 To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance We are using all of the following URL formats to access Tomcat. There is a singe IP address on the machine, and a single domain name registered for the IP address. http://localhost:6000/app6000 http://localhost:7000/app7000 http://machinename.hostname.com:6000/app6000 http://machinename.hostname.com:7000/app7000 -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:56 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance How are you accessing tomcat ? http://localhost:7000/ http://localhost:6000/ ??? -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 15:34 To: tomcat-user@jakarta.apache.org Subject: Multiple services in single Tomcat instance We would like to have a single Tomcat instance running as a web server that allows requests received on one port to go to one context and requests on another port to go to a second context. Is there a way to do this? We tried putting the following in our server.xml, but requests meant for the first service (port 6000) were recieved by the second service (port 7000). Thank you for any help. Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app7000 path=/app7000 reloadable=false/ /Host /Engine /Service - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FileUpload
Check your catalina.policy file or access rights to the user that the Tomcat apps are running under. Robert S. Harper 801.265.8800 ext. 255 [EMAIL PROTECTED] -Original Message- From: Andrew Paliga [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 10:38 AM To: tomcat-user@jakarta.apache.org Subject: FileUpload Hi, I am trying to use FileUpload but i keep getting an Access denided error when i try to write things and i was wondering is there anyway around it...here is the error Http Satus 404 - C:\AtrowkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemans (Access is denied) type Status report message C:\ArtworkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemand (Access is denied) description The requested resource (C:\ArtworkOnDemand\jakarta-tomcat-4.1.24\webapps\artworkondemand (Access is denied)) is not available. Any suggestions woudl be greatly appreciated Andrew Paliga Junior Project Manager IBM Toronto Media Design Studio Phone: (905) 413-2024 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
Awesome, I'm glad that was solved as I'm about to do the same thing with our application: running multiple instances of the application on a single tomcat instance housing many virtual hosts. Thanks for the http://java.sun.com/docs/hotspot/VMOptions.html link Peter. -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 11:52 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: LeeAnn Pultz [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? It had -XX:MaxPermSize=128m in the process description. Ahah, as they say. Can anyone give me any information on what this does? Is this the perm gen that Chuck mentioned before? Yes, this controls the size of the permanent generation. The permanent generation portion of the heap is where class objects (instances of java.lang.Class) are allocated. If you have a lot of classes - which app servers frequently do - the size of this space needs to be increased. A quick scan of the 1.4.2 HotSpot source shows the default value to be 64m. Are there any caveats to setting this memory option? Other than it subtracts from the total heap space for normal object, no. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? I'm just guessing here, but by forcing the maxPermSize to 128, it leaves more space for the eden and prevents classes from getting promoted to perm. I think you're confusing tenured with perm. Nothing is ever promoted to perm - only known long-lived objects (primarily instances of java.lang.Class) are allocated in there, and no objects ever migrate to or from perm space. Regular objects are normally allocated in eden space (young gen), and if they live long enough, are migrated to the tenured area (old gen) during a GC. Increasing the perm size actually reduces, not increases, the amount of eden space available since the total of all three generations (young, old, perm) must come from the -Xmx setting. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple services in single Tomcat instance
Try changing your Engine names to match your Service names. It will create separate directories underneath tomcat-home/conf/ Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=RequestsFromPort6000 Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=RequestsFromPort7000 Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service Each Engine gets its own directory for storing the app7000.xml files. You should see this: tomcat-home/conf/RequestsFromPort6000/localhost/app6000.xml tomcat-home/conf/RequestsFromPort7000/localhost/app7000.xml But you might be right. Because they are both called localhost your requests might get mixed up. Give it one last try though before you have to have two instances of Tomcat running. Charlie Gary Hirschhorn said the following on 4/21/2005 12:53 PM: Thanks for the response. However, it still didn't work. I assume the changes you made were to remove the leading / from the docBase. I am guessing the problem is that my Host elements have the same name, and the second one is overriding the first. Unfortunately, it looks like the Host elements need to have the same name as I think the name must represent a name that the local DNS recognizes. At this point, we are just going to live with a single Service that uses both ports. The reason for trying this in the first place was that we wanted to use our firewall to allow one port to be accessible from the outside that would see our public applications, while the second port would be accessible only within our company. This port would allow access to some internal applications. We are using Tomcat security to password-protect the access anyway, but we were hoping have the additional security of not allowing any traffic from the outside at all. (By the way, I think we could accomplish what we want with 2 Tomcat installations, but there are other reasons why that is not desirable.) -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 2:12 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance Try this Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 16:58 To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance We are using all of the following URL formats to access Tomcat. There is a singe IP address on the machine, and a single domain name registered for the IP address. http://localhost:6000/app6000 http://localhost:7000/app7000 http://machinename.hostname.com:6000/app6000 http://machinename.hostname.com:7000/app7000 -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:56 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance How are you accessing tomcat ? http://localhost:7000/ http://localhost:6000/ ??? -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 15:34 To: tomcat-user@jakarta.apache.org Subject: Multiple services in single Tomcat instance We would like to have a single Tomcat instance running as a web server that allows requests received on one port to go to one context and requests on another port to go to a second context. Is there a way to do this? We tried putting the following in our server.xml, but requests meant for the first service (port 6000) were recieved by the second service (port 7000). Thank you for any help. Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app6000 path=/app6000 reloadable=false/ /Host /Engine
Re: OutOfMemoryError - 100 thread limit?
glad I can help. it's the little odd edge case problems that I find most interesting. it was fun to figure why that behavior was occuring. peter On 4/21/05, J. Ryan Earl [EMAIL PROTECTED] wrote: Awesome, I'm glad that was solved as I'm about to do the same thing with our application: running multiple instances of the application on a single tomcat instance housing many virtual hosts. Thanks for the http://java.sun.com/docs/hotspot/VMOptions.html link Peter. -ryan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 11:52 AM To: Tomcat Users List Subject: RE: OutOfMemoryError - 100 thread limit? From: LeeAnn Pultz [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? It had -XX:MaxPermSize=128m in the process description. Ahah, as they say. Can anyone give me any information on what this does? Is this the perm gen that Chuck mentioned before? Yes, this controls the size of the permanent generation. The permanent generation portion of the heap is where class objects (instances of java.lang.Class) are allocated. If you have a lot of classes - which app servers frequently do - the size of this space needs to be increased. A quick scan of the 1.4.2 HotSpot source shows the default value to be 64m. Are there any caveats to setting this memory option? Other than it subtracts from the total heap space for normal object, no. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
yup you're right, silly me. ignore my brain dead remark. as long as the problem gets solved, I don't mind looking stupid. so it would appear by setting the PermSize, the jvm is pushing all java.lang.Class instances to Perm rather than loading them in eden and then promoting them to tenured. If you run verbosegc again, the gc interval should be longer than previous settings. I can't think of any real trade-offs of setting Perm to 128 other than using more RAM. If I remember correctly Perm is also where static stuff goes. peter On 4/21/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? I'm just guessing here, but by forcing the maxPermSize to 128, it leaves more space for the eden and prevents classes from getting promoted to perm. I think you're confusing tenured with perm. Nothing is ever promoted to perm - only known long-lived objects (primarily instances of java.lang.Class) are allocated in there, and no objects ever migrate to or from perm space. Regular objects are normally allocated in eden space (young gen), and if they live long enough, are migrated to the tenured area (old gen) during a GC. Increasing the perm size actually reduces, not increases, the amount of eden space available since the total of all three generations (young, old, perm) must come from the -Xmx setting. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
Thanks everyone! I really appreciate all your ideas and input and experience! I still am not completely clear on eden, gen, etc - obviously I need to go research how memory allocation is done in java. But, after setting the maxPermSize, I was able to log in and do work on 18 sites which is more than I could do before :) We will be scheduling some load testing next week to see if 128 is the right number for our real life problem, but at least I can see the light at the end of the tunnel now! thank you all again for all your help! At 10:35 AM 4/21/2005, you wrote: yup you're right, silly me. ignore my brain dead remark. as long as the problem gets solved, I don't mind looking stupid. so it would appear by setting the PermSize, the jvm is pushing all java.lang.Class instances to Perm rather than loading them in eden and then promoting them to tenured. If you run verbosegc again, the gc interval should be longer than previous settings. I can't think of any real trade-offs of setting Perm to 128 other than using more RAM. If I remember correctly Perm is also where static stuff goes. peter On 4/21/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? I'm just guessing here, but by forcing the maxPermSize to 128, it leaves more space for the eden and prevents classes from getting promoted to perm. I think you're confusing tenured with perm. Nothing is ever promoted to perm - only known long-lived objects (primarily instances of java.lang.Class) are allocated in there, and no objects ever migrate to or from perm space. Regular objects are normally allocated in eden space (young gen), and if they live long enough, are migrated to the tenured area (old gen) during a GC. Increasing the perm size actually reduces, not increases, the amount of eden space available since the total of all three generations (young, old, perm) must come from the -Xmx setting. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LeeAnn Pultz ExtraView Corporation [EMAIL PROTECTED] 831-461-7100 x115 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: digester understanding again...
Depends how you designed your classes that the XML is digested into ;-) If you're looking for specific kinds of queries, then the class(es) should be geared to supporting those [aggregation, composition and keying constructs associated with the semantics of the data need to be reflected in the digested output]. If you don't do that, you might as well use a DOMParser and XPath / XQuery. -Rahul On 4/21/05, Henrique, Manuel [EMAIL PROTECTED] wrote: Hello all, Here I come again with my digester :)) So, I have my xml file, I have created my digester and all the needed classes for my xml tags, and do a digester.parse(). Still here all is ok. I start Tomcat 5.0 and look to the log file. All seems ok, my xml file is consumed, all the classes are instancied etc...etc... My question: If I have an xml file like this computer brand name=compcool modelfaster_than_all/model serialnumber1248965serialnumber /brand brand name=pcassociated modelvery_expensive/model serialnumber34564serialnumber /brand brand name=pcassociated modelexpensive_too/model serialnumber99serialnumber /brand /computer how can I get after in my Java code the serial number of the model expen sive_too for example??? How can I be sure to get the good data as I have two identical brand names? Thank you for your help. Regards, Manuel ps: I know that for someones the question seems to be very basic but remember when you were beginner and be kind to me This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat in a clustered Enviroment
Hello, Does tomcat just not bind to virtual interfaces, or other IP addresses in general? If anybody has any suggestions on this issue it would be very helpful, since i cant seem to get this cluster up and running. Thank you, Josef Whiter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Manager app for embedded tomcat?
Hi, The normal tomcat has a manager app that lets you go to a particular URL (e.g. server:8080/manager/) to restart/reload tomcat. This was very convenient for me b/c it allowed me to automate restarting tomcat...I could just issue a wget to the restart URL everytime I updated java class files. Restarting tomcat through the manager was also quicker than a full restart. Now I'm using embedded tomcat and I want to do the same thing. Is there a manager app for embedded tomcat? If so, does anyone have tips for configuring it? I couldn't find anything relevant on: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html Any help is appreciated. Thanks! -Ted - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple services in single Tomcat instance
Do you not have to specify the className in the service? className=org.apache.coyote.tomcat4.CoyoteConnector? Darryl --- Gary Hirschhorn [EMAIL PROTECTED] wrote: Thanks for the response. However, it still didn't work. I assume the changes you made were to remove the leading / from the docBase. I am guessing the problem is that my Host elements have the same name, and the second one is overriding the first. Unfortunately, it looks like the Host elements need to have the same name as I think the name must represent a name that the local DNS recognizes. At this point, we are just going to live with a single Service that uses both ports. The reason for trying this in the first place was that we wanted to use our firewall to allow one port to be accessible from the outside that would see our public applications, while the second port would be accessible only within our company. This port would allow access to some internal applications. We are using Tomcat security to password-protect the access anyway, but we were hoping have the additional security of not allowing any traffic from the outside at all. (By the way, I think we could accomplish what we want with 2 Tomcat installations, but there are other reasons why that is not desirable.) -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 2:12 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance Try this Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 16:58 To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance We are using all of the following URL formats to access Tomcat. There is a singe IP address on the machine, and a single domain name registered for the IP address. http://localhost:6000/app6000 http://localhost:7000/app7000 http://machinename.hostname.com:6000/app6000 http://machinename.hostname.com:7000/app7000 -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:56 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance How are you accessing tomcat ? http://localhost:7000/ http://localhost:6000/ ??? -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 15:34 To: tomcat-user@jakarta.apache.org Subject: Multiple services in single Tomcat instance We would like to have a single Tomcat instance running as a web server that allows requests received on one port to go to one context and requests on another port to go to a second context. Is there a way to do this? We tried putting the following in our server.xml, but requests meant for the first service (port 6000) were recieved by the second service (port 7000). Thank you for any help. Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app7000 path=/app7000 reloadable=false/ /Host /Engine /Service - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? so it would appear by setting the PermSize, the jvm is pushing all java.lang.Class instances to Perm rather than loading them in eden and then promoting them to tenured. Instances of java.lang.Class are always allocated in the perm gen, never in an eden space, regardless of any heap or gen size settings. I can't think of any real trade-offs of setting Perm to 128 other than using more RAM. Unless you increase -Xmx correspondingly, enlarging perm space will reduce the amount available for regular objects. Generally, if you have the memory, increase -Xmx to whatever you can before swapping starts. If I remember correctly Perm is also where static stuff goes. I believe that's true, since static data is associated with java.lang.Class instances. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError - 100 thread limit?
On 4/21/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? so it would appear by setting the PermSize, the jvm is pushing all java.lang.Class instances to Perm rather than loading them in eden and then promoting them to tenured. Instances of java.lang.Class are always allocated in the perm gen, never in an eden space, regardless of any heap or gen size settings. logically, it makes sense that all java.lang.Class classes are loaded in Perm. But the result on the behavior LeeAnn saw is a bit perplexing. I'm just exploring here, so if it doesn't make sense, it's cuz I'm making wild guesses. ie, talking out of my rear. the default Perm is 64M. If LeeAnn's webapp have a large number of classes, maybe there's too many; therefore forcing the VM to resize the perm. Doing that, the VM probably is allocating a big block and copying all the data over. I believe that is much heavier task than an incremental GC and probably equally costly as a full GC. So once the new Perm is ready, the VM should make the old block available. So the end result of setting -XX:MaxPermSize is it avoid resizing Perm, which allows Tomcat to load the webapps quickly. Even though setting max Perm to 128 reduces the overall space for new/old generation, it results in better performance because the VM doesn't have to move perm? of course this is assuming the VM prefers to have a continuous block for Perm memory. I believe that's true, since static data is associated with java.lang.Class instances. - Chuck peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError - 100 thread limit?
From: Peter Lin [mailto:[EMAIL PROTECTED] Subject: Re: OutOfMemoryError - 100 thread limit? the default Perm is 64M. If LeeAnn's webapp have a large number of classes, maybe there's too many; therefore forcing the VM to resize the perm. IIRC (haven't looked at core HotSpot code in detail since 1.4.1 days), the virtual address boundary between perm and the other generations is fixed at JVM initialization and never moves. The perm gen does go through GC just like the other gens, but no memory ever moves between the perm and any other space, and the perm gen maximum virtual address range never changes. The HotSpot JVM allocates, but does not commit, all of the -Xmx space at startup in one contiguous block (although there were rumors of that changing in later JVMs). Only the -Xms portion is committed, split up into three regions - young, old, and perm. When a region fills and GC doesn't reduce the usage significantly, additional pages are committed in whichever region needs expanding. I think what was happening is that LeeAnn simply had more classes than would fit in 64 MB. Nothing to do with threads, just the total number of classes in all the applications added together. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple services in single Tomcat instance
We are using Tomcat 5.0.27, which doesn't require the className attribute. Instead, it determines the class from the protocol. See http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/http.html -Original Message- From: Darryl Wilburn [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 11:31 AM To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance Do you not have to specify the className in the service? className=org.apache.coyote.tomcat4.CoyoteConnector? Darryl --- Gary Hirschhorn [EMAIL PROTECTED] wrote: Thanks for the response. However, it still didn't work. I assume the changes you made were to remove the leading / from the docBase. I am guessing the problem is that my Host elements have the same name, and the second one is overriding the first. Unfortunately, it looks like the Host elements need to have the same name as I think the name must represent a name that the local DNS recognizes. At this point, we are just going to live with a single Service that uses both ports. The reason for trying this in the first place was that we wanted to use our firewall to allow one port to be accessible from the outside that would see our public applications, while the second port would be accessible only within our company. This port would allow access to some internal applications. We are using Tomcat security to password-protect the access anyway, but we were hoping have the additional security of not allowing any traffic from the outside at all. (By the way, I think we could accomplish what we want with 2 Tomcat installations, but there are other reasons why that is not desirable.) -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 2:12 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance Try this Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 16:58 To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance We are using all of the following URL formats to access Tomcat. There is a singe IP address on the machine, and a single domain name registered for the IP address. http://localhost:6000/app6000 http://localhost:7000/app7000 http://machinename.hostname.com:6000/app6000 http://machinename.hostname.com:7000/app7000 -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:56 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance How are you accessing tomcat ? http://localhost:7000/ http://localhost:6000/ ??? -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 15:34 To: tomcat-user@jakarta.apache.org Subject: Multiple services in single Tomcat instance We would like to have a single Tomcat instance running as a web server that allows requests received on one port to go to one context and requests on another port to go to a second context. Is there a way to do this? We tried putting the following in our server.xml, but requests meant for the first service (port 6000) were recieved by the second service (port 7000). Thank you for any help. Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:/projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=/app7000 path=/app7000 reloadable=false/ /Host /Engine /Service - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple services in single Tomcat instance
Thank you very much. That did the trick. -Original Message- From: Charles Harvey III [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 10:08 AM To: Tomcat Users List Subject: Re: Multiple services in single Tomcat instance Try changing your Engine names to match your Service names. It will create separate directories underneath tomcat-home/conf/ Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=RequestsFromPort6000 Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=RequestsFromPort7000 Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service Each Engine gets its own directory for storing the app7000.xml files. You should see this: tomcat-home/conf/RequestsFromPort6000/localhost/app6000.xml tomcat-home/conf/RequestsFromPort7000/localhost/app7000.xml But you might be right. Because they are both called localhost your requests might get mixed up. Give it one last try though before you have to have two instances of Tomcat running. Charlie Gary Hirschhorn said the following on 4/21/2005 12:53 PM: Thanks for the response. However, it still didn't work. I assume the changes you made were to remove the leading / from the docBase. I am guessing the problem is that my Host elements have the same name, and the second one is overriding the first. Unfortunately, it looks like the Host elements need to have the same name as I think the name must represent a name that the local DNS recognizes. At this point, we are just going to live with a single Service that uses both ports. The reason for trying this in the first place was that we wanted to use our firewall to allow one port to be accessible from the outside that would see our public applications, while the second port would be accessible only within our company. This port would allow access to some internal applications. We are using Tomcat security to password-protect the access anyway, but we were hoping have the additional security of not allowing any traffic from the outside at all. (By the way, I think we could accomplish what we want with 2 Tomcat installations, but there are other reasons why that is not desirable.) -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 2:12 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance Try this Service name=RequestsFromPort6000 Connector protocol=HTTP/1.1 port=6000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app6000 path=/app6000 reloadable=false/ /Host /Engine /Service Service name=RequestsFromPort7000 Connector protocol=HTTP/1.1 port=7000/ Engine debug=0 defaultHost=localhost name=Standalone Host appBase=c:\projects name=localhost unpackWARs=false autoDeploy=false deployOnStartup=false Context docBase=app7000 path=/app7000 reloadable=false/ /Host /Engine /Service -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 16:58 To: Tomcat Users List Subject: RE: Multiple services in single Tomcat instance We are using all of the following URL formats to access Tomcat. There is a singe IP address on the machine, and a single domain name registered for the IP address. http://localhost:6000/app6000 http://localhost:7000/app7000 http://machinename.hostname.com:6000/app6000 http://machinename.hostname.com:7000/app7000 -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 7:56 AM To: 'Tomcat Users List' Subject: RE: Multiple services in single Tomcat instance How are you accessing tomcat ? http://localhost:7000/ http://localhost:6000/ ??? -Original Message- From: Gary Hirschhorn [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 15:34 To: tomcat-user@jakarta.apache.org Subject: Multiple services in single Tomcat instance We would like to have a single Tomcat instance running as a web server that allows requests received on one port to go to one context and requests on another port to go to a second context. Is there a way to do this? We tried putting the following in our server.xml, but requests meant for the first service (port 6000) were recieved by the second service (port 7000). Thank you for any help. Service name=RequestsFromPort6000
Session attributes disappear between .jsp pages
Hi. I've got an odd problem that I'm hoping that someone can help to diagnose. A new application that we're building is losing attributes of a session between SOME of its pages. This behavior occurs about 85% of the time. Sometimes all of our session will transmit and most times about half of the objects get through. The objects that always come through are strings and some numbers. The bits that occasionally get through are our database connector object, our menu bar class and a couple of other ints. The kicker is that the entire session is created by a java object called from a jsp (login) and it ALWAYS propagates to the next page correctly. The transition between the second and third page, whether it is a redrect or a link causes, the problem. We've reduced the page that this occurs on to something that just enumerates the session and has a link to itself. I'm including the page source at the end of the message. We're running Tomcat 5.0.28 through Apache (Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.6m mod_jk/1.2.6 Server at devlinux.recurrentsoft.com Port 443) on Debian unstable patched two days ago. The other thing that has me chasing my tail is that we have a much more complex system using the same core library with massive sessions and similar objects that work fine on the same system. For those of you who are still reading, (thank you!) the sequence of events is that we start by keying the URI for login.jsp into the browser. We then login to the database, and a session is created and populated. When we finish logging in, the system sends a redirect that brings us to bbs.jsp (below). When we arrive the session has all attributes we expect. Clicking on the middle link at the bottom of the page causes the problem. Any insight that you may be able to offer would _really_ be appreciated. My brain is currently trying to claw its way out of my skull to escape impending madness. -Greg - begin bbs.jsp %@ page buffer=50kb language=java import=com.recurrentsoft.util.*,com.recurrentsoft.biz.*,com.recurrents oft.hbiz.*,com.recurrentsoft.hutil.*,java.util.*,java.io.* % html body % Enumeration en = session.getAttributeNames(); while (en.hasMoreElements()) { String sName = (String)en.nextElement(); % %=sName% = %=session.getAttribute(sName)%br % } session.setAttribute(BeenInBBS,yes); //session.removeAttribute(UserID); //session.removeAttribute(Pass); //session.removeAttribute(SecurityLevel); session.removeAttribute(Intl); //session.removeAttribute(Properties); session.removeAttribute(BizObj); session.removeAttribute(MenuBar); % a href=bbsmaint.jspbbsmaint.jsp/a a href=bbs.jspbbs.jsp/a a href=tempsysadm.jsptempsysadm.jsp/a /body /html --- end bbs.jsp-- Gregory H. Vilardi631-752-2701x240 [EMAIL PROTECTED] Project Manager / Lead Software Engineer Fax: (631)752-3397 Recurrent Software Solutions, Inc. http://www.recurrentsoft.com 1 Huntington Quadrangle, Suite 1C02, Melville, NY 11747 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat forgets a session attribute when reloading context
It's possible that your User object is not serializing correctly. As I understand things: when contexts are reloaded, the sessions are serialized first, the context reloads, and the sessions are restored from their serialized form. If one of your attributes doesn't make it through this process, then the Session itself is not invalidated; you just don't get that particular attribute back. I've seen this happen on my own web-app. Yes, this was indeed the problem. The fact that Strings are serialized, explains why i was having this issue only with one object. I fixed this, thanks for all your answers Francisco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
running multiple tomcat instances as windows service
we are using tomcat 5.0.28 on windows server. I have been trying to install multiple tomcat instances . Our goal is to run multiple instances on port 80 of virtual IPs. But for testing, i'm using differnt port numbers instead of ips.. Here r the steps i performed, (a) installed tomcat on c:\TC1 (b) copied conf,logs,shared,temp,webapps, work folders from c:\TC1 into c:\TC2 (c) changed port entries into TC2\conf\server.xml Server port=8006 , Connector port=8081 (d) on cmd prompt c:\TC1\bin set CATALINA_BASE=C:\TC2 c:\TC1\binservice.bat install TC2 This will install the TC2 windows service, but the service won't start . If i check the properites of the service, it's pointing to C:\TC1\bin\tomcat5.exe //RS//tc2 What is wrong?? I couldn't find any step by step guide to setup multiple instances of tomcat as windows service on Tomcat users list or any other web resource. Any pointers will be appreciated. Thanks, Jaynika - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository
Thanks Chuck for your reply. I still think it is a bug!!! Please try the following: add a jar file (eg, foo/bar.jar) as a class repository in the catalina.properties and then use one of the classes from this jar file in one the servlets - will get a ClassNotFoundException. I've attached ClassLoaderFactoryTest.java and ClassLoaderFactoryWithTheFix.java. Please try to run the test - one of the tests will fail, refer to the place where it fails and read the comments. Kind regards, Alex. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 April 2005 9:27 PM To: Tomcat Users List Subject: RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository From: Akoulov, Alexandre [IT] [mailto:[EMAIL PROTECTED] Subject: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository ClassLoaderFactory#createClassLoader(File unpacked[], File packed[], URL urls[], ClassLoader parent) is the actual method that creates class loaders. The very first argument to this method contains jar files or directories ( that is where the name unpacked comes from ). From what I can tell, it's the _second_ argument that should contain .jar files; the first is for directories only. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -Original Message- From: Akoulov, Alexandre [IT] Sent: Thursday, 21 April 2005 6:29 PM To: tomcat-user@jakarta.apache.org Subject: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository Hi all, I'd greatly appreciate your thoughts on the following issue (and the proposed solution ): When adding a jar file (eg, foo/bar.jar) to the class loader's repository it treats as a directory and therefore it cannot load any classes from this jar. The following explains why it happens. org.apache.catalina.startup.ClassLoaderFactory is responsible for creating class loader instances. Each instance is of org.apache.catalina.loader.StandardClassLoader type, which in its turn extends java.net.URLClassLoader: - public class StandardClassLoader extends URLClassLoader - ClassLoaderFactory#createClassLoader(File unpacked[], File packed[], URL urls[], ClassLoader parent) is the actual method that creates class loaders. The very first argument to this method contains jar files or directories ( that is where the name unpacked comes from ). ClassLoaderFactory#createClassLoader method adds File.separator to the end of the jar file path ( file.getCanonicalPath() + File.separator ) when constructing a URL instance to represent a jar file and then adds a string representation of a newly created URL to its list of repositories ( list.add(url.toString()) ) : - if (unpacked != null) { for (int i = 0; i unpacked.length; i++) { File file = unpacked[i]; if (!file.exists() || !file.canRead()) continue; if (debug = 1) log( Including directory or JAR + file.getAbsolutePath()); URL url = new URL(file, null, file.getCanonicalPath() + File.separator); list.add(url.toString()); } } - For instance, if unpacked argument contains '/home/aa/lib/velocity.jar' then a URL object is 'file:/home/aa/lib/velocity.jar/' - a forward slash / (which is a Unix file separator) has been added to the url. After ClassLoaderFactory#createClassLoader adds all repositories to its repository list it converts this list to array and constructs StandardClassLoader with it: - String array[] = (String[]) list.toArray(new String[list.size()]); StandardClassLoader classLoader = null; if (parent == null) classLoader = new StandardClassLoader(array);
System property on Tomcat
Hi, Could someone tell how to pass in a user defined system property to Tomcat at statup?
mod_jk working together with mod_userdir - possible or not?
Hello, is there any chance, to get mod_jk so configured, that it can handle jsp files, servlets ( complete webapps ) in the apache mod_userdir directory? I want to have ~/pubic_html/*.jsp interpreted by tomcat but it seems mod_jk isnt able to handle it, am i right or wrong? Any solutions for this problem? Pros Cons? best regards Torsten Krah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository
From: Akoulov, Alexandre [IT] [mailto:[EMAIL PROTECTED] Sent: 2005 April 21, Thursday 19:48 Subject: RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository I still think it is a bug!!! Read the javadoc for the class in question. (The full URL is http://jakarta.apache.org/tomcat/tomcat-5.0-doc/catalina/docs/api/org/ap ache/catalina/startup/ClassLoaderFactory.html#createClassLoader(java.io. File[],%20java.io.File[],%20java.net.URL[],%20java.lang.ClassLoader).) The first parameter is for directories, the second for jars, which is why they're named unpacked and packed, respectively. Please try the following: add a jar file (eg, foo/bar.jar) as a class repository in the catalina.properties The standard catalina.properties already has several jars and several directories specified for the various class loaders, and they all seem to work fine in the levels I'm using (5.0.28 and 5.5.7) - otherwise Tomcat wouldn't even be able to start up. What specifically did you change in catalina.properties that led you to believe there's a problem? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository
The standard catalina.properties already has several jars and several directories specified for the various class loaders, standard catalina.properties has refs to *.jar (eg, ${catalina.home}/common/endorsed/*.jar) not to the actual jar file. Bootstrap.java then checks whether there is *.jar at the end of the path, strips it from the path and then adds to the packed list. If the path ends in anything other than *.jar it gets added to unpacked list (that is where the jar file ends up) -- if (repository.endsWith(*.jar)) { packed = true; repository = repository.substring (0, repository.length() - *.jar.length()); } if (packed) { packedList.add(new File(repository)); } else { unpackedList.add(new File(repository)); } -- However, if you add a reference to the actual jar file (eg, shared.loader=${catalina.home}/shared/lib/velocity-dep-1.3.1.jar) you will not be able to use any classes from it but rather will get ClassNotFoundException. This is the actual problem! Read the javadoc for the class in question. (The full URL is http://jakarta.apache.org/tomcat/tomcat-5.0-doc/catalina/docs/api/org/ap ache/catalina/startup/ClassLoaderFactory.html#createClassLoader(java.io. File[],%20java.io.File[],%20java.net.URL[],%20java.lang.ClassLoader).) Well, the java doc says that packed - Array of pathnames to DIRECTORIES CONTAINING JAR files that should be added to the repositories of the class loader, or null for no directories of JAR files to be considered (not the actual jar files). At the same time java doc indicates that unpacked - Array of pathnames to unpacked directories that should be added to the repositories of the class loader, or null for no unpacked directories to be considered. I guess here it means that a jar file is already considered to be unpacked directory. This conclusion can be drawn from the Bootstrap.java code extract (see above) and more importantly from the actual ClassLoaderFactory#createClassLoader method's source: if (unpacked != null) { for (int i = 0; i unpacked.length; i++) { File file = unpacked[i]; if (!file.exists() || !file.canRead()) continue; if (debug = 1) log( Including directory or JAR // LOOK HERE - expects directory or a JAR file + file.getAbsolutePath()); .. .. if (packed != null) { for (int i = 0; i packed.length; i++) { File directory = packed[i]; if (!directory.isDirectory() || !directory.exists() || !directory.canRead()) // LOOK HERE - only expects to find directories in here, not the files!!! continue; -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Friday, 22 April 2005 3:13 PM To: Tomcat Users List Subject: RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository From: Akoulov, Alexandre [IT] [mailto:[EMAIL PROTECTED] Sent: 2005 April 21, Thursday 19:48 Subject: RE: Problem with the classloader in jakarta-tomcat-5.0.28 - cannot add a jar file to class repository I still think it is a bug!!! Read the javadoc for the class in question. (The full URL is http://jakarta.apache.org/tomcat/tomcat-5.0-doc/catalina/docs/api/org/ap ache/catalina/startup/ClassLoaderFactory.html#createClassLoader(java.io. File[],%20java.io.File[],%20java.net.URL[],%20java.lang.ClassLoader).) The first parameter is for directories, the second for jars, which is why they're named unpacked and packed, respectively. Please try the following: add a jar file (eg, foo/bar.jar) as a class repository in the catalina.properties The standard catalina.properties already has several jars and several directories specified for the various class loaders, and they all seem to work fine in the levels I'm using (5.0.28 and 5.5.7) - otherwise Tomcat wouldn't even be able to start up. What specifically did you change in catalina.properties that led you to believe there's a problem? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]