Re: Servlet directory?
It's under this directory, /WEB-INF/lib or /WEB-INF/classes of any webapp that you have. Then define the servlet for the web app in web.xml . There are quite a few good examples on this that ship with many jakarta projects. So download a few and take a peek at it. Jørgen Ramskov wrote: Hi I'm trying to some software called ArcIMS. It asks for the webservers servlet directory and in the readme it gives some examples: === Cut === Installing ArcIMS Servlet Connector The ArcIMS Servlet Connector directory, \com, must be copied to your Web server's servlet directory in order to establish communication between your Web server and the ArcIMS Application Server. The following is a list of common Web servers and their servlet directories. Apache 1.3.20 and Jakarta Tomcat 3.2 drive:\TOMCAT_HOME\webapps\ROOT\WEB-INF\classes === Cut === I'm however using Tomcat 4.1.12, where is the directory then? Thanks. -- Joergen -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Re: Servlet directory?
Me again, Forgot to mention that in TC4.1.12 and above, the invoker servlet is off by default. You will have to map it to a different url in the web.xml. Something other than servlet. Then change the diagnostics urls to match. From Tim Moore, You have two choices for how to fix this problem. 1. You could go into tomcat/conf/web.xml and re-enable the servlet-mapping for the invoker (it's just commented out). This is the fast way. 2. You could create a URL mapping in your webapp's web.xml file for and then use that URL to access it. This is the better way. The invoker servlet can be dangerous, and it's now recommended that you leave it disabled. You'll need to map your servlet to a URL. So that being said, I think you should do something like, For example, add this to your web.xml in the TOMCAT_HOME/webapps/arcimsServletConnector/WEB-INF/ servlet-mapping servlet-namecom.esri.esrimap.Esrimap/servlet-name url-pattern/com.esri.esrimap.Esrimap/url-pattern /servlet-mapping And then go to http://your_server/arcimsServletConnector/com.esri.esrimap.Esrimap?CMD=connectorping http://your_server/arcimsServletConnector/com.esri.esrimap.Esrimap?CMD=appserverping I haven't tested the correct way, I just uncommented the system web.xml file. I only do local host stuff on my desktop for developing. HTH rls Robert L Sowders [EMAIL PROTECTED] 10/18/2002 02:23 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Servlet directory? Ahhh, another ArcIMS headache in the making. I've found that it's easier to just lie to the installer and then delete whatever it installs for the connector. Then go to the ArcIMS\connectors\servlet directory and copy the arcimsServletConnector.war file to the TOMCAT_HOME/webapps directory and let Tomcat autodeply the connector for you. You can do the same for the ArcIMS Administrator, they also supply the administrator in a war file for you. It's called esriadmin.war. Just put it in the TOMCAT_HOME/webapps directory. You will have to make the jkmount statements or the mod_jk2 uri statements. One called arcimsServletConnector and another for esriadmin Only problem is the ESRI supplied diagnostic routine will not function. It has hard coded paths and was made with the assumption that you have loaded everything to the ROOT of Tomcat. You can still do the diagnostics, you just have to use your browser and call the function directly. The following assumes you are installing your web server to localhost, change it to suit your installation. http://localhost/arcimsServletConnector/servlet/com.esri.esrimap.Esrimap?CMD=connectorping http://localhost/arcimsServletConnector/servlet/com.esri.esrimap.Esrimap?CMD=appserverping Following the above procedure is more in line with the spec and lets you use your Tomcat installation for more than just ArcIMS. Here is a How To for a window 2000 installation for apache, tomcat, mod_jk2, arcims4, jsdk1.4.1. At the end of the ArcIMS section is a section called new that outlines the above steps. The main guide try's to follow as close as possible ESRI's instructions. ftp://pokey.wr.usgs.gov/pub/rsowders/ArcIMS4_Apache2_JK2_TC4.1.x_JDK1.4.x.zip The ArcIMS section at least is generic to your platform just change the paths you select, keep in mind that if you put the output and website directories in the DocumentRoot of the webserver then you don't have to do any aliases for them. rls Jørgen Ramskov [EMAIL PROTECTED] 10/18/2002 12:41 AM Please respond to Tomcat Users List To: 'Tomcat Users List' [EMAIL PROTECTED] cc: Subject:Servlet directory? Hi I'm trying to some software called ArcIMS. It asks for the webservers servlet directory and in the readme it gives some examples: === Cut === Installing ArcIMS Servlet Connector The ArcIMS Servlet Connector directory, \com, must be copied to your Web server's servlet directory in order to establish communication between your Web server and the ArcIMS Application Server. The following is a list of common Web servers and their servlet directories. Apache 1.3.20 and Jakarta Tomcat 3.2 drive:\TOMCAT_HOME\webapps\ROOT\WEB-INF\classes === Cut === I'm however using Tomcat 4.1.12, where is the directory then? Thanks. -- Joergen -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Re: Servlet directory?
Ahhh, another ArcIMS headache in the making. I've found that it's easier to just lie to the installer and then delete whatever it installs for the connector. Then go to the ArcIMS\connectors\servlet directory and copy the arcimsServletConnector.war file to the TOMCAT_HOME/webapps directory and let Tomcat autodeply the connector for you. You can do the same for the ArcIMS Administrator, they also supply the administrator in a war file for you. It's called esriadmin.war. Just put it in the TOMCAT_HOME/webapps directory. You will have to make the jkmount statements or the mod_jk2 uri statements. One called arcimsServletConnector and another for esriadmin Only problem is the ESRI supplied diagnostic routine will not function. It has hard coded paths and was made with the assumption that you have loaded everything to the ROOT of Tomcat. You can still do the diagnostics, you just have to use your browser and call the function directly. The following assumes you are installing your web server to localhost, change it to suit your installation. http://localhost/arcimsServletConnector/servlet/com.esri.esrimap.Esrimap?CMD=connectorping http://localhost/arcimsServletConnector/servlet/com.esri.esrimap.Esrimap?CMD=appserverping Following the above procedure is more in line with the spec and lets you use your Tomcat installation for more than just ArcIMS. Here is a How To for a window 2000 installation for apache, tomcat, mod_jk2, arcims4, jsdk1.4.1. At the end of the ArcIMS section is a section called new that outlines the above steps. The main guide try's to follow as close as possible ESRI's instructions. ftp://pokey.wr.usgs.gov/pub/rsowders/ArcIMS4_Apache2_JK2_TC4.1.x_JDK1.4.x.zip The ArcIMS section at least is generic to your platform just change the paths you select, keep in mind that if you put the output and website directories in the DocumentRoot of the webserver then you don't have to do any aliases for them. rls Jørgen Ramskov [EMAIL PROTECTED] 10/18/2002 12:41 AM Please respond to Tomcat Users List To: 'Tomcat Users List' [EMAIL PROTECTED] cc: Subject:Servlet directory? Hi I'm trying to some software called ArcIMS. It asks for the webservers servlet directory and in the readme it gives some examples: === Cut === Installing ArcIMS Servlet Connector The ArcIMS Servlet Connector directory, \com, must be copied to your Web server's servlet directory in order to establish communication between your Web server and the ArcIMS Application Server. The following is a list of common Web servers and their servlet directories. Apache 1.3.20 and Jakarta Tomcat 3.2 drive:\TOMCAT_HOME\webapps\ROOT\WEB-INF\classes === Cut === I'm however using Tomcat 4.1.12, where is the directory then? Thanks. -- Joergen -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Re: Servlet directory
And you've provided appropriate servelet and servlet-mapping entries in your web.xml? -Michael - Original Message - From: Daliso Zuze [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 4:51 AM Subject: Servlet directory I have put some servlet classes in my web applications classes directory, however when I try to access it via the url http://localhost:8080/myapp/servlet/myservlet it does not work. It seems to only work when I put the classes in the default ROOT web app and access it via http://localhost:8080/servlet/myservlet. Is there a way of configuring tomcat to make it work from the first url??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet directory
Yes Micheal, I have added those entries When I try to use the servlet mapping name it gives me a CLASS NOT FOUND exception. - Original Message - From: Michael E. Locasto [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 2:44 PM Subject: Re: Servlet directory And you've provided appropriate servelet and servlet-mapping entries in your web.xml? -Michael - Original Message - From: Daliso Zuze [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 4:51 AM Subject: Servlet directory I have put some servlet classes in my web applications classes directory, however when I try to access it via the url http://localhost:8080/myapp/servlet/myservlet it does not work. It seems to only work when I put the classes in the default ROOT web app and access it via http://localhost:8080/servlet/myservlet. Is there a way of configuring tomcat to make it work from the first url??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet directory
The way you are trying to access this servlet implies a couple of assumptions: 1. Your servlet is in the default package. That is to say that it exist in WEB-INF/classes and not some directory deeper inside of that. 2. Your class is all lower case myservlet since that is how it is written on the URL your provided below. I think it is probably likely that #1 is true. However, I'm guessing that #2 is not. The general practice for naming classes is to use Capital letters for each distinct part of the class name. For instance, you probably named your class MyServlet, not myservlet. As such, the URL you provided won't work. It should be: http://localhost:8080/myapp/servlet/MyServlet Note that servlet and servlet-mapping entries in your own web.xml have nothing in particular to do with accessing your class through Tomcat's default servlet invoker which is mapped to /[your context]/servlet/*. The other thing you should look at is that the directory that your app is running out of exists in: $TOMCAT_HOME/webapps/myapp make sure that myapp is in all lower case. Oh, and make sure that there are no spaces in $TOMCAT_HOME. If you have it installed in a directory like Program Files, you can do the following (on Windows). I'll use my setup as an example. $CATALINA_HOME=C:\Progra~1\Apache~1\Jakarta\tomcat-4.1.8 The original path is: C:\Program Files\Apache Group\Jakarta\tomcat-4.1.8 Just use the tilde's to fix directory names which have spaces. The names with tilde's can be no more than 8 chars long. Restart Tomcat after using the hints above and things should work just fine. Jake At 10:51 AM 8/3/2002 +0200, you wrote: I have put some servlet classes in my web applications classes directory, however when I try to access it via the url http://localhost:8080/myapp/servlet/myservlet it does not work. It seems to only work when I put the classes in the default ROOT web app and access it via http://localhost:8080/servlet/myservlet. Is there a way of configuring tomcat to make it work from the first url???
Re: Servlet directory
Thanks, I got it working now, I had misplaced the classes directory. Daliso - Original Message - From: Jacob Kjome [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 7:18 PM Subject: Re: Servlet directory The way you are trying to access this servlet implies a couple of assumptions: 1. Your servlet is in the default package. That is to say that it exist in WEB-INF/classes and not some directory deeper inside of that. 2. Your class is all lower case myservlet since that is how it is written on the URL your provided below. I think it is probably likely that #1 is true. However, I'm guessing that #2 is not. The general practice for naming classes is to use Capital letters for each distinct part of the class name. For instance, you probably named your class MyServlet, not myservlet. As such, the URL you provided won't work. It should be: http://localhost:8080/myapp/servlet/MyServlet Note that servlet and servlet-mapping entries in your own web.xml have nothing in particular to do with accessing your class through Tomcat's default servlet invoker which is mapped to /[your context]/servlet/*. The other thing you should look at is that the directory that your app is running out of exists in: $TOMCAT_HOME/webapps/myapp make sure that myapp is in all lower case. Oh, and make sure that there are no spaces in $TOMCAT_HOME. If you have it installed in a directory like Program Files, you can do the following (on Windows). I'll use my setup as an example. $CATALINA_HOME=C:\Progra~1\Apache~1\Jakarta\tomcat-4.1.8 The original path is: C:\Program Files\Apache Group\Jakarta\tomcat-4.1.8 Just use the tilde's to fix directory names which have spaces. The names with tilde's can be no more than 8 chars long. Restart Tomcat after using the hints above and things should work just fine. Jake At 10:51 AM 8/3/2002 +0200, you wrote: I have put some servlet classes in my web applications classes directory, however when I try to access it via the url http://localhost:8080/myapp/servlet/myservlet it does not work. It seems to only work when I put the classes in the default ROOT web app and access it via http://localhost:8080/servlet/myservlet. Is there a way of configuring tomcat to make it work from the first url??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet Directory
Adding a context path in server.xml is just one part to it (BTW, in docBase you might want to use a fully qualified path rather than a relative path). The 2nd file that you need to edit is uriworkermap.properties file, and add (in your case) /myservlets/*=ajp12 You may need to restart both Tomcat and the web server. Good luck. Anuj. Richard Scales wrote: I've just installed tomcat 3.2.1 and its working fine except that I am using the default webapps/examples directory to store my servlets which is a pain as I physically have to copy them over etc and I would like to keep them on a seperate folder somewhere else on my machine. I have been trying to achieve this by adding a contex-path to the server.xml file with no luck. Currently my servlets are in H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to store them in H:\Work\MyServlets\bin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Servlet Directory
Anuj, I've done that and I get now get the Tomcat Admin tools page at http://localhost:8080/richard/index.html on my machine but cannot access my servlets below my bin directory. Any ideas? Rich -Original Message- From: Anuj Agrawal [mailto:[EMAIL PROTECTED]] Sent: 02 March 2001 13:45 To: [EMAIL PROTECTED] Subject: Re: Servlet Directory Adding a context path in server.xml is just one part to it (BTW, in docBase you might want to use a fully qualified path rather than a relative path). The 2nd file that you need to edit is uriworkermap.properties file, and add (in your case) /myservlets/*=ajp12 You may need to restart both Tomcat and the web server. Good luck. Anuj. Richard Scales wrote: I've just installed tomcat 3.2.1 and its working fine except that I am using the default webapps/examples directory to store my servlets which is a pain as I physically have to copy them over etc and I would like to keep them on a seperate folder somewhere else on my machine. I have been trying to achieve this by adding a contex-path to the server.xml file with no luck. Currently my servlets are in H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to store them in H:\Work\MyServlets\bin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Servlet Directory
I do this all the time. I assume that the /Work/MyServlets/bin contains a WEB-INF directory. docBase should be set to the directory which contains the WEB-INF directory. Tomcat looks in the WEB-INF/classes directory for any class files. Match Richard Scales wrote: Hi, I've just installed tomcat 3.2.1 and its working fine except that I am using the default webapps/examples directory to store my servlets which is a pain as I physically have to copy them over etc and I would like to keep them on a seperate folder somewhere else on my machine. I have been trying to achieve this by adding a contex-path to the server.xml file with no luck. Currently my servlets are in H:\jakarta-tomcat-3.2.1\webapps\examples\WEB-INF\classes and I would like to store them in H:\Work\MyServlets\bin I cannot work out how to change this directory this is as far as I have got:- Context path="/myservlets" docBase="../../Work/MyServlets/bin" crossContext="false" debug="0" reloadable="true" /Context This does not work and I cannot work out why! Can anyone help? Thanks Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Servlet Directory
Hi, Just to spell things out a bit clearer: The code for a servlet class, and any non-library classes it uses, must be in the classpath. Your best options are: (a) put them under {yourwebapp}/WEB-INF/classes, in a subdirectory that matches your package structure. (b) put them in a jar file, in {yourwebapp}/WEB-INF/lib In either case above, tomcat automatically adds the directories/libs to its classpath when it starts. You *can* put your servlet classes elsewhere on your disk, and make sure your CLASSPATH points to them before starting tomcat, but there are many disadvantages to this, including making it difficult to install your code elsewhere, and not being able to use the servlet auto-reload feature. Now that your class is *loadable* by tomcat, you need to tell tomcat what URLs map to what servlets. There is an entry in $TOMCAT_HOME/conf/web.xml which sets up a default mapping for servlets; for any url of form /webapp/servlet/servletname, an attempt is made to do a "loadClassForName(servletname)" and if successful, the request is passed off to the found class. Of course, the class to be loaded merely has to be in the classpath somewhere (see (a) and (b) above). [[NB: this only applies in tomcat3.1; I hear that tomcat3.2 does not have a $TOMCAT_HOME/conf/web.xml file, in which case I'm not sure how or if the default servlet mapping gets set up...]] If you don't like this default mapping, you just define your own (url-servletclass) mappings in the file yourwepapp/WEB-INF/web.xml. See the file $TOMCAT_HOME/conf/web.dtd to see what tags are allowed in the web.xml file; then read the sun servlet specs. NB: don't modify the web.xml file in TOMCAT_HOME/conf, create your own inside your webapp/WEB-INF. Note that the servlet class *never* lives *at* the url that the user enters; the url is always looked up to find a corresponding class name, and then the servlet class is loaded from the classpath. I hope this clarifies things a bit... Regards, Simon -Original Message- From: Clark D. Richey, JR. [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 3:22 AM To: [EMAIL PROTECTED] Subject: RE: Servlet Directory The class file has to be in Tomcat's classpath. Where are you putting the servlet's class file? -Original Message- From: Corey A. Johnson [mailto:[EMAIL PROTECTED]] Sent: Monday, October 23, 2000 8:15 PM To: [EMAIL PROTECTED] Subject: Servlet Directory Hello all, First, let me apologize... this is so simple... but i have been beating my head against the wall for almost 20 hours straight now... I have successfully installed Tomcat on my Solaris... With Apache 1.3.14 Everything seems to be working fine... JSPs work well... looking through the logs... no errors... but i can not get any servlets to work in my defined servlet directory. I must be missing something very simple. When i try to invoke a servlet, the tomcat.log file shows: Context log: path="" Class Not Found in init java.lang.ClassNotFoundException: testAllego In my tomcat.conf file.. i have the line: ApJServMount /servlet /root And i have this in my server.xml file: Context path="" docBase="/export/home/cni/servlet" debug="0" reloadable="true" /Context I feel like i am so close... because ay least it is "trying" to load the servlet class... but tomcat can't find it.. please help... i need some sleep... thanks in advance. Cj -- Corey A. Johnson Creative Network Innovations, Inc. 1-800-264-5547 ** 1-321-259-1984