FW: Apache/Tomcat returning error 503
I never got a reply from anyone for the message below, so I'm trying it once again. Thanks Setup includes: Redhat Linux 9 Apache 2.0.49 Tomcat 5.0.19 mod_jk2 After performing the appropriate installs, I can get to the Apache default page, and I can access the Tomcat as well on 8080. I can even access the jkstatus via Apache, but when I try to access jsp-examples via Apache, I'm getting the following error 503: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.0.49 (Unix) mod_jk2/2.0.4 Server at 192.168.1.101 Port 80 ** My workers2.properties file appears as follows: # workers2.properties # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/usr/local/tomcat5/logs/jk2.shm size=1048576 debug=0 disabled=0 # UNIX domain socket [channel.un:/usr/local/tomcat5/work/jk2.socket] tomcatId=localhost:8009 debug=0 # define the worker [ajp13:/usr/local/tomcat5/work/jk2.socket] channel=channel.un:/usr/local/tomcat5/work/jk2.socket # Announce a status worker [status:status] info=Status worker. Displays runtime information. [uri:/jkstatus/*] group=status:status # Uri mapping [uri:/jsp-examples/*] * My jk2.properties is as follows: # Set the desired handler list handler.list=apr,request,channelSocket channelSocket.port=8009 serverRoot=/usr/local/apache2 apr.NativeSo=/usr/local/apache2/modules/libjkjni.so * My httpd.conf contains the following connection: LoadModule jk2_module modules/mod_jk2.so JkSet config.file /usr/local/apache2/conf/workers2.properties Can anyone help? I've been trying to solve this one for awhile. Thanks. - 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]
Apache/Tomcat returning error 503
Setup includes: Redhat Linux 9 Apache 2.0.49 Tomcat 5.0.19 mod_jk2 After performing the appropriate installs, I can get to the Apache default page, and I can access the Tomcat as well on 8080. I can even access the jkstatus via Apache, but when I try to access jsp-examples via Apache, I'm getting the following error 503: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.0.49 (Unix) mod_jk2/2.0.4 Server at 192.168.1.101 Port 80 ** My workers2.properties file appears as follows: # workers2.properties # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/usr/local/tomcat5/logs/jk2.shm size=1048576 debug=0 disabled=0 # UNIX domain socket [channel.un:/usr/local/tomcat5/work/jk2.socket] tomcatId=localhost:8009 debug=0 # define the worker [ajp13:/usr/local/tomcat5/work/jk2.socket] channel=channel.un:/usr/local/tomcat5/work/jk2.socket # Announce a status worker [status:status] info=Status worker. Displays runtime information. [uri:/jkstatus/*] group=status:status # Uri mapping [uri:/jsp-examples/*] * My jk2.properties is as follows: # Set the desired handler list handler.list=apr,request,channelSocket channelSocket.port=8009 serverRoot=/usr/local/apache2 apr.NativeSo=/usr/local/apache2/modules/libjkjni.so * My httpd.conf contains the following connection: LoadModule jk2_module modules/mod_jk2.so JkSet config.file /usr/local/apache2/conf/workers2.properties Can anyone help? I've been trying to solve this one for awhile. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Service Temporarily Unavailable
I thought I'd try this request one more time since I didn't get any responses my first time out: I finally got Apache2+Tomcat5+mod_jk2 all talking. I entered the address http://myhost/jkstatus; and received the correct response page. However, when I entered the address: httpd://myhost/jsp-examples, I get the following output: - Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.0.49 (Unix) mod_jk2/2.0.4 Server at 192.168.1.101 Port 80 - Does anyone have a clue here? Thanks, Ken - 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]
Trying to get Apache, Tomcat, and Mod_jk2 to work together
After all of the problems I had last week trying to get these pieces to work together, I figured that I would start from scratch, erase everything, and recompile the Apache server, Tomcat, and the mod_jk2. While compiling and installing the Apache HTTP server, I ran into a problem and figured that I'd tap into the mailing list to see if anyone has run into a similar problem (I also sent this to the Apache HTTP list server, which is more appropriate, but no one seems to be sending anything out on this list today). OS: Linux 9 Apache Ver: 2.0.49 After cleaning up the existing Apache HTTP that installed with RedHat, I downloaded the source for the latest Apache HTTP and performed the following commands: 1. ./config --enable-so 2. make 3. make install When I switch over to /usr/local/apache2/bin and executed apachectl start, it ran fine. Next I performed the following: 1. cp build/rpm/httpd.init /etc/init.d/httpd 2. chkconfig --add httpd 3. chkconfig --levels 345 httpd on 4. cp build/rpm/httpd.logrotate /etc/logrotate.d/httpd 5. service httpd start This last command returned the following error: [EMAIL PROTECTED] conf]# service httpd start Starting httpd: execvp: No such file or directory[FAILED] Does anyone have any clue how to get rid of the error? I haven't changed any of the default settings, scripts, or configuration files. Thanks, Ken
Service Temporarily Unavailable
I finally got Apache2+Tomcat5+mod_jk2 all talking. I entered the address http://myhost/jkstatus; and received the correct response page. However, when I entered the address: httpd://myhost/jsp-examples, I get the following output: - Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.0.49 (Unix) mod_jk2/2.0.4 Server at 192.168.1.101 Port 80 - Does anyone have a clue here? Thanks, Ken - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DocBase, Path, and WARs
I have a quick question regarding WARs and Tomcat 4.x, which I hope someone can give me a straight answer for: I'm reposting this message since I still haven't received an answer: I created a WAR file containing a servlet, and a few JSPs. I put all of the necessary stuff into the web.xml, and created the appropriate structure in the WAR file. According to the TOMCAT documentation, I need to specify a context as follows: Context debug=0 docBase=MyWebApp.war path=/MyWebApp reloadable=true / However, this did not work and TOMCAT did not expand the WAR file when I started TOMCAT up. After messing around with it for a bit, I discovered that the following finally got it to work: Context debug=0 docBase=MyWebApp path=/ reloadable=true / In fact, I even tried leaving the docBase empty and it still expanded the WAR file when TOMCAT started up. What gives? I guess I don't have a solid understanding of docBase and path yet. I thought that the purpose of creating a Context entry was to provide the application with its own private context at runtime? If this is so, who's context is this application running under. It certainly doesn't appear to be creating a context for MyWebApp. Ken
DocBase, Path, and WARs
I have a quick question regarding WARs and Tomcat 4.x, which I hope someone can give me a straight answer for: I created a WAR file containing a servlet, and a few JSPs. I put all of the necessary stuff into the web.xml, and created the appropriate structure in the WAR file. According to the TOMCAT documentation, I need to specify a context as follows: Context debug=0 docBase=MyWebApp.war path=/MyWebApp reloadable=true / However, this did not work and TOMCAT did not expand the WAR file when I started TOMCAT up. After messing around with it for a bit, I discovered that the following finally got it to work: Context debug=0 docBase=MyWebApp path=/ reloadable=true / In fact, I even tried leaving the docBase empty and it still expanded the WAR file when TOMCAT started up. What gives? I guess I don't have a solid understanding of docBase and path yet. I thought that the purpose of creating a Context entry was to provide the application with its own private context at runtime? If this is so, who's context is this application running under. It certainly doesn't appear to be creating a context for MyWebApp. Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com http://www.mastermind.com/ Ph - 570-688-9600 Fx - 208-275-2301
DocBase, Path, and WARs
I have a quick question regarding WARs and Tomcat 4.x, which I hope someone can give me a straight answer for: I created a WAR file containing a servlet, and a few JSPs. I put all of the necessary stuff into the web.xml, and created the appropriate structure in the WAR file. According to the TOMCAT documentation, I need to specify a context as follows: Context debug=0 docBase=MyWebApp.war path=/MyWebApp reloadable=true / However, this did not work and TOMCAT did not expand the WAR file when I started TOMCAT up. After messing around with it for a bit, I discovered that the following finally got it to work: Context debug=0 docBase=MyWebApp path=/ reloadable=true / In fact, I even tried leaving the docBase empty and it still expanded the WAR file when TOMCAT started up. What gives? I guess I don't have a solid understanding of docBase and path yet. I thought that the purpose of creating a Context entry was to provide the application with its own private context at runtime? If this is so, who's context is this application running under. It certainly doesn't appear to be creating a context for MyWebApp. Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com http://www.mastermind.com/ Ph - 570-688-9600 Fx - 208-275-2301
RE: ClassNotFoundException
Totally awesome. This worked like a charm. Thanks, Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com Ph - 570-688-9600 Fx - 208-275-2301 -Original Message- From: Sriram Narayanan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 10:08 AM To: Tomcat Users List Subject: RE: ClassNotFoundException Just a question, Would Thread.currentThread().getContextClassLoader().loadClass(myclassname) help ? I don't have TC 3.3, but this works for me in TC 4.0.1 Sriram 2/27/02 6:45:11 PM, Larry Isaacs [EMAIL PROTECTED] wrote: To deal with a situation like this, I have seen #1 below implemented by providing an object that is loaded in the webapp classloader to the base class. A good candidate would be this from MyServletClass. MyBaseServletClass can obtain the classloader of this object to gain access to the webapp classloader. Cheers, Larry _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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: Trouble with IMG tag, servlets, and JSPs
I chose to use your first suggestion; a Servlet-Mapping, and it worked great and looks much more elegant. All I did was to include the following mapping in my web.xml: servlet-mapping servlet-nameMyServlet/servlet-name url-pattern/MyServlet/url-pattern /servlet-mapping Now, I simply call the servlet from the browser without the servlet keyword and everything works as expected. Thanks again for the suggestion. Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com Ph - 570-688-9600 Fx - 208-275-2301 -Original Message- From: Greg Trasuk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 9:01 AM To: 'Tomcat Users List' Subject: RE: Trouble with IMG tag, servlets, and JSPs Hi Ken: Are you accessing your servlets through the servlet invoker (i.e. http://host/MyApp/servlet/myserv ?) If so, then remember that from the browser's point of view, the 'current directory' of the page is 'http://host/MyApp/servlet'. When the browser sees a relative path, like 'images/myimage.jsp', it tries to load that relative to the servlet's path, so it comes up with 'http://host/MyApp/servlet/images/myimage.jsp', which doesn't exist. That's your 404 error in the logs. Same thing holds for style sheets and other resources. Solutions: 1- If you want to keep using the path '/servlet' (i.e. you don't want to define servlet mappings, or you need the path prefix to make sure Apache sends the request to Tomcat) then change your image links to '../images/myimage.jsp' 2- Use the getContextPath() call. 3- Define servlet mappings in your web.xml so that you reference the servlet with something like 'http://host/MyApp/myserv.srv', which puts the current path at your application root. 4- Put a hook into the top of the jsp page to forward the request to the servlet if the request came directly from the browser. Then the browser will simply load the url by 'http://host/MyApp/page.jsp' and the jsp forwards to the servlet by doing a jsp:forward ... directive. This is actually the way I do it, since it gets around some difficulties I have in my Apache configuration which make it hard to map servlets generically (nothing wrong with Apache or Tomcat; I just have a wierd virtual host configuration for other reasons), but easy to get JSP's called. I simply have the servlet drop an attribute called 'fromServlet' into the request object. If the jsp doesn't see this attribute, it forwards to the servlet, which then does its thing, drops in the 'fromServlet' attribute and forwards back to the same jsp. Then the jsp sees the attribute and handles the request itself. Good luck, Greg Trasuk, President StratusCom Manufacturing Systems Inc. - We use information technology to solve business problems on your plant floor. http://stratuscom.ca -Original Message- From: Ken Ramirez [mailto:[EMAIL PROTECTED]] Sent: February 27, 2002 00:13 To: [EMAIL PROTECTED] Subject: Trouble with IMG tag, servlets, and JSPs Hope someone can help: I'm having a problem loading images from a JSP page when the page is called from a servlet. I'm performing a forward from the servlet to the JSP, which then loads the images from a subdirectory in the app's directory as follows: TOMCAT_HOME/webapps/MyApp/*.jsp TOMCAT_HOME/webapps/MyApp/images/*.img The images are loaded from the JSP using the img tag as follows: img src=images/myimage.jpg I've also tried src=/images/myimage.jpg and this doesn't work. However, if I call the jpg directly, everything shows up fine. Of course in the real world, I need to get the forward to work so that I can pass data from the servlet to the JSP. I found some information in the mailing list's archive regarding this problem and someone suggested the following: IMG SRC=%=request.getContextPath()%/images/myimage.jpg This does work, but it just seems odd that you would have to do this, especially given the fact that there is a context entry for the app in the server.xml. Isn't the purpose of the Context entry to: 1. Create and associate a Context object with the App and 2. Establish the base path for the app. Seems kind of redundent that you would have to again retrieve the ContextPath yourself, when it seems that Tomcat should do this for us or the Browser should receive the problem path so that it knows where to get the images and CSS files from. Instead, what is actually sent back to the browser is the following path for the image: images/myimage.jpg Now what's interesting is that I looked in one of Tomcat's log files and found the following exception for the images: StandardWrapper[/MasterMind:org.apache.catalina.INVOKER.theme ]: Marking servlet org.apache.catalina.INVOKER.theme as unavailable 2002-02-26 20:53
ClassNotFoundException
Hope someone can help: I have a TOMCAT app containing a servlet as follows: TOMCAT_HOME/webapps/MyApp/WEB-INF/classes/com/mycomp/MyServletClass.cl ass This class extends a base class that provides common functionality for all of my apps, and is stored in: TOMCAT_HOME/common/classes/com/mycomp/MyBaseServletClass.class (which extends HttpServlet) Through some context information, the MyBaseServletClass receives the classname of a class stored in my app's classes directory, which it is responsible for creating an instance of, using Class.forName(). This is the path of the class to be created: TOMCAT_HOME/webapps/MyApp/WEB-INF/classes/com/mycomp/MyOtherClass.clas s When the MyServletClass calls Class.forName, it fails with a ClassNotFoundException, but if I move the MyServletClass to the MyApp/WEB-INF/classes path, everything works fine. What gives? I thought that Tomcat reads adds the classes directory for all of the apps deployed in the server.xml (with Context info), which I defined as follows: Context path=/MyApp docBase=MyApp debug=0 reloadable=true / Thanks, Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com http://www.mastermind.com/ Ph - 570-688-9600 Fx - 208-275-2301
Trouble with IMG tag, servlets, and JSPs
Hope someone can help: I'm having a problem loading images from a JSP page when the page is called from a servlet. I'm performing a forward from the servlet to the JSP, which then loads the images from a subdirectory in the app's directory as follows: TOMCAT_HOME/webapps/MyApp/*.jsp TOMCAT_HOME/webapps/MyApp/images/*.img The images are loaded from the JSP using the img tag as follows: img src=images/myimage.jpg I've also tried src=/images/myimage.jpg and this doesn't work. However, if I call the jpg directly, everything shows up fine. Of course in the real world, I need to get the forward to work so that I can pass data from the servlet to the JSP. I found some information in the mailing list's archive regarding this problem and someone suggested the following: IMG SRC=%=request.getContextPath()%/images/myimage.jpg This does work, but it just seems odd that you would have to do this, especially given the fact that there is a context entry for the app in the server.xml. Isn't the purpose of the Context entry to: 1. Create and associate a Context object with the App and 2. Establish the base path for the app. Seems kind of redundent that you would have to again retrieve the ContextPath yourself, when it seems that Tomcat should do this for us or the Browser should receive the problem path so that it knows where to get the images and CSS files from. Instead, what is actually sent back to the browser is the following path for the image: images/myimage.jpg Now what's interesting is that I looked in one of Tomcat's log files and found the following exception for the images: StandardWrapper[/MasterMind:org.apache.catalina.INVOKER.theme]: Marking servlet org.apache.catalina.INVOKER.theme as unavailable 2002-02-26 20:53:17 invoker: Cannot allocate servlet instance for path /MasterMind/servlet/theme/Master.css javax.servlet.ServletException: Wrapper cannot find servlet class theme or a class it depends on ... And in one of the other log files, I found the following error: 127.0.0.1 - - [26/Feb/2002:20:53:17 -0500] GET /MyApp/servlet/images/myimage.jpg HTTP/1.1 404 696 I'd like to get this to work without the hack I mentioned above. Does anyone have any suggestions? Thanks, Ken Ken Ramirez - Principal/CTO [EMAIL PROTECTED] Master-Mind Consulting Services http://www.mastermind.com http://www.mastermind.com/ Ph - 570-688-9600 Fx - 208-275-2301