Re: AW: How can I get the location of the webapps-directory?
Look at the method getRealPath() of class ServletContext. Erwin Am Dienstag, 23. April 2002 13:41 schrieben Sie: Hi, with getServletContext() I get only the name of my running web-application; with getServerInfo() I get Apache Tomcat/4.0.3. But I don't get any directory name... Frank -Ursprüngliche Nachricht- Von: Scott Purcell [mailto:[EMAIL PROTECTED]] Gesendet am: Montag, 22. April 2002 18:32 An: Tomcat Users List Betreff: RE: How can I get the location of the webapps-directory? I think it is servletContext now. Check out the j2ee for servletContext that may be what you are looking for. my o'reilly book shows public String ServletContext.getServerInfo() if that don't fly, I can dig deeper, just yell Scott -Original Message- From: Eichfelder, Frank [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 9:15 AM To: [EMAIL PROTECTED] Subject: AW: How can I get the location of the webapps-directory? Hi, thanks for the reply, but I need the webapps-directory to read the existent subdirectories and/or war-files in order to make a list of all deployed web-applications. (In older versions of the Servlet-API, there was a method called getServletNames(), which is deprecated now and returns null) Does anybody have another suggestion? Thanks, Frank -Ursprüngliche Nachricht- Von: Rajesh Nair [mailto:[EMAIL PROTECTED]] Gesendet am: Montag, 22. April 2002 06:42 An: [EMAIL PROTECTED] Betreff: Re: How can I get the location of the webapps-directory? Hi I think u can try getContextPath() which will give u the root of ur web application .To get access to resources inside WAR or other archive files u can use the method getResource(String URIPath); If the context is in a different m/c u can use getContext() to get the context first and then use either getResource() or getResourceAsStream() methods *** REPLY SEPARATOR *** On 4/19/02 at 3:22 PM Eichfelder, Frank wrote: Hi, how can I get the location from the webapps-directory on my filesystem? It's easy, if I use String path = getServletContext().getRealPath(/); and then cut off the last part: int index = path.lastIndexOf(System.getProperty(file.separator), path.length()-2 ); path = path.substring(0, index); But this works only, if you have your webapplication unpacked in the file-system or if you have set unpackWars=true. Now, I have set unpackWars=false, and now I get null for getServletContext().getRealPath(/). Is there any possibility to get the name of the war-File an application is stored in or the name of the directory the war-file is stored in? Thanks, Frank -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Simple Question (I hope...)
I think your docBase should be webapps/test Context path=/test docBase=test debug=0 reloadable=true / Erwin Am Freitag, 5. April 2002 18:29 schrieben Sie: Hi there, I'm new to Tomcat and to this list, so apologies if this question has already been asked (I've checked the archives and can't find an answer). I'm trying to create a new context in server.xml. My current code is: Context path=/test docBase=test debug=0 reloadable=true / I've also created a directory within webapps called test, with sub directory WEB-INF and classes. And within the classes folder is my test class file (homepage.class). I've also created a web.xml file and placed it in the WEB-INF directory defining the servlet mappings for the new servlet (called homepage): web-app servlet servlet-namegreetings/servlet-name servlet-classhomepage/servlet-class /servlet servlet-mapping servlet-namegreetings/servlet-name url-pattern/test/please/url-pattern /servlet-mapping /web-app Using the manager app I've successfully added a new application (called test) but when I try to view the servlet, I get a 404 error ... any idea what I'm doing wrong? Thanks Adam Sefton Applications Developer ** This message may contain information which is confidential or privileged. If you are not the intended recipient, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. ** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Config. question about TC 3.3.1
Hi, is it possible to have one TC 3.3.1 installation but running more than one TC 3.3.1 Server instance starting and stopping them independently. Thanks for any comment. Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Config. question about TC 3.3.1
Hy Larry, many thank's. It works. Just one note. I've to specify the ajpidFile attribute for all TC 3.3.1 instances. The file may not be created in the conf directory, because it is deleted when a new instance is started. Erwin Am Donnerstag, 28. März 2002 16:42 schrieben Sie: Still on my todo list is to include this in the documentation. You can use multiple server.xml files, one for each instance of Tomcat 3.3.x you want to run. Each instance would need the following to be unique: 1. Port numbers Ensure port numbers for all enabled connectors are unique. Disable connectors that are not needed. 2. Work directory Ensure the work directory specified by the workDir attribute in the ContextManager element specifies a unique directory for each instance. 3. Log Files Ensure the LogSetter elements that specify file names specify unique files. 4. Ajpid Stop File(s) Ensure any stop files written are unique to each instance and don't overwrite each other. Tomcat 3.3 writes a conf/ajp12.id file by default. Tomcat 3.3.1 writes conf/ajp12.id and conf/ajp13.id files. You can specify a different file using the ajpidFile attribute on the Ajp12Connector and Ajp13Connector, respectively. To start each instance, make sure the appropriate server.xml is used. To stop each instance, make sure the corresponding stop file is used by including the -ajpid command line argument if needed. It has been a while since I have done this, so it is possible I have overlooked something. Let me know if this doesn't work. Property substitution now works in Tomcat 3.3.1. It is possible to this with a single server.xml and appropriate command line arguments. Command line arguments that don't match predefined arguments are treated as property definitions. Cheers, Larry -Original Message- From: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 6:31 AM To: [EMAIL PROTECTED] Subject: Config. question about TC 3.3.1 Hi, is it possible to have one TC 3.3.1 installation but running more than one TC 3.3.1 Server instance starting and stopping them independently. Thanks for any comment. Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: many java processes
When I do a ps and Tomcat is running I get a different pid for each Java (Process?). pstree also says that there are some java (Processes?) are running. Can you say me how I can determine whetere all the Java (Prosesses) are belonging to the same process. Are you sure to not missinterpreting a father process (root process). lg Erwin Am Donnerstag, 21. März 2002 15:16 schrieben Sie: On linux did anybody ever get a linux patch for fixing the problem of one process per java thread. I read on the sun bug parade they were going to port to a new threading model but we needed to update the linux threading I have seen many e-mails complaining about how tomcat creates s many processes and this is due to a JVM thing not tomcat. Does anybody know or is everyone just sitting by with many many java processes on their linux? Any help, pointers you could give me would be great, As near as I can tell, Linux *doesn't* create multiple processes. If you look closely at the output of ps all the java processes exist in the same processes. Linux (at least RedHat) comes with a ps that reports threads as well as processes. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat vs CPU
Do you starting non daemon threads in your web applications (Servlets)? As long as non daemon Java threads are running you will have Java processes in your memory. Erwin Am Donnerstag, 7. M(B?(Brz 2002 07:05 schrieben Sie: Does anybody clue me in thsi situation? Plus,in below situation ,when I shutdoun Tomcat4,seems after shutting down there are some Java processes still remains. After killing them by kill PID, Cpu State is becoming normal. Please help,any hints will be welcomed. Moi wrote: Suddenly,when I saw Current System Resources in Linux with top command I found out that Tomcat4 eats 96% of CPU.In regular days it eats only 3%. Dear gurus. What can be the reason and how I solve it? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Directory browsing
Hi, can one say me how I can switch of directory browsing for TC 3.3a. If I send a request http://host/context I get the directory structure of the context (docBase) as the response. Thanks in advance Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Different Contextes One Instance?
Hi All! TC 3.3 has a class loader architecture which allowes to load classes with respect to the container, to all web applics and to a specific web applic. The question I have is the following. I have developed some components which are inteded to be used by all of our web applics. One of this component for instance is a database connection pool manager. It is implemented as a Singleton. So, if I put the .jar file into the directory $TOMCAT_HOME/lib/apps and for instance there are three wep applics using it, how mucht Singleton does the VM maintain? Three (one in each context) or one for all contextes. Many Thanks in advance Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Different Contextes One Instance?
Thank's for the answer Larry. Larry Isaacs wrote: There would be a single instance, but all threading and concurency issues would be up to you to handle. Cheers, Larry -Original Message- From: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 4:41 AM To: Tomcat Mailinglist Subject: Different Contextes One Instance? Hi All! TC 3.3 has a class loader architecture which allowes to load classes with respect to the container, to all web applics and to a specific web applic. The question I have is the following. I have developed some components which are inteded to be used by all of our web applics. One of this component for instance is a database connection pool manager. It is implemented as a Singleton. So, if I put the .jar file into the directory $TOMCAT_HOME/lib/apps and for instance there are three wep applics using it, how mucht Singleton does the VM maintain? Three (one in each context) or one for all contextes. Many Thanks in advance Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Starting TC from inittab
Hi! The TC3.3 doc. writes about starting TC from inittab. This is OK and works, but now TC runs as root. Is there a possibility to start TC from inittab under a user other than root. Tanks Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to start tomcat 4
Hi! I have also problems to start TC 4.0.1. But I even get a segmetatin fault. Starting service Tomcat-Standalone Apache Tomcat/4.0.1 SIGSEGV 11* segmentation violation stackpointer=0xbfffeb64 This Problem occurs on a machine with the following environment: IBMJava2-1.3-9 Red Hat Linux 6.2 with Kernel 2.2.14 I have no problems to run TC 4.0.1 on an machine with the follwing environment: IBMJava2-1.3-9 Red Hat Linux 7.1 with Kernel 2.4.9 Erwin Brian Adams wrote: I got the same error then I notice I had java 1.2 running. I switched to 1.3.1 and all fixed. :) -Original Message- From: Emil Diego [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 2:54 PM To: [EMAIL PROTECTED] Subject: Unable to start tomcat 4 Thanx for all the responses about my problem. I am still getting some errors though. As suggested I update to the Java 1.2.2 SDK. I installed it successfully. I am still receiving a problem when trying to start tomcat 4. I have attached the catalina.out error log. It reports the following problem. Exception during startup processing java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/naming/directory/DirContext. The rest of the error message is included in the log file. Emil Diego [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: AW: AW: AW: TC 3.3 jsessionid
Thanks Ralph, it works. Ralph Einfeldt wrote: Try to change the action to: form method=POST action=%= response.encodeURL(j_security_check) % -Ursprüngliche Nachricht- Von: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 3. Dezember 2001 22:35 An: Tomcat Users List Betreff: Re: AW: AW: TC 3.3 jsessionid snip/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: AW: TC 3.3 jsessionid
I get the URL when I login using FORM based authetnication. After being logged in properly the ;jsessionid is no longer part of the URL for additional requests. Erwin Ralph Einfeldt wrote: How did you get that URL? It should look like this: http://localhost:8080/news/servlet/lm;jsessionid=22ym1bzx71?act=bgetinde x -Ursprüngliche Nachricht- Von: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 3. Dezember 2001 17:35 An: Tomcat Mailinglist Betreff: TC 3.3 jsessionid Hi, TC 3.3 appends the jsessionid after an ; to the URL, thus I get the jsessionid with the parameter. Example: I have the following URL already assigned with a jsessionid by Tomcat: http://localhost:8080/news/servlet/lm?act=bgetindex;jsessionid =22ym1bzx71 When I ask for the parameter act using getParameter(act); I get the parameter value as well as the jsessionid, thus the parameter is: bgetindex;jsessionid=22ym1bzx71 instead of bgetindex Is this normal behaviour ? Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: AW: AW: TC 3.3 jsessionid
A standart form for FORM based authentication, here is acopy: html body form method=POST action=j_security_check center table tr tdbUser-Name:/b/tdtdinput type=text name=j_username/td /tr tr tdbPasswort:/b/tdtdinput type=password name=j_password/td /tr trtd colspan=2nbsp;/td/tr tr th colspan=2input type=submit value=Anmelden name=j_security_check/th /tr /table /center /form /body /html Thanks Erwin Ralph Einfeldt wrote: What does your form look like ? -Ursprüngliche Nachricht- Von: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 3. Dezember 2001 18:03 An: Tomcat Users List Betreff: Re: AW: TC 3.3 jsessionid I get the URL when I login using FORM based authetnication. After being logged in properly the ;jsessionid is no longer part of the URL for additional requests. Erwin Ralph Einfeldt wrote: How did you get that URL? It should look like this: http://localhost:8080/news/servlet/lm;jsessionid=22ym1bzx71?a ct=bgetinde x -Ursprüngliche Nachricht- Von: Erwin Ambrosch [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 3. Dezember 2001 17:35 An: Tomcat Mailinglist Betreff: TC 3.3 jsessionid Hi, TC 3.3 appends the jsessionid after an ; to the URL, thus I get the jsessionid with the parameter. Example: I have the following URL already assigned with a jsessionid by Tomcat: http://localhost:8080/news/servlet/lm?act=bgetindex;jsessionid =22ym1bzx71 When I ask for the parameter act using getParameter(act); I get the parameter value as well as the jsessionid, thus the parameter is: bgetindex;jsessionid=22ym1bzx71 instead of bgetindex Is this normal behaviour ? Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Dispatching
Hi, I'm using TC 3.2.3. Is there a possibility to forward a request to a different context, similar to the RequestDispatcher.forward(...) method for the same context. Thank's for any comment. Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Form/Basic Authentication
Hi, I have the following behaviour using Tomcat 3.2.3 on RH Linux 7.1. If I use either FORM based or BASIC authentication, for the very first login I get the login form/dialog two times. 1. First time after accessing the protected area as defined in web.xml for the very first time. 2. Second time after sending a request within the already logged on protected. From know on everything works fine. Logging out forces me to login again, but just one time as excpected. Thanks for any comment Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: url relative to directory path?
Take a look at the servlet-mapping tag of the web.xml file. With this tag you can specify how to access yopur servlet. servlet-mapping servlet-nameservletname/servlet-name url-pattern/servletname/url-pattern /servlet-mapping Erwin Antoni Unkovich wrote: Hello from downunder (New Zealand), I'm new to tomcat and java but have successfully installed Tomcat 3.3 on Windows 2000 server in conjunction with IIS and the redirector plug-in - which I have working fine. My servlet is in this directory: E:\tomcat\webapps\qbus\WEB-INF\Classes\qbus\servletname.class to access it I use this url: www.qbus.co.nz/qbus/servlet/servletname What do I need to change to access it from: www.qbus.co.nz/servletname Thanks in advance Antoni Unkovich -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
BASIC / FORM Authetntication
Hi, I've the following behaviour using Tomcat 3.2.3. I use the Authentication/Authorisation functionality implemented by the Tomcat Servlet Engine. If I start from scratch, and I request the secure area as defined in web.xml, I get the login form (FORM based) or the login dialog (BASIC). After entering the correct data I get the expected response. But If I submit another request within this protected area, I've to login a second time. From know on everithing works fine. From know on I have to login just one time if I leave the protected area and enter again. What can I do? Thanks for any comment. Erwin -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Can't happen - classname is null, who added this ?
I got the same message several times when I recompiled an already deployed web-app and configured tomcat to reload recompiled classes dynamically. Erwin Micael Padraig Og mac Grene wrote: Usually happens when you add something to a web container run in conjunction with a JBoss application server without bouncing JBoss. Did you do that? -Original Message- From: Voon, Wendy [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Date: Thursday, November 01, 2001 9:58 PM Subject: Can't happen - classname is null, who added this ? Hi, I am running TC 3.2.3 I am getting a weird error, does anyone know what this means? Internal Servlet Error: java.lang.IllegalStateException: Can't happen - classname is null, who added this ? Cheers in advance, Wendy Voon Consultant Black Diamond T e c h n o l o g i e s Level 1, 6 Riverside Quay, Southbank, Victoria, 3006. E-mail: [EMAIL PROTECTED] Telephone: (03) 9698 - 7600 Facsimile: (03) 9698 - 7666 Web: http://www.bdt.com.au/ ---INTERNET E-MAIL CONFIDENTIALITY/DISCLAIMER Privileged and confidential information may be contained in this e-mail. If you are not the intended recipient of this communication please delete and destroy all copies and kindly notify the sender by return e-mail. Recipients of this e-mail must not use, disclose or forward any information or attachments without express permission from Black Diamond Technologies. Any views expressed in this communication are those of the individual sender except where the sender specifically states them to be the views of Black Diamond Technologies. Except as required at law, we do not represent warrant and/or guarantee that the integrity of this communication has been maintained or that it is free of errors, viruses, interception or interference. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- Mit freundlichen Grüssen Erwin Ambrosch == e-business for e-people === DI(FH) Erwin Ambrosch ebutec business solutions email:mailto:[EMAIL PROTECTED] web: http://www.ebutec.at A - 9020 Klagenfurt == Peter Mitterhofergasse 33 tel: +43-(0)463-429429-200 fax: +43-(0)463-429429-9 == Zur Information: Das Unternehmen 2A DTR-Services wurde mit Wirkung vom 1. September 2001 in die ebutec business solutions oeg umfirmiert. ebutec business solutions === -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]