Re: request and jsp:include
It was an error while typing the email when I try this in imprimir.jsp: jsp:include page=%=request.getParameter(pagina) % / And call this http://localhost:8080/imprimir.jsp?pagina=listado_clientes.jsp I got: org.apache.jasper.compiler.ParseException: E:\tomcat\webapps\ROOT\imprimir.jsp(9,50) atributo pagina no tiene valor (atributo pagina no tiene valor - attribute 'pagina' has no value) - Original Message - From: Jeff Kilbride [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 12:24 AM Subject: Re: request and jsp:include You're missing an = in your jsp:include statement. Try this: jsp:include page=%= request.getParameter(pagina) % / You have it correct in your second example, which is why that one works. Thanks, --jeff - Original Message - From: Antoni Reus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 4:58 AM Subject: request and jsp:include Hi, first of all I would like to excuse for my poor english. I'm using tomcat 3.2.2 in a Win NT 4 I'm trying to do some kinda printing template, so calling de template ( imprimir.jsp ) with a parameter for the page to show it whould display it in a printer friendly way. In imprimir.jsp is something like this: html ... ... jsp:include page=%request.getParameter(pagina) % / ... .. /html when I call localhost:8080/imprimir.jsp?pagina=listado.jsp I get a tomcat exception when parsing imprimir.jsp, saying that pagina has no value. But if I write imprimr.jsp this way: html ... ... %! String pagina = request.getParameter(pagina); % jsp:include page=%=pagina % / ... .. /html it works!! Someone could explain this???
RE: JSP mapping
Dim, Very nice, this tip solved my problem. I've added the line Context path= docbase=c:/winnt and now I can run root JSP file that are mapped to c\winnt. Actually, I've tried it before, but I was expecting to see the lines in the server.xml to be reflected in the tomcat-apache.conf file, as it was in other lines I have inserted to server.xml (for example: adding Context path=/MyJspDirectory docBase=c:/winnt / to server.xml caused Tomcat to add ( in it's restart ) the following lines to tomcat-apache.conf: Alias /MyJspDirectory c:/winnt Directory D:/j/webapps/test Options Indexes FollowSymLinks /Directory ApJServMount /MyJspDirectory/servlet /MyJspDirectory Location /MyJspDirectory/WEB-INF/ AllowOverride None deny from all /Location Directory c:/winnt/WEB-INF/ AllowOverride None deny from all /Directory Location /MyJspDirectory/META-INF/ AllowOverride None deny from all /Location Directory c:/winnt/META-INF/ AllowOverride None deny from all /Directory ) And since tomcat-apache.conf was not changed I didn't even try to check root JSPs. Although there is some anomaly here, it is working fine, thank you. ( Maybe the answer is in the tomcat-apache.conf line ApJServMount /servlet /ROOT that force Apache to mount root JSPs to Tomcat root directory, and then Tomcat, according to it's server.xml maps root files to c:\winnt ) All the best, Eitan -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:35 PM To: [EMAIL PROTECTED] Subject: Re: JSP mapping Eitan, Yep - editing tomcat-apache.conf by hand is a bad idea as it is generated by tomcat every time it starts, which would explain why your changes disappear (o: I'm assuming that in your server.xml you have a line Context path= docbase=webapps/ROOT or something similar? If you change the docbase in that to point to c:/winnt, you should be able to remove the context mapping you've put in atm and find that http://foo/bar.jsp will work (as will http://foo/servlet/myservletmapping). hope this does the trick cheers dim Eitan Ben Noach wrote: Thanks dim, I'm running Tomcat 3.2.2 with Apache 1.3 as HTTP server. No meter what I've tried to do on the tomact-apache.conf and server.xml files, Tomcat will not let me map root JSP files to a directory other then c:\jakarta-tomcat-3.2.3\webapps\root Is there any doc that defines the exact syntax of the ApJServMount directive? The user guide gives examples but does not specify the exact definition. I've tried the following at the tomact-apache.conf: ApJServMount / /MyJspDirectory and then in the server.xml define: Context path=/MyJspDirectory docBase=c:/winnt / When restarting Tomcat the line ApJServMount / /MyJspDirectory at the tomact-apache.conf had been removed! Trying the line: ApJServMount /servlet /MyJspDirectory has the same results Eitan -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:05 PM To: [EMAIL PROTECTED] Subject: Re: JSP mapping Eitan, Are you running standalone or with a web server? Assuming you're running standalone, and that there's not much else you're using tomcat for, all you need to do is remove the /MyJspDirectory from the context path and it should work fine. cheesr dim Eitan Ben Noach wrote: HI, I want to map JSPs called by browser at the http server root, like http://victoria.xx.yy/zz.jsp to be handled by JSP file that is located some were else then the default c:\jakarta-tomcat-3.2.3\webapps\root\zz.jsp, for example by c:\winnt\zz.jsp. I've succeeded on configuring Tomcat to handle JSP files at the context path /MyJspDirectory to be handled by JSP files at the c:\winnt directory by changing the server.xml file by defining: Context path=/MyJspDirectory docBase=c:/winnt / In that way the browser link http://victoria.xx.yy/MyJspDirectory/zz.jsp is handles by c:\winnt\zz.jsp. How can I do the same for the link http://victoria.xx.yy/zz.jsp ? It seems that it should be solved through the ApJServMount and Alias directives as well as the server.xml ( and maybe web.xml ), but how? Thanks - Eitan Ben-Noach Proficiency, Ltd. Tel: +972.2.548.0287 Fax: +972.2.586.3871 email: [EMAIL PROTECTED] The Intelligence in Engineering Supply Chain Collaboration http://www.proficiency.com/ - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday,
Re: request and jsp:include
I get the error with flush=true too. - Original Message - From: Antoni Reus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 8:31 AM Subject: Re: request and jsp:include It was an error while typing the email when I try this in imprimir.jsp: jsp:include page=%=request.getParameter(pagina) % / And call this http://localhost:8080/imprimir.jsp?pagina=listado_clientes.jsp I got: org.apache.jasper.compiler.ParseException: E:\tomcat\webapps\ROOT\imprimir.jsp(9,50) atributo pagina no tiene valor (atributo pagina no tiene valor - attribute 'pagina' has no value) - Original Message - From: Jeff Kilbride [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 12:24 AM Subject: Re: request and jsp:include You're missing an = in your jsp:include statement. Try this: jsp:include page=%= request.getParameter(pagina) % / You have it correct in your second example, which is why that one works. Thanks, --jeff - Original Message - From: Antoni Reus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 4:58 AM Subject: request and jsp:include Hi, first of all I would like to excuse for my poor english. I'm using tomcat 3.2.2 in a Win NT 4 I'm trying to do some kinda printing template, so calling de template ( imprimir.jsp ) with a parameter for the page to show it whould display it in a printer friendly way. In imprimir.jsp is something like this: html ... ... jsp:include page=%request.getParameter(pagina) % / ... .. /html when I call localhost:8080/imprimir.jsp?pagina=listado.jsp I get a tomcat exception when parsing imprimir.jsp, saying that pagina has no value. But if I write imprimr.jsp this way: html ... ... %! String pagina = request.getParameter(pagina); % jsp:include page=%=pagina % / ... .. /html it works!! Someone could explain this???
Re: JSP mapping
Eitan, Glad it worked. Maybe I'll summarize the process a little more clearly. To change the configuration: 1. Change server.xml to your desired config. 2. Stop tomcat 3. Start tomcat 4. At this point tomcat generates a new tomcat-apache.conf 5. Test the new config using apachectl configtest 6. Restart apache using apachectl graceful 7. When apache restarts, it will reload its config, including the tomcat-apache.conf hope this helps some ppl as well as you (o: cheesr dim On Tue, 19 Jun 2001 17:34, you wrote: Dim, Very nice, this tip solved my problem. I've added the line Context path= docbase=c:/winnt and now I can run root JSP file that are mapped to c\winnt. Actually, I've tried it before, but I was expecting to see the lines in the server.xml to be reflected in the tomcat-apache.conf file, as it was in other lines I have inserted to server.xml (for example: adding Context path=/MyJspDirectory docBase=c:/winnt / to server.xml caused Tomcat to add ( in it's restart ) the following lines to tomcat-apache.conf: Alias /MyJspDirectory c:/winnt Directory D:/j/webapps/test Options Indexes FollowSymLinks /Directory ApJServMount /MyJspDirectory/servlet /MyJspDirectory Location /MyJspDirectory/WEB-INF/ AllowOverride None deny from all /Location Directory c:/winnt/WEB-INF/ AllowOverride None deny from all /Directory Location /MyJspDirectory/META-INF/ AllowOverride None deny from all /Location Directory c:/winnt/META-INF/ AllowOverride None deny from all /Directory ) And since tomcat-apache.conf was not changed I didn't even try to check root JSPs. Although there is some anomaly here, it is working fine, thank you. ( Maybe the answer is in the tomcat-apache.conf line ApJServMount /servlet /ROOT that force Apache to mount root JSPs to Tomcat root directory, and then Tomcat, according to it's server.xml maps root files to c:\winnt ) All the best, Eitan -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:35 PM To: [EMAIL PROTECTED] Subject: Re: JSP mapping Eitan, Yep - editing tomcat-apache.conf by hand is a bad idea as it is generated by tomcat every time it starts, which would explain why your changes disappear (o: I'm assuming that in your server.xml you have a line Context path= docbase=webapps/ROOT or something similar? If you change the docbase in that to point to c:/winnt, you should be able to remove the context mapping you've put in atm and find that http://foo/bar.jsp will work (as will http://foo/servlet/myservletmapping). hope this does the trick cheers dim Eitan Ben Noach wrote: Thanks dim, I'm running Tomcat 3.2.2 with Apache 1.3 as HTTP server. No meter what I've tried to do on the tomact-apache.conf and server.xml files, Tomcat will not let me map root JSP files to a directory other then c:\jakarta-tomcat-3.2.3\webapps\root Is there any doc that defines the exact syntax of the ApJServMount directive? The user guide gives examples but does not specify the exact definition. I've tried the following at the tomact-apache.conf: ApJServMount / /MyJspDirectory and then in the server.xml define: Context path=/MyJspDirectory docBase=c:/winnt / When restarting Tomcat the line ApJServMount / /MyJspDirectory at the tomact-apache.conf had been removed! Trying the line: ApJServMount /servlet /MyJspDirectory has the same results Eitan -Original Message- From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:05 PM To: [EMAIL PROTECTED] Subject: Re: JSP mapping Eitan, Are you running standalone or with a web server? Assuming you're running standalone, and that there's not much else you're using tomcat for, all you need to do is remove the /MyJspDirectory from the context path and it should work fine. cheesr dim Eitan Ben Noach wrote: HI, I want to map JSPs called by browser at the http server root, like http://victoria.xx.yy/zz.jsp to be handled by JSP file that is located some were else then the default c:\jakarta-tomcat-3.2.3\webapps\root\zz.jsp, for example by c:\winnt\zz.jsp. I've succeeded on configuring Tomcat to handle JSP files at the context path /MyJspDirectory to be handled by JSP files at the c:\winnt directory by changing the server.xml file by defining: Context path=/MyJspDirectory docBase=c:/winnt / In that way the browser link
ajp12[1]: cannot scan servlet headers
Hi, tomcat-gurus! We're running tomcat 3.1/apache 1.3.9 on a AIX 4.3 system. So far this has been working ok though we're facing the problem that our servlets are being reloaded at least once or twice a day. The user then receives the message Internal server error. In the file mod_jserv.log I find the entry [18/06/2001 12:06:07:994] (EMERGENCY) ajp12[1]: cannot scan servlet headers (500) [18/06/2001 12:06:07:994] (ERROR) an error returned handling request via protocol ajpv12 Has anyone seen this problem before and knows how to solve it? Any help is greatly appreciated. Thanks in advance, Carsten
Help Required on Apache-Tomcat Architecture
Hello EveryBody, Well we are working on an Appache -Tomcat architecture.Basically we wanted to know how is the performance issue on these servers.Actually we have to support 2000 users.We want to know will this web server and application server combination can support 2000 users.We will be highly obliged to the person who shares his experiences in Apache-Tomcat architecture with us. Thanks in advance
AW: Help Required on Apache-Tomcat Architecture
The number of users doesn't mean much unless you provide some numbers about their activity and the type of application you are runing. What numbers of users tomcat can serve depends on several parameters: the number of requests per second the number of bytes sent per request the number of concurrent users the hardware tomcat is running on the linespeed of the internet connection the type of your application (1000 requests to hello.world are quite different to 1000 requests to get all products that match *abc* from a database) -Ursprüngliche Nachricht- Von: Bhootnath Singh [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 2. Juni 2000 14:16 An: '[EMAIL PROTECTED]' Betreff: Help Required on Apache-Tomcat Architecture Hello EveryBody, Well we are working on an Appache -Tomcat architecture.Basically we wanted to know how is the performance issue on these servers.Actually we have to support 2000 users.We want to know will this web server and application server combination can support 2000 users.We will be highly obliged to the person who shares his experiences in Apache-Tomcat architecture with us. Thanks in advance
Apache and Tomcat
Hi all, I want to use Tomcate with apache. I made several Tomcat context of which Proto4980 and a4980web. I have no problem when I access to the projects with Tomcat HttpConnector. I have no problem when I access to the first project (proto4980) with ajp12 connector. But when I use ajp12 connector for my second project (a4980web), I can't download all page except jsp pages. I use the two context with the sameconfiguration. (mode_jk_auto_conf) Any body knows what appens ? Thank you
RE: newbie: Installing Servlets
Thanx Dan. I will certainly keep that in mind. Cheers mate, L -Original Message- From: Daniel Koo [mailto:[EMAIL PROTECTED]] Sent: 19 June 2001 02:35 To: [EMAIL PROTECTED] Subject: Re: newbie: Installing Servlets Hi there, once you're comfortable with the basics I suggest you have a look at the Jakarta Ant project, and the docs in the ROOT webapp in the basics of using it: ant reduces the amount of work you have to do moving/copying files into and out of directories. dan On Mon, Jun 18, 2001 at 06:47:48PM +0100, LeRoi wrote: Yup! That worked. Part of the problem for me is that the book I'm using to learn Java was written just before the Java web server was released to Jakarta. Innyway, you've saved me from lots of work until I need to. I'm I've been reading the documentation on deploying an application. For a newbie, it's a bit overwhelming right now just to test a simple example. Cheer mate! LeRoi -Original Message- From: Francis Callo [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 18:06 To: [EMAIL PROTECTED] Subject: Re: newbie: Installing Servlets Hi, if you have a servlet named HelloWorldi believe you have to put your classes on webapps/examples/WEB-INF/classes/ and access it with URL http://localhost:8080/examples/servlet/HelloWorld; Let me know if it works. ;) GUD LUK Francis --- LeRoi [EMAIL PROTECTED] wrote: Hello! Now that I have Tomcat up and running, it's time that I starting doing some real work. Following a simple example in the book I'm using it says that servlets are installed in the subdirectory webapps\WEB-INF\servlets. I put my class there (under examples directory of Tomcat) and shut down Tomcat and re-started it. Below is the code for textbook example: // Fig. 19.5: HTTPGetServlet.java // Creating and sending a page to the client import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class HTTPGetServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter output; response.setContentType(text/html); // content type output = response.getWriter(); // get writer // create and send HTML page to client StringBuffer buf = new StringBuffer(); buf.append(HTMLHEADTITLE\n); buf.append(A simple Servlet Example\n); buf.append(/TITLE/HEADBODY\n); buf.append(H1Welcome to Servlets!/H1\n); buf.append(/BODY/HTML); output.println(buf.toString()); output.close(); // close PrintWriter stream } } !-- Fig. 19.6: HTTPGetServlet.html -- HTML HEAD TITLE Servlet HTTP GET Example /TITLE /HEAD BODY FORM ACTION=http://localhost:8080/servlets/HTTPGetServlet; METHOD=GET PClick the button to have the servlet send an HTML document/P INPUT TYPE=submit VALUE=Get HTML Document /FORM /BODY /HTML Well, it didn't work. My question is, in order to install this simple servlet does that mean I have to go through all the steps as given in the documentation for Developing Applications with Tomcat? Cheers and many thanx in advance, LeRoi __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/ -- [EMAIL PROTECTED] Computer Science and Engineering, UNSW
java.lang.IllegalStateException: Response has already been committed
Hello, Maybe comeone can help me, I have a problem with a JSP : Error: 500 Location: /dev/jsp/Homepage/createmember.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157) at org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411) at java.lang.Thread.run(Thread.java:475) Here is my JSP: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN %@ include file = getconnection.jsp% %@ page import = java.security.Key.*, java.io.*, java.security.*, java.security.cert.*, java.util.*, com.ct.ordres.admin.logic.*, com.ct.ordres.site.logic.*, sun.misc.* % html head titleCreate a member in the database/title %@ include file=detect.jsp % /head body bgcolor=#FF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad= % try { MyConnection con = getConnection(request, response); // New member MyClient client = new MyClient(); client.setNOMCLI(request.getParameter(name)); client.setAD1CLI(request.getParameter(adress)); client.setVILCLI(request.getParameter(city)); // Create the member client.insert(con); MyClientSession ctclientsession = new MyClientSession(); ctclientsession.setClient(client); MyContext.setClientSession(session, ctclientsession); % jsp:forward page=membercreated.jsp jsp:param name=IDClient value=%= client.getIDCLI() % / /jsp:forward % } catch (Exception e) { out.print(brErreur : b+e+/b); } % /body /html -- ___ FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Make PC-to-Phone calls with Net2Phone. Sign-up today at: http://www.net2phone.com/cgi-bin/link.cgi?121
Re: java.lang.IllegalStateException: Response has already been committed
I had this Exception before, But I'm very sorry I could not resolve it, I simply reinstall all my configuration to resolve it. So I'm interested by the answers of your question too. Mathias Robert De Niro wrote: Hello, Maybe comeone can help me, I have a problem with a JSP : Error: 500 Location: /dev/jsp/Homepage/createmember.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:157) at org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411) at java.lang.Thread.run(Thread.java:475) Here is my JSP: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN %@ include file = getconnection.jsp% %@ page import = java.security.Key.*, java.io.*, java.security.*, java.security.cert.*, java.util.*, com.ct.ordres.admin.logic.*, com.ct.ordres.site.logic.*, sun.misc.* % html head titleCreate a member in the database/title %@ include file=detect.jsp % /head body bgcolor=#FF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad= % try { MyConnection con = getConnection(request, response); // New member MyClient client = new MyClient(); client.setNOMCLI(request.getParameter(name)); client.setAD1CLI(request.getParameter(adress)); client.setVILCLI(request.getParameter(city)); // Create the member client.insert(con); MyClientSession ctclientsession = new MyClientSession(); ctclientsession.setClient(client); MyContext.setClientSession(session, ctclientsession); % jsp:forward page=membercreated.jsp jsp:param name=IDClient value=%= client.getIDCLI() % / /jsp:forward % } catch (Exception e) { out.print(brErreur : b+e+/b); } % /body /html -- ___ FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Make PC-to-Phone calls with Net2Phone. Sign-up today at: http://www.net2phone.com/cgi-bin/link.cgi?121
Re: java.lang.IllegalStateException: Response has already been committed
You cannot forward a request when you have started writing. - Original Message - From: Robert De Niro [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 11:11 AM Subject: java.lang.IllegalStateException: Response has already been committed Hello, Maybe comeone can help me, I have a problem with a JSP : Error: 500 Location: /dev/jsp/Homepage/createmember.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon seFacade.java:157) at org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection (Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpWorkerThread.run(PoolTcpEndpoint.java:366) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:411) at java.lang.Thread.run(Thread.java:475) Here is my JSP: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN %@ include file = getconnection.jsp% %@ page import = java.security.Key.*, java.io.*, java.security.*, java.security.cert.*, java.util.*, com.ct.ordres.admin.logic.*, com.ct.ordres.site.logic.*, sun.misc.* % html head titleCreate a member in the database/title %@ include file=detect.jsp % /head body bgcolor=#FF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad= % try { MyConnection con = getConnection(request, response); // New member MyClient client = new MyClient(); client.setNOMCLI(request.getParameter(name)); client.setAD1CLI(request.getParameter(adress)); client.setVILCLI(request.getParameter(city)); // Create the member client.insert(con); MyClientSession ctclientsession = new MyClientSession(); ctclientsession.setClient(client); MyContext.setClientSession(session, ctclientsession); % jsp:forward page=membercreated.jsp jsp:param name=IDClient value=%= client.getIDCLI() % / /jsp:forward % } catch (Exception e) { out.print(brErreur : b+e+/b); } % /body /html -- ___ FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Make PC-to-Phone calls with Net2Phone. Sign-up today at: http://www.net2phone.com/cgi-bin/link.cgi?121
problem reloading servlet
hello, I have the following configuration: I use a 3.1 version, with Apache 1.3.12, on Digital Unix, with a JDK 1.2.2 One of my tomcat'users modifies very frequently it's servlet. Everything works fine, with RELOAD !!! messages at the console, but, suddently, Tomcat stops to reload the servlet. I have to stop it and restart it. I don't have any special message in the logs. any idea ? Thanks a lot __ | Henri Delebecque[EMAIL PROTECTED] | | Webmaster | | Supelec Tel (33) 01.69.85.14.91 | | 3 rue Joliot-Curie | | Plateau de Moulon Fax:(33) 01.69.85.12.34 | | 91190 Gif sur Yvette| | FRANCE | |_|
Context.log - filename
Hello Gurus, I've came across a little trouble - my context.log is stored in catalina_log_date.log file, but i can see that examples web-app stores its logs in localhost_examples_log_date.log file. Could i anyhow to make catalina to log my context.log in a separate file than localhost_log. I guess it is easy but i can't catch it. Thanks in advance) -- Best regards, Andrew
Tomcat 3.2.2 and Xerces
Hi There, I'm new to the group - apologies if this has been asked 100 times before. I'm writing a web application that parses an XML file with SAX in order to retrieve database connection details. The beans responsible for this make use of the xerces XML parser. Testing the beans in JBuilder, everything works fine. When I compile the class files and attempt to invoke the methods through a jsp page in Tomcat, it throws a java.lang.NoClassDefFoundError error. I've been scouring Deja and the tomcat documentation. It sounds like I can't use another XML parser on top of the one tomcat uses to parse its configuration information. Is this correct? If this is the case, is the only solution to re-write the SAX parser bean to make use of JAXP? Thanks in advance, Ben --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.262 / Virus Database: 132 - Release Date: 12/06/2001
Define the /var/www to serve .jsp ?
Dear All, Sorry for my stupid question, and I'm new to JSP Servlet. Hereare my questions. Is it good to set the Apache's document root to pass .jsp to Tomcat ? Or I need to define a folder under $TOMCAT_HOME/webapps/"my new folder" , and putting all of my.jsp inside ? It look like Tomcat treatfolders inside $TOMCAT_HOME/webapps/ as an application ? Rgds, Dino
Tomcat 3.2.2 Vs Tomcat3.1.1
Hi all, I am using Tomcat 3.1.1 with IIS and want to upgrade my application to 3.2.2 version. Any Info on the major changes to be done for this would be helpful. Thanks in Advance Govind
Re: Tomcat 3.2.2 and Xerces
If it was an inbuilt limitation of Tomcat, I wouldn't expect to see a ClassDefNotFoundExceptionare you sure you've put your xerces parser .jar file in the WEB-INF/lib directory of your webapp? Also Mail Archive does have a search facility for this list. Its pretty crap but its better than nothing :-) sam - Original Message - From: Ben Rometsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 3:08 PM Subject: Tomcat 3.2.2 and Xerces Hi There, I'm new to the group - apologies if this has been asked 100 times before. I'm writing a web application that parses an XML file with SAX in order to retrieve database connection details. The beans responsible for this make use of the xerces XML parser. Testing the beans in JBuilder, everything works fine. When I compile the class files and attempt to invoke the methods through a jsp page in Tomcat, it throws a java.lang.NoClassDefFoundError error. I've been scouring Deja and the tomcat documentation. It sounds like I can't use another XML parser on top of the one tomcat uses to parse its configuration information. Is this correct? If this is the case, is the only solution to re-write the SAX parser bean to make use of JAXP? Thanks in advance, Ben snip
how protect a servlet?
Hi, every body I have the following problem: I would like protect a servlet with AuthType Basic, for apachedisplay the dialog "login/pass". my directory whereis my servlet is: C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class the file: AdministrationServlet.class is the servlet that I would likeprotect. my directory where is the file htttp.conf is: C:/apache/conf/httpd.conf what I must put in the file http.conf to protect the servlet AdministrationServlet.class thanks in advance... I use apache Version 1.3 and tomcat 3.2.1 please help me atte. harold arando
Re: Define the /var/www to serve .jsp ?
When using tomcat and apache, you simply set up a new document root and mapping within httpd.conf for each webapp you want accessable via Apache. When you run tomcat, it automatically generates the Apache directives required to use Apache and Tomcat together uising mod_jk - look at the file mod_jk.conf-auto. This file is overwritten whenever tomcat is restarted, so don't edit it directly. For more info check the mod_jk-howto included with the tomcat distro. sam - Original Message - From: Dino Ming To: TomCat User Sent: Tuesday, June 19, 2001 3:13 PM Subject: Define the /var/www to serve .jsp ? Dear All, Sorry for my stupid question, and I'm new to JSP Servlet. Hereare my questions. Is it good to set the Apache's document root to pass .jsp to Tomcat ? Or I need to define a folder under $TOMCAT_HOME/webapps/"my new folder" , and putting all of my.jsp inside ? It look like Tomcat treatfolders inside $TOMCAT_HOME/webapps/ as an application ? Rgds, Dino
RE: Tomcat 3.2.2 and Xerces
Sorry. Asleep at the wheel. I didn't see this earlier. The problem is that Tomcat uses a different xml parser than xerces and there is a version conflict of some sort that I knew back when I had the problem but have since forgotten. To fix, the easiest way is to modify the tomcat.bat or tomcat.sh file in the way the CLASSPATH is created. Simply put your CLASSPATH defs before the ones that are added by the script. There should be a line like this CP = CP + CLASSPATH just flip it around CP = CLASSPATH + CP excuse the non-standard syntax, but hopefully you get the idea. This lets xerces be found first and the world is good. Chris -Original Message- From: Sam Newman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 10:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Tomcat 3.2.2 and Xerces If it was an inbuilt limitation of Tomcat, I wouldn't expect to see a ClassDefNotFoundExceptionare you sure you've put your xerces parser .jar file in the WEB-INF/lib directory of your webapp? Also Mail Archive does have a search facility for this list. Its pretty crap but its better than nothing :-) sam - Original Message - From: Ben Rometsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 3:08 PM Subject: Tomcat 3.2.2 and Xerces Hi There, I'm new to the group - apologies if this has been asked 100 times before. I'm writing a web application that parses an XML file with SAX in order to retrieve database connection details. The beans responsible for this make use of the xerces XML parser. Testing the beans in JBuilder, everything works fine. When I compile the class files and attempt to invoke the methods through a jsp page in Tomcat, it throws a java.lang.NoClassDefFoundError error. I've been scouring Deja and the tomcat documentation. It sounds like I can't use another XML parser on top of the one tomcat uses to parse its configuration information. Is this correct? If this is the case, is the only solution to re-write the SAX parser bean to make use of JAXP? Thanks in advance, Ben snip
RE: Define the /var/www to serve .jsp ?
You can just edit %tomcat_home%/conf/server.xml and set the docBase to be wherever you have your apache files located. You can specify this for each virtual host you have set up though apache. If you need examples or anything, just send me an email. Brandon CruzNorvax Inc.www.norvax.com -Original Message-From: Sam Newman [mailto:[EMAIL PROTECTED]]Sent: Tuesday, June 19, 2001 9:25 AMTo: [EMAIL PROTECTED]Subject: Re: Define the /var/www to serve .jsp ? When using tomcat and apache, you simply set up a new document root and mapping within httpd.conf for each webapp you want accessable via Apache. When you run tomcat, it automatically generates the Apache directives required to use Apache and Tomcat together uising mod_jk - look at the file mod_jk.conf-auto. This file is overwritten whenever tomcat is restarted, so don't edit it directly. For more info check the mod_jk-howto included with the tomcat distro. sam - Original Message - From: Dino Ming To: TomCat User Sent: Tuesday, June 19, 2001 3:13 PM Subject: Define the /var/www to serve .jsp ? Dear All, Sorry for my stupid question, and I'm new to JSP Servlet. Hereare my questions. Is it good to set the Apache's document root to pass .jsp to Tomcat ? Or I need to define a folder under $TOMCAT_HOME/webapps/"my new folder" , and putting all of my.jsp inside ? It look like Tomcat treatfolders inside $TOMCAT_HOME/webapps/ as an application ? Rgds, Dino
UNSUSCRIBE
UNSUSCRIBEGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: how protect a servlet?
I believe you need a Location directive in httpd.conf. You would have something like: Location /mywebapp AuthName myauth AuthType Basic AuthUserFile /path/to/myauthfile require valid-user /Location Of course, replace mywebapp as appropriate. Sounds like you may want to protect just one servlet in your app. If so, adjust the Location appropriately. Just keep in mind that location deals with the url path, not the real path on your file system. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Tue, 19 Jun 2001 10:20:52 -0400, Harold Arando wrote: Hi, every body I have the following problem: I would like protect a servlet with AuthType Basic, for apache display the dialog login/pass. my directory where is my servlet is: C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class the file: AdministrationServlet.class is the servlet that I would like protect. my directory where is the file htttp.conf is: C:/apache/conf/httpd.conf what I must put in the file http.conf to protect the servlet AdministrationServlet.class thanks in advance... I use apache Version 1.3 and tomcat 3.2.1 please help me atte. harold arando
Re: Define the /var/www to serve .jsp ?
Hi Brandon Cruz, It is good to have an example for me to start. Please. I didn't need to setting up the Virtual host for my apache. And I commented all other Context Path out, and added the following. Is this correct ? Context path="." docBase="/var/www" crossContext="false" debug="0" reloadable="true" /Context Rgds, Dino - Original Message - From: Brandon Cruz To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 10:34 PM Subject: RE: Define the /var/www to serve .jsp ? You can just edit %tomcat_home%/conf/server.xml and set the docBase to be wherever you have your apache files located. You can specify this for each virtual host you have set up though apache. If you need examples or anything, just send me an email. Brandon CruzNorvax Inc.www.norvax.com -Original Message-From: Sam Newman [mailto:[EMAIL PROTECTED]]Sent: Tuesday, June 19, 2001 9:25 AMTo: [EMAIL PROTECTED]Subject: Re: Define the /var/www to serve .jsp ? When using tomcat and apache, you simply set up a new document root and mapping within httpd.conf for each webapp you want accessable via Apache. When you run tomcat, it automatically generates the Apache directives required to use Apache and Tomcat together uising mod_jk - look at the file mod_jk.conf-auto. This file is overwritten whenever tomcat is restarted, so don't edit it directly. For more info check the mod_jk-howto included with the tomcat distro. sam - Original Message - From: Dino Ming To: TomCat User Sent: Tuesday, June 19, 2001 3:13 PM Subject: Define the /var/www to serve .jsp ? Dear All, Sorry for my stupid question, and I'm new to JSP Servlet. Hereare my questions. Is it good to set the Apache's document root to pass .jsp to Tomcat ? Or I need to define a folder under $TOMCAT_HOME/webapps/"my new folder" , and putting all of my.jsp inside ? It look like Tomcat treatfolders inside $TOMCAT_HOME/webapps/ as an application ? Rgds, Dino
How to upload a binary file?
Hi there, I am trying to upload a file from the client to the server. But the binary files fail and the text files don´t fail. I use tomcat 3.2.1 with apj12, on NT4.0 The bean and the jsp file i use are in attachment... regards jfolha upload.java doc_entrega_autor.jsp
distributable servlet in Tomcat3.2
Hello, I've read on this list that Tomcat 3.2 supports serializing sessions attributes. I wanted to try it, but could not find more information on the subject here. So I tried to do it according to the servlet 2.2 specification. As it is not working, I try to sum-up here what I've done: I have installed 2 Tomcat 3.2 on the same machine (taking care that the 2nd Tomcat starts on port 8081), and for each of them, I have built a very simple session webapp : - session/ - WEB-APP/ web.xml - classes/ SessionServlet.class The web.xml looks like: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app distributable /distributable servlet servlet-namesession/servlet-name servlet-classSessionServlet/servlet-class /servlet servlet-mapping servlet-namesession/servlet-name url-pattern/session/url-pattern /servlet-mapping /web-app For the firt Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 1 output); ServletContext servletContext = this.getServletContext(); servletContext.setAttribute(foo,abcdef..foo); out.println(attribute foo, with value abcde...foo, added in ServletContext); HttpSession httpSession = req.getSession(); httpSession.setAttribute(bar,abcde...bar); out.println(attribute bar, with value abcde...bar, added in HttpSession); out.close(); } } For the second Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 2 Output); ServletContext servletContext = this.getServletContext(); String foo = (String) servletContext.getAttribute(foo); out.println(foo=+ foo + (get from ServletContext)); HttpSession httpSession = req.getSession(); String bar = (String) httpSession.getAttribute(bar); out.println(bar=+ bar + (get from HttpSession)); out.close(); } } Requesting respectively the first servlet, and the second serlvet did not give the expected results: http://127.0.0.1:8080/session/servlet/SessionServlet SessionServlet 1 output attribute foo, with value abcde...foo, added in ServletContext attribute bar, with value abcde...bar, added in ServletContext http://127.0.0.1:8081/session/servlet/SessionServlet SessionServlet 2 Output foo=null (get from ServletContext) bar=null (get from HttpSession) So did I made a mistake, did I forget something, or is it simply not possible to do it ? Thanks for any help ! Xavier Marjou __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/
omegacms
Hello, has any one tried installing omegacms on tomcat. I have a fresh install of tomcat 3.2.2 that is working fine on redhat linux 7.1. The app cannot find it's properties file no matter where I put it. Unfortunately, it seems to be closed source so I can't figure out where it is trying to look for the conf.properties file. The error message I get from Tomcat is : config.properties not found when trying to load properties: config.properties in ./bin/../lib/test//usr/java/jdk1.3.1/ The docs say to have config.properties in the classpath, so I put it in myApp/WEB-INF/classes, I even tried putting it in TOMCAT_HOME/lib to no avail. Why Oh Why don't people use the jsp/servlet specs on directory structure organization? Anyone experienced in making this thing work? Thanks in Advance -- Vincent Stoessel [EMAIL PROTECTED] Internet Applications Engineer IDEV http://www.idev.com V: 301 495 7345 x129
omegacms
Hello, has any one tried installing omegacms on tomcat? I have a fresh install of tomcat 3.2.2 that is working fine on redhat linux 7.1. The app cannot find it's properties file no matter where I put it. Unfortunately, it seems to be closed source so I can't figure out where it is trying to look for the conf.properties file. The error message I get from Tomcat is : config.properties not found when trying to load properties: config.properties in ./bin/../lib/test//usr/java/jdk1.3.1/ The docs say to have config.properties in the classpath, so I put it in myApp/WEB-INF/classes, I even tried putting it in TOMCAT_HOME/lib to no avail. Why Oh Why don't people use the jsp/servlet specs on directory structure organization? Anyone experienced in making this thing work? Thanks in Advance Vincent
RE: UNSUSCRIBE
pas mieux. -Message d'origine- De: jianqing wang [mailto:[EMAIL PROTECTED]] Date: mardi 19 juin 2001 16:39 À: [EMAIL PROTECTED] Objet: UNSUSCRIBE UNSUSCRIBE _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com http://www.hotmail.com .
RE: omegacms
If you're on UNIX, add it to TOMCAT_HOME/classes, if you're on NT you'll need to modify the tomcat.bat file so that Tomcat adds this directory to its automatically built classpath. Another option it to add the conf.properties to the CLASSPATH environment variable. In either case, there are some ways that you can request resources that cause the wrong class loader to be used, which it seems is happening here. Since its closed source, there really is no way around this. Randy -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:17 AM To: Tomcat Users Subject: omegacms Hello, has any one tried installing omegacms on tomcat. I have a fresh install of tomcat 3.2.2 that is working fine on redhat linux 7.1. The app cannot find it's properties file no matter where I put it. Unfortunately, it seems to be closed source so I can't figure out where it is trying to look for the conf.properties file. The error message I get from Tomcat is : config.properties not found when trying to load properties: config.properties in ./bin/../lib/test//usr/java/jdk1.3.1/ The docs say to have config.properties in the classpath, so I put it in myApp/WEB-INF/classes, I even tried putting it in TOMCAT_HOME/lib to no avail. Why Oh Why don't people use the jsp/servlet specs on directory structure organization? Anyone experienced in making this thing work? Thanks in Advance -- Vincent Stoessel [EMAIL PROTECTED] Internet Applications Engineer IDEV http://www.idev.com V: 301 495 7345 x129
Re: Apache Default Document is .jsp?
Yeah, I thought so too, but it needed the dummy file in the static directory before it actually worked for me. I will check into using mod_rewrite -- sounds like a good idea. Thanks to both of you. :) -Scott - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 7:24 PM Subject: Re: Apache Default Document is .jsp? I would have thought that if you change the DirectoryIndex instruction (I think thats it) in the httpd.conf to use index.jsp first, and you have mounted *.jsp to go to tomcat then it should work. haven't done it myself though. cheers dim On Tue, 19 Jun 2001 10:40, you wrote: Hello, I'm getting ready to setup tomcat and Apache on seperate machines. Before getting started on that project, on my development machine, I set the default DocumentRoot for apache to a different directory (for static content) than my webapp (which will eventually sit on a different machine). I'd like to have my login.jsp be my default document, but was only able to get it to work by putting a dummy login.jsp in the HTML directory... Otherwise, Apache would just show a normal index of the directory... Is this the only way to get this to work? Or am I missing somthing? BTW, I'm on Tomcat 3.2.1 and Apache 1.3.19... Thanks for any ideas. Cheers, Scott
Re: Invalid command 'WebAppMount'
Instead of WebAppMount you should (I think the docs have not been updated) use WebAppDeploy. -v - Original Message - From: Jari Salmela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 11:01 PM Subject: Invalid command 'WebAppMount' Hi, I get this message when I try to startup apache: Invalid command 'WebAppMount', perhaps mis-spelled or defined by a module not included in the server configuration If I comment out WebAppMount line then Apache starts. WebAppConnection line works, but WebAppMount line doesn´t, this don´t make any sense for me. Have anyone of you faced this kind of problem? I have RH Linux 7.1, Apache 1.3.19 and Tomcat 4b5. -jari
duplicate posts
I'm running Tomcat 3.2.1 I have a servlet that receives posted data from a client. Some times I receive duplicate posts (the data is exactly the same...the message can't be because of some unique attributes included with the data). The client claims they are not sending duplicate messages so I'm wondering if any of you out there have ever encountered this problem. It doesn't happen all the time but it is happening. I have checked my servlet log (stdout.log) and from my servlet's point of view I am receiving 2 separate distinct posts (time stamp is milliseconds apart). Any advice? Thanks, Scott
how to make a war file?
Hi :-) could anybody tell me how to put a myapp/Servlet-context into a war file? I can do something similar with J2EERI, but I don't know how to do it by myself: - is war-file a jar-file? - which command/tool can I use to do it? thanks in advance! Bo June 19, 2001
Re: JSP Examples Error 500
Hi, I'm having a similar error... Error: 500 Location: /examples/jsp/num/numguess.jsp Internal Servlet Error: javax.servlet.ServletException: sun/tools/javac/Main at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)... and on and on. Where do you set the JAVA_HOME Environment variable? I'm a newbie, can you tell? Dan [EMAIL PROTECTED] 06/15/01 11:43PM Hi, Have you set JAVA_HOME Environment variable pointing to jdk? HTH Moin Baker, Gary wrote: Hi, I've installed tomcat binaries and I'm running it in standalone mode. The servlets on the samples page works but I get error 500 on the jsp examples. I've read the FAQ, searched archives, etc, and I've found many similar problems but very few answers. Any help would be greatly appreciated! Thanks, Gary DETAILS : [/export/home/gmb/tomcat/jakarta-tomcat-3.2.2] % echo $JAVA_HOME /usr/j2se [/export/home/gmb/tomcat/jakarta-tomcat-3.2.2] % echo $CLASSPATH CLASSPATH: Undefined variable. [/export/home/gmb/tomcat/jakarta-tomcat-3.2.2] % ./bin/startup.sh Guessing TOMCAT_HOME from tomcat.sh to ./bin/.. Setting TOMCAT_HOME to ./bin/.. Using classpath: ./bin/../lib/ant.jar:./bin/../lib/jasper.jar:./bin/../lib/jaxp.jar:./bin/../lib/parser.jar:./bin/../lib/servlet.jar:./bin/../lib/test:./bin/../lib/webserver.jar:/usr/j2se/lib/tools.jar [/export/home/gmb/tomcat/jakarta-tomcat-3.2.2] % 2001-06-15 04:35:26 - ContextManager: Adding context Ctx( /examples ) 2001-06-15 04:35:26 - ContextManager: Adding context Ctx( /admin ) Starting tomcat. Check logs/tomcat.log for error messages 2001-06-15 04:35:26 - ContextManager: Adding context Ctx( ) 2001-06-15 04:35:26 - ContextManager: Adding context Ctx( /test ) 2001-06-15 04:35:27 - PoolTcpConnector: Starting HttpConnectionHandler on 8080 2001-06-15 04:35:27 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007 I GET THIS ERROR WHEN I ACCESS THE SAMPLES HOMEPAGE : [/export/home/gmb/tomcat/jakarta-tomcat-3.2.2] % 2001-06-15 04:35:38 - ContextManager: SocketException reading request, ignored - java.net.SocketException: Connection reset by peer at java.net.PlainSocketImpl.socketAvailable(Native Method) at java.net.PlainSocketImpl.available(PlainSocketImpl.java:451) at java.net.SocketInputStream.available(SocketInputStream.java:137) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:217) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) AND THEN I GET A MESSAGE LIKE THIS WHENEVER I ACCESS ANY OF THE JSP EXAMPLES 2001-06-15 04:36:39 - Ctx( /examples ): JasperException: R( /examples + /jsp/colors/colrs.jsp + null) Cannot read file: /jsp/colors/colrs.jsp 2001-06-15 04:36:39 - Ctx( /examples ): Exception in: R( /examples + /jsp/colors/colrs.jsp + null) - java.lang.NoSuchMethodError at org.apache.tomcat.context.ExceptionHandler.doService(DefaultCMSetter.java:289) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.handleError(ContextManager.java:1160) at org.apache.tomcat.core.Handler.service(Handler.java:312) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) [/export/home/gmb] % uname -a SunOS pequod 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-2 [/export/home/gmb] % java -version java version 1.3.0 Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) Java HotSpot(TM) Client VM (build 1.3.0, mixed mode) [/export/home/gmb] %
RE: duplicate posts
Are you sure they're not double-clicking the submission control? Are these the kind of users who know the difference between a single-click and a double-click? Is it only happening with one user and not another? (Can you tell that from your logs?) (I find that many users single-click buttons and double-click anchors--I guess, because that's the way Windows generally works--so I only use an anchor if double-clicking doesn't have side-effects, like inserting two records in a database.) -- Bill K. -Original Message- From: Scott Weaver [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 8:33 AM To: [EMAIL PROTECTED] Subject: duplicate posts I'm running Tomcat 3.2.1 I have a servlet that receives posted data from a client. Some times I receive duplicate posts (the data is exactly the same...the message can't be because of some unique attributes included with the data). The client claims they are not sending duplicate messages so I'm wondering if any of you out there have ever encountered this problem. It doesn't happen all the time but it is happening. I have checked my servlet log (stdout.log) and from my servlet's point of view I am receiving 2 separate distinct posts (time stamp is milliseconds apart). Any advice? Thanks, Scott
Re: how to make a war file?
use the jar tool, but put a war extension instead of jar. Bo Xu wrote: Hi :-) could anybody tell me how to put a myapp/Servlet-context into a war file? I can do something similar with J2EERI, but I don't know how to do it by myself: - is war-file a jar-file? - which command/tool can I use to do it? thanks in advance! Bo June 19, 2001
RE: how to make a war file?
- is war-file a jar-file? Yes, except it's got some extra entries, and it ends in .war. See the servlet spec, at http://java.sun.com/products/servlet/2.2/ , for more information on the WAR file format. - which command/tool can I use to do it? jar. -- Bill K. -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 8:38 AM To: [EMAIL PROTECTED] Subject: how to make a war file? Hi :-) could anybody tell me how to put a myapp/Servlet-context into a war file? I can do something similar with J2EERI, but I don't know how to do it by myself: - is war-file a jar-file? - which command/tool can I use to do it? thanks in advance! Bo June 19, 2001
how protect servlets with parameters specifies?
Hi, again I thaks again for your help... for: how protect servlet? my servlet now work with AuthType Basic fine, but I have other question.. you maybe can help me my servlet named: AdministrationServlet.class receive parameters how: defe/servlet/defe.servlets.AdministrationServlet?option=kategorienr=18user=lui (or) defe/servlet/defe.servlets.AdministrationServlet?option=listnr=87user=mark (or) defe/servlet/defe.servlets.AdministrationServlet?option=anwendernr=32user=karl but Ionlylike protect my servletwhen my servlet receive option=list and no matter the values of other parameters how nr and user help me please in my http.conf put: Location "/defe/servlet/defe.servlets.AdministrationServlet?option=list" (but not run)Deny from AllAuthName "Access for only valid users(with location)"AuthType BasicAuthUserFile "c:/passwords/pass"Limit GET POSTrequire valid-user/LimitSatisfy Any/Location thanks in advance
RE: How to upload a binary file?
Hi, I am sorry that I don't have time to read your sourcecode completely, but there is a verysimple solution to upload files to a servlet or a jsp. There is aspecial package from oreilly.com for uploading files of different content-types from a browser. In my JSP I have just oneline that can do this: import com.oreilly.servlet.*; ...in the doGet or doPost method: MultipartRequest multi = new MultipartRequest(request, filename); "filename" is the path where you want to save the uploaded file. There are much more cool things you can do with the oreilly-package. Just visit http://www.servlets.com/jservlet/examples/ch04/index.html#ex04_17for an example. Good Luck :) Christian Amann
Re: distributable servlet in Tomcat3.2
Your servlets belong to 2 different contexts, moreover - jvms ... sessions are defined per context ... hth * * Boris NiyazovPh: 212-854-4094 Fax: 212-854-1749 * * Systems Manager Email: [EMAIL PROTECTED] * * Columbia Law School URL: http://www.law.columbia.edu * * Hello, I've read on this list that Tomcat 3.2 supports serializing sessions attributes. I wanted to try it, but could not find more information on the subject here. So I tried to do it according to the servlet 2.2 specification. As it is not working, I try to sum-up here what I've done: I have installed 2 Tomcat 3.2 on the same machine (taking care that the 2nd Tomcat starts on port 8081), and for each of them, I have built a very simple session webapp : - session/ - WEB-APP/ web.xml - classes/ SessionServlet.class The web.xml looks like: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app distributable /distributable servlet servlet-namesession/servlet-name servlet-classSessionServlet/servlet-class /servlet servlet-mapping servlet-namesession/servlet-name url-pattern/session/url-pattern /servlet-mapping /web-app For the firt Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 1 output); ServletContext servletContext = this.getServletContext(); servletContext.setAttribute(foo,abcdef..foo); out.println(attribute foo, with value abcde...foo, added in ServletContext); HttpSession httpSession = req.getSession(); httpSession.setAttribute(bar,abcde...bar); out.println(attribute bar, with value abcde...bar, added in HttpSession); out.close(); } } For the second Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 2 Output); ServletContext servletContext = this.getServletContext(); String foo = (String) servletContext.getAttribute(foo); out.println(foo=+ foo + (get from ServletContext)); HttpSession httpSession = req.getSession(); String bar = (String) httpSession.getAttribute(bar); out.println(bar=+ bar + (get from HttpSession)); out.close(); } } Requesting respectively the first servlet, and the second serlvet did not give the expected results: http://127.0.0.1:8080/session/servlet/SessionServlet SessionServlet 1 output attribute foo, with value abcde...foo, added in ServletContext attribute bar, with value abcde...bar, added in ServletContext http://127.0.0.1:8081/session/servlet/SessionServlet SessionServlet 2 Output foo=null (get from ServletContext) bar=null (get from HttpSession) So did I made a mistake, did I forget something, or is it simply not possible to do it ? Thanks for any help ! Xavier Marjou __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/
Re: Apache Default Document is .jsp?
It sounded to me like your jsp was separate from your main document tree. If that was the case, mod_rewrite will do the job. You can only use the DirectoryIndex if you're working with static content in the same directory as the jsp content. Best Regards, Jason On Tue, 19 Jun 2001 08:29:52 -0700, Scott Jones wrote: Yeah, I thought so too, but it needed the dummy file in the static directory before it actually worked for me. I will check into using mod_rewrite -- sounds like a good idea. Thanks to both of you. :) -Scott - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 7:24 PM Subject: Re: Apache Default Document is .jsp? I would have thought that if you change the DirectoryIndex instruction (I think thats it) in the httpd.conf to use index.jsp first, and you have mounted *.jsp to go to tomcat then it should work. haven't done it myself though. cheers dim On Tue, 19 Jun 2001 10:40, you wrote: Hello, I'm getting ready to setup tomcat and Apache on seperate machines. Before getting started on that project, on my development machine, I set the default DocumentRoot for apache to a different directory (for static content) than my webapp (which will eventually sit on a different machine). I'd like to have my login.jsp be my default document, but was only able to get it to work by putting a dummy login.jsp in the HTML directory... Otherwise, Apache would just show a normal index of the directory... Is this the only way to get this to work? Or am I missing somthing? BTW, I'm on Tomcat 3.2.1 and Apache 1.3.19... Thanks for any ideas. Cheers, Scott
Does Tomcat provide load balancing?
I would like to know if within Tomcat there is a component that provide load balancing. Also, does it provide persistance? Thank you in advance. [EMAIL PROTECTED]
Re: omegacms, thanks and a new problem: compile errors
Thank you very much, I had to explicitly put the omega jar and the directory containing the property file in my unix shell's classpath. Now the problem I'm running into is that some pages are getting compile error messages. 2001-06-19 12:07:40 - Ctx( /omega ): JasperException: R( /omega + /admin/hello.jsp + null) Unable to compile class for JSP/usr/local/jakarta-tomcat-3.2.2/work/localhost_8080%2Fomega/_0002fadmin_0002fhello_0002ejsphello_jsp_0.java:61: Incompatible type for method. Can't convert void to char[]. out.print( out.print(!) ); the hello.jsp file contains: h2Hello World %=out.print(!) % /h2 what's going on? Thanks again in advance. Randy Layman wrote: If you're on UNIX, add it to TOMCAT_HOME/classes, if you're on NT you'll need to modify the tomcat.bat file so that Tomcat adds this directory to its automatically built classpath. Another option it to add the conf.properties to the CLASSPATH environment variable. In either case, there are some ways that you can request resources that cause the wrong class loader to be used, which it seems is happening here. Since its closed source, there really is no way around this. Randy -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:17 AM To: Tomcat Users
Re: distributable servlet in Tomcat3.2
Xavier, pls, disregard my posting. I didn't read your question correctly. I didn't work with distributedable servlets, so can't help with this. * * Boris NiyazovPh: 212-854-4094 Fax: 212-854-1749 * * Systems Manager Email: [EMAIL PROTECTED] * * Columbia Law School URL: http://www.law.columbia.edu * * Your servlets belong to 2 different contexts, moreover - jvms ... sessions are defined per context ... hth * * Boris NiyazovPh: 212-854-4094 Fax: 212-854-1749 * * Systems Manager Email: [EMAIL PROTECTED] * * Columbia Law School URL: http://www.law.columbia.edu * * Hello, I've read on this list that Tomcat 3.2 supports serializing sessions attributes. I wanted to try it, but could not find more information on the subject here. So I tried to do it according to the servlet 2.2 specification. As it is not working, I try to sum-up here what I've done: I have installed 2 Tomcat 3.2 on the same machine (taking care that the 2nd Tomcat starts on port 8081), and for each of them, I have built a very simple session webapp : - session/ - WEB-APP/ web.xml - classes/ SessionServlet.class The web.xml looks like: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app distributable /distributable servlet servlet-namesession/servlet-name servlet-classSessionServlet/servlet-class /servlet servlet-mapping servlet-namesession/servlet-name url-pattern/session/url-pattern /servlet-mapping /web-app For the firt Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 1 output); ServletContext servletContext = this.getServletContext(); servletContext.setAttribute(foo,abcdef..foo); out.println(attribute foo, with value abcde...foo, added in ServletContext); HttpSession httpSession = req.getSession(); httpSession.setAttribute(bar,abcde...bar); out.println(attribute bar, with value abcde...bar, added in HttpSession); out.close(); } } For the second Tomcat, I compiled: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SessionServlet extends HttpServlet { public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); res.setContentType(text/plain); out.println(SessionServlet 2 Output); ServletContext servletContext = this.getServletContext(); String foo = (String) servletContext.getAttribute(foo); out.println(foo=+ foo + (get from ServletContext)); HttpSession httpSession = req.getSession(); String bar = (String) httpSession.getAttribute(bar); out.println(bar=+ bar + (get from HttpSession)); out.close(); } } Requesting respectively the first servlet, and the second serlvet did not give the expected results: http://127.0.0.1:8080/session/servlet/SessionServlet SessionServlet 1 output attribute foo, with value abcde...foo, added in ServletContext attribute bar, with value abcde...bar, added in ServletContext http://127.0.0.1:8081/session/servlet/SessionServlet SessionServlet 2 Output foo=null (get from ServletContext) bar=null (get from HttpSession) So did I made a mistake, did I forget something, or is it simply not possible to do it ? Thanks for any help ! Xavier Marjou __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/ - Boris
Re: omegacms, thanks and a new problem: compile errors
Figured it out, this statement needed a semicolon to work. Thanks all. Vinny wrote: Thank you very much, I had to explicitly put the omega jar and the directory containing the property file in my unix shell's classpath. Now the problem I'm running into is that some pages are getting compile error messages. 2001-06-19 12:07:40 - Ctx( /omega ): JasperException: R( /omega + /admin/hello.jsp + null) Unable to compile class for JSP/usr/local/jakarta-tomcat-3.2.2/work/localhost_8080%2Fomega/_0002fadmin_0002fhello_0002ejsphello_jsp_0.java:61: Incompatible type for method. Can't convert void to char[]. out.print( out.print(!) ); the hello.jsp file contains: h2Hello World %=out.print(!) % /h2 what's going on? Thanks again in advance. Randy Layman wrote: If you're on UNIX, add it to TOMCAT_HOME/classes, if you're on NT you'll need to modify the tomcat.bat file so that Tomcat adds this directory to its automatically built classpath. Another option it to add the conf.properties to the CLASSPATH environment variable. In either case, there are some ways that you can request resources that cause the wrong class loader to be used, which it seems is happening here. Since its closed source, there really is no way around this. Randy -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:17 AM To: Tomcat Users
UNSUSCRIBE
UNSUSCRIBE PLEASE _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. UNSUSCRIBEGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
RE: Does Tomcat provide load balancing?
I used Apache to provide sticky load balancing to multiple tomcats. You could set the worker.properties file and the http.conf file for the setup. For further details refer the worker.properties HOW-TO docs. If you specifically won't Tomcat to provide load balancing then.. I have no clue ! -Andy -Original Message- From: kevin ritter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 12:22 PM To: [EMAIL PROTECTED] Subject: Does Tomcat provide load balancing? I would like to know if within Tomcat there is a component that provide load balancing. Also, does it provide persistance? Thank you in advance. [EMAIL PROTECTED]
Public IP IIS and Private IP Tomcat?
Hi all, i successifullt tested tomcat+apache on a single linux server. What now a would to reach is to have a public-class-ip Win2000/IIS5 with a double net card who communicate with a private-class-ip linux server with tomcat. Someone thinks is it possible? WIN 2000/IIS LINUX/Tomcat |---|| apj12/13 |--| | public ip | private ip |--|private ip| |---|||--| Thanks a lot (i hope the schema is readable) :-) -- ~ Mario Libraro Progettazione Sviluppo ~ Fulltrading S.p.A. amm.: 50121 Firenze - Viale Matteotti, 9 sede: 00153 Roma - Via Rosazza, 58 cell.: +39 338 9753 962 +39 347 5205 752 tel.: +39 066 573 170 fax: +39 066 573 529 email: [EMAIL PROTECTED] [EMAIL PROTECTED] web: www.fulltrading.it ~ Grande disordine sotto il cielo... ...la situazione è ottima Mao Tse-Tung
Re: Public IP IIS and Private IP Tomcat?
i successifullt tested tomcat+apache on a single linux server. What now a would to reach is to have a public-class-ip Win2000/IIS5 with a double net card who communicate with a private-class-ip linux server with tomcat. Someone thinks is it possible? WIN 2000/IIS LINUX/Tomcat |---|| apj12/13 |--| | public ip | private ip |--|private ip| |---|||--| Of course. You just need two cards in the Win box, and generally two networks (hubs/switch or crossover cable). David
RE: Public IP IIS and Private IP Tomcat?
I don't see why this wouldn't be possible. On the Win2K you would install the isapi_redirect.dll (see the IIS-Tomcat how to). In the workers.properties file you specify the location of the actual worker - this would be the private IP of the Linux computer. The only possible sticking point here would be if the IIS process has access to the second network card (I don't see why it wouldn't, but you never know with those silly MS people). My suggested implementation plan would go: 1. Install Tomcat on the Win2K machine and make it work 2. Install the isapi_redirect on Win2K and connect to localhost 3. Give the Linux machine a public address and reconfigure Win2K to use the Linux worker (make sure to stop Tomcat on Win2K to make sure that you're using the right machine) 4. Move the Linux computer to the private network and reconfigure Win2K again. As you can probably tell, I'm suggesting taking little steps. Lots of people have plenty of problems with 1 and 2 and trying to do it all at once might prove to be to much. Randy -Original Message- From: mario libraro [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 5:48 AM To: jakarta ml Subject: Public IP IIS and Private IP Tomcat? Hi all, i successifullt tested tomcat+apache on a single linux server. What now a would to reach is to have a public-class-ip Win2000/IIS5 with a double net card who communicate with a private-class-ip linux server with tomcat. Someone thinks is it possible? WIN 2000/IIS LINUX/Tomcat |---|| apj12/13 |--| | public ip | private ip |--|private ip| |---|||--| Thanks a lot (i hope the schema is readable) :-) -- ~ Mario Libraro Progettazione Sviluppo ~ Fulltrading S.p.A. amm.: 50121 Firenze - Viale Matteotti, 9 sede: 00153 Roma - Via Rosazza, 58 cell.: +39 338 9753 962 +39 347 5205 752 tel.: +39 066 573 170 fax: +39 066 573 529 email: [EMAIL PROTECTED] [EMAIL PROTECTED] web: www.fulltrading.it ~ Grande disordine sotto il cielo... ...la situazione è ottima Mao Tse-Tung
Re: Public IP IIS and Private IP Tomcat?
Yes, you can do it. I was testing some configuration options yesterday and had the same thing working, but I was doing it with an aliased IP on the public box. Of course, my outside box was FreeBSD so YMMV. Best Regards, Jason On Tue, 19 Jun 2001 11:47:59 +0200, mario libraro wrote: Hi all, i successifullt tested tomcat+apache on a single linux server. What now a would to reach is to have a public-class-ip Win2000/IIS5 with a double net card who communicate with a private-class-ip linux server with tomcat. Someone thinks is it possible? WIN 2000/IIS LINUX/Tomcat |---|| apj12/13 |--| | public ip | private ip |--|private ip| |---|||--| Thanks a lot (i hope the schema is readable) :-) -- ~ Mario Libraro Progettazione Sviluppo ~ Fulltrading S.p.A. amm.: 50121 Firenze - Viale Matteotti, 9 sede: 00153 Roma - Via Rosazza, 58 cell.: +39 338 9753 962 +39 347 5205 752 tel.: +39 066 573 170 fax: +39 066 573 529 email: [EMAIL PROTECTED] [EMAIL PROTECTED] web: www.fulltrading.it ~ Grande disordine sotto il cielo... ...la situazione ottima Mao Tse-Tung
RE: Tomcat 3.2.2 and Xerces
I have had luck with Tomcat and Xerces by putting an underscore in front of xerces.jar (i.e., calling it _xerces.jar) and putting it into the $TOMCAT_HOME/lib directory with the rest of the jar files. The shell script that generates the CLASSPATH puts them in alphabetical order (as Chris McNeilly pointed out) and underscores come out before letters. At least in Unix, I'm not sure about DOS. -Original Message- From: Sam Newman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 10:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Tomcat 3.2.2 and Xerces If it was an inbuilt limitation of Tomcat, I wouldn't expect to see a ClassDefNotFoundExceptionare you sure you've put your xerces parser .jar file in the WEB-INF/lib directory of your webapp? Also Mail Archive does have a search facility for this list. Its pretty crap but its better than nothing :-) sam - Original Message - From: Ben Rometsch [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 3:08 PM Subject: Tomcat 3.2.2 and Xerces Hi There, I'm new to the group - apologies if this has been asked 100 times before. I'm writing a web application that parses an XML file with SAX in order to retrieve database connection details. The beans responsible for this make use of the xerces XML parser. Testing the beans in JBuilder, everything works fine. When I compile the class files and attempt to invoke the methods through a jsp page in Tomcat, it throws a java.lang.NoClassDefFoundError error. I've been scouring Deja and the tomcat documentation. It sounds like I can't use another XML parser on top of the one tomcat uses to parse its configuration information. Is this correct? If this is the case, is the only solution to re-write the SAX parser bean to make use of JAXP? Thanks in advance, Ben snip
Tomcat + Ant: precompiling servlets making a WAR file
Attached is the Ant build.xml file (very lightly edited from the default version). I have been reading posts in both the Tomcat-user and Ant-user lists, but I still don't feel that I understand what I need to do in order to test the most simple case of (1) using jspc to precompile servlets and (2) make a WAR file to drop over at the test machine. Would someone please take a wee bit of pity on a guy battling a deadline (okay, who isn't? :-) and show me what you've done to get this to work. Many, many thanks. == snip == project name=Test Project default=compile basedir=. property name=app.name value=testproject/ property name=tomcat.home value=/Users/mickey/Applications/java/jakarta/tomcat-3.2.1/ property name=deploy.homevalue=${tomcat.home}/webapps/${app.name}/ property name=dist.home value=${deploy.home}/ property name=dist.src value=${app.name}.jar/ property name=dist.war value=${app.name}.war/ property name=javadoc.home value=${deploy.home}/javadoc/ target name=clean deletedir=${deploy.home}/ /target target name=prepare mkdir dir=${deploy.home}/ copy todir=${deploy.home} fileset dir=web/ /copy mkdir dir=${deploy.home}/WEB-INF/ copy file=etc/web.xml tofile=${deploy.home}/WEB-INF/web.xml/ mkdir dir=${deploy.home}/WEB-INF/classes/ mkdir dir=${javadoc.home}/ !-- For Ora taglib (from JavaServer Pages book) -- mkdir dir=${deploy.home}/WEB-INF/tlds/ copy todir=${deploy.home}/WEB-INF/libfileset dir=etc/lib//copy copy todir=${deploy.home}/WEB-INF/tldsfileset dir=etc/tlds//copy /target target name=compile depends=prepare javac srcdir=src destdir=${deploy.home}/WEB-INF/classes classpath=${deploy.home}/WEB-INF/classes debug=on optimize=off deprecation=off/ copy todir=${deploy.home}/WEB-INF/classes fileset dir=src includes=**/*.properties/ /copy /target target name=javadoc depends=prepare javadoc sourcepath=src packagenames=* destdir=${javadoc.home}/ /target target name=all depends=clean,prepare,compile,javadoc/ target name=dist depends=prepare,compile jar jarfile=${dist.home}/${dist.src} basedir=. includes=*/ jar jarfile=${dist.home}/${dist.war} basedir=${deploy.home} includes=*/ /target /project -- Michael Mickey Sattler, Geek Times mailto:[EMAIL PROTECTED] San Francisco, California, USAhttp://www.GeekTimes.com/michael/ I was born not knowing and have had only a little time to change that here and there. -- Richard Feynman (1918 - 1988)
Re: Apache Default Document is .jsp?
You could also have an index.html that uses the meta-refresh tag to automatically redirect to your login.jsp. This might be a lot easier than mod_rewrite. Either way, I would turn off directory browsing in Apache, unless that's what you really want. --jeff - Original Message - From: Jason Koeninger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 6:25 PM Subject: Re: Apache Default Document is .jsp? Dig through the documentation on mod_rewrite and/or look at the Redirect command for Apache. One or both of those two should be capable of accomplishing what you want. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Mon, 18 Jun 2001 17:40:02 -0700, Scott Jones wrote: Hello, I'm getting ready to setup tomcat and Apache on seperate machines. Before getting started on that project, on my development machine, I set the default DocumentRoot for apache to a different directory (for static content) than my webapp (which will eventually sit on a different machine). I'd like to have my login.jsp be my default document, but was only able to get it to work by putting a dummy login.jsp in the HTML directory... Otherwise, Apache would just show a normal index of the directory... Is this the only way to get this to work? Or am I missing somthing? BTW, I'm on Tomcat 3.2.1 and Apache 1.3.19... Thanks for any ideas. Cheers, Scott
RE: duplicate posts
Thanks for the reply. It's a post done through a program so it wouldn't be a double click. I think that they have a synchronization problem but I wanted to rule one out on my side. I wasn't sure if it was possible for Tomcat to have an error that would receive a post and start two instances of a servlet. Since no one else has posted a reply...I suppose no one has heard of any kind of error like this. Thanks, Scott -Original Message- From: William Kaufman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:54 AM To: '[EMAIL PROTECTED]' Subject: RE: duplicate posts Are you sure they're not double-clicking the submission control? Are these the kind of users who know the difference between a single-click and a double-click? Is it only happening with one user and not another? (Can you tell that from your logs?) (I find that many users single-click buttons and double-click anchors--I guess, because that's the way Windows generally works--so I only use an anchor if double-clicking doesn't have side-effects, like inserting two records in a database.) -- Bill K. -Original Message- From: Scott Weaver [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 8:33 AM To: [EMAIL PROTECTED] Subject: duplicate posts I'm running Tomcat 3.2.1 I have a servlet that receives posted data from a client. Some times I receive duplicate posts (the data is exactly the same...the message can't be because of some unique attributes included with the data). The client claims they are not sending duplicate messages so I'm wondering if any of you out there have ever encountered this problem. It doesn't happen all the time but it is happening. I have checked my servlet log (stdout.log) and from my servlet's point of view I am receiving 2 separate distinct posts (time stamp is milliseconds apart). Any advice? Thanks, Scott
Re: xtags: Unable to load class
Where did you put the taglib tld file and the taglib jar file? What does your web.xml look like? The order of the definitions in web.xml is also important. When I first set up my taglibs, I had the taglib definition in my web.xml at the end of the file after a security-constraint definition and it didn't work. Check out tomcat.mslinn.com for an explanation of the web.xml file. --jeff - Original Message - From: William C. Robertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 10:47 PM Subject: xtags: Unable to load class -Original Message- From: William C. Robertson [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:37 PM To: [EMAIL PROTECTED] Subject: xtags: Unable to load class Has anyone else had a problem with taglibs? I have everything configured correctly (pretty sure) and I get the following error when using any of the tomcat taglibs (except for the example tagliv which can with tomcat and works fine): Error: 500 Location: /examples/init_onlyImports.jsp Internal Servlet Error: org.apache.jasper.compiler.CompileException: /usr/local/jakarta-tomcat-3.2.2/webapps/examples/init_onlyImports.jsp(4,0) Unable to load class org.apache.taglibs.xtags.tags.ParseTag at org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java, Compiled Code) I hope the problem is obvious to someone. Thanks..
Servlet chaining
hi everyone, Does anyone know of implementation of a good ServletChaining API (for tomcat) that´s available for download ? I know Filters will be introduced into Tomcat 4 and I look forward to working with those but untill it will be released I need something similar. thanx bye -r
Re: omegacms, thanks and a new problem: compile errors
Hi Vinny, The %= opening jsp tag is for single expression evaluation, while the % is for scriptlets. So, you could do this two ways: % out.print(!); % or %= ! % As you've seen, the %= wraps whatever's inside it in an out.print() statement -- so you're own out.print() is redundant in this case. --jeff - Original Message - From: Vinny [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 9:27 AM Subject: Re: omegacms, thanks and a new problem: compile errors Thank you very much, I had to explicitly put the omega jar and the directory containing the property file in my unix shell's classpath. Now the problem I'm running into is that some pages are getting compile error messages. 2001-06-19 12:07:40 - Ctx( /omega ): JasperException: R( /omega + /admin/hello.jsp + null) Unable to compile class for JSP/usr/local/jakarta-tomcat-3.2.2/work/localhost_8080%2Fomega/_0002fadmin_0 002fhello_0002ejsphello_jsp_0.java:61: Incompatible type for method. Can't convert void to char[]. out.print( out.print(!) ); the hello.jsp file contains: h2Hello World %=out.print(!) % /h2 what's going on? Thanks again in advance. Randy Layman wrote: If you're on UNIX, add it to TOMCAT_HOME/classes, if you're on NT you'll need to modify the tomcat.bat file so that Tomcat adds this directory to its automatically built classpath. Another option it to add the conf.properties to the CLASSPATH environment variable. In either case, there are some ways that you can request resources that cause the wrong class loader to be used, which it seems is happening here. Since its closed source, there really is no way around this. Randy -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:17 AM To: Tomcat Users
Error Message with Tomcat-Apache
Hello, I apologize for what must be a silly question but can anyone explain how I might fix the error below. I'm using Tomcat 3.2.1 with Apache 1.3.19. on Redhat 7.0 - Someone had mentioned earlier about changing the JAVA_HOME environment variable but I'm not sure exactly what they meant by that. Thanks in advance for any HELP! Dan ** Error: 500 Location: /examples/jsp/num/numguess.jsp Internal Servlet Error: javax.servlet.ServletException: sun/tools/javac/Main at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:245) at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484)
RE: Error Message with Tomcat-Apache
in the tomcat.sh script do a export JAVA_HOME=/usr/java1.2; #or whatever your location of your java installation is the problem you are experiencing is that tools.jar located in JAVA_HOME/lib/ is not in your classpath, so Tomcat can not compile your servlets. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: Dan Buckley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:27 AM To: [EMAIL PROTECTED] Subject: Error Message with Tomcat-Apache Hello, I apologize for what must be a silly question but can anyone explain how I might fix the error below. I'm using Tomcat 3.2.1 with Apache 1.3.19. on Redhat 7.0 - Someone had mentioned earlier about changing the JAVA_HOME environment variable but I'm not sure exactly what they meant by that. Thanks in advance for any HELP! Dan ** Error: 500 Location: /examples/jsp/num/numguess.jsp Internal Servlet Error: javax.servlet.ServletException: sun/tools/javac/Main at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManage r.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnect ion(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler. java:128) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:245) at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecess ary(JspServlet.java:152) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspS ervlet.java:164) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManage r.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnect ion(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484)
Problem Installing Tomcat
Hi, I am having trouble getting Tomcat 3.2.2 working correctly. I have tried to install it on two Red Hat Linux 7.0 computers and neither one will function correctly. I have tried both the rpm and the binary file and I cant seem to get it to work right. When I run the startup.sh or the tomcat.sh start scripts I get this error message Using classpath: var/tomcat/lib/* [root@danna bin]# SIGSEGV 11* segmentation violation stackbase=(nil), stackpointer=(nil) Full thread dump: NULL (TID:0x4059d0b0, sys_thread_t:0x8083dd8, state:R) prio=5 *current thread* java.lang.System.nullInputStream(System.java) java.lang.System.clinit(System.java) java.lang.String.getChars(String.java) java.lang.StringBuffer.append(StringBuffer.java) java.lang.StringBuffer.init(StringBuffer.java) java.lang.Thread.init(Thread.java) Monitor Cache Dump: java.lang.Class@1079627864/1079893136: owner NULL (0x8083dd8, 1 entry) java.lang.StringBuffer@1079628136/1079893024: owner NULL (0x8083dd8, 1 entry) Registered Monitor Dump: Thread queue lock: unowned Name and type hash table lock: unowned String intern lock: unowned JNI pinning lock: unowned JNI global reference lock: unowned BinClass lock: unowned Class loading lock: unowned Java stack lock: unowned Code rewrite lock: unowned Heap lock: unowned Has finalization queue lock: unowned Finalize me queue lock: unowned Dynamic loading lock: owner NULL (0x8083dd8, 1 entry) Monitor IO lock: unowned Child death monitor: unowned Event monitor: unowned I/O monitor: unowned Alarm monitor: unowned Monitor registry: owner NULL (0x8083dd8, 1 entry) Thread Alarm Q: I am fairly certain that this should not happen when I start tomcat. help would be greatly appreciated. Thanks Derek Pitts
strange behavior with netscape browser
Hello, my application sends strange responses: If I try to access the servlet /xobix2/servlet/ONLI -everything works fine with IE. -Netscape Browser returns the error 404 /xobix2/servlet not found. Can anybody imagine why this happens? I append the corresponding accesslog and a http-header: Greethings, Thomas Rimmele _ HTTP header (Tool: clickbot): HTTP/1.1 200 Date: Tue, 19 Jun 2001 18:51:34 GMT Server: Apache/1.3.17 (Unix) mod_jk Set-Cookie2: JSESSIONID=nn82taguz1.w000;Version=1;Discard;Path=/xobix2 Set-Cookie: JSESSIONID=nn82taguz1.w000;Path=/xobix2 Transfer-Encoding: chunked Content-Type: text/html d19 HTML HEAD(...) Access.log (clickbot request) 146.159.49.128 - - [19/Jun/2001:20:52:48 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 Access.log (netscape browser request) 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ONLI HTTP/1.0 200 8846 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ HTTP/1.0 404 179 Access.log (IE browser request) 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_swissinfo.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/deh_map.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/dot_trans.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_fussnav.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_linie.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_rand_fuss_redesign.gif HTTP/1.1 304 -
RE: strange behavior with netscape browser
YOU MUST CALL respone.setContentType(text/html); before you write to the output stream. IE assumes this content type, netscape doesn't Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 12:01 PM To: [EMAIL PROTECTED] Subject: strange behavior with netscape browser Hello, my application sends strange responses: If I try to access the servlet /xobix2/servlet/ONLI -everything works fine with IE. -Netscape Browser returns the error 404 /xobix2/servlet not found. Can anybody imagine why this happens? I append the corresponding accesslog and a http-header: Greethings, Thomas Rimmele _ HTTP header (Tool: clickbot): HTTP/1.1 200 Date: Tue, 19 Jun 2001 18:51:34 GMT Server: Apache/1.3.17 (Unix) mod_jk Set-Cookie2: JSESSIONID=nn82taguz1.w000;Version=1;Discard;Path=/xobix2 Set-Cookie: JSESSIONID=nn82taguz1.w000;Path=/xobix2 Transfer-Encoding: chunked Content-Type: text/html d19 HTML HEAD(...) Access.log (clickbot request) 146.159.49.128 - - [19/Jun/2001:20:52:48 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 Access.log (netscape browser request) 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ONLI HTTP/1.0 200 8846 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ HTTP/1.0 404 179 Access.log (IE browser request) 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_swissinfo.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/deh_map.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/dot_trans.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_fussnav.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_linie.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_rand_fuss_redesign.gif HTTP/1.1 304 -
Regarding loading a class on startup
Hi, I want to load a class in the memory when the tomcat server starts. Basically this class has some static data which I want the application to use. I want to keep the data at application level. Regards, Pankaj
Re: Newbie Help (the sequel)
Hi Mark, If you want to have content served both by Apache and Tomcat (usually dynamic JSP/Servlet content served by Tomcat, static by Apache) you have to understand at least all of the foll (and possibly more) a) Apache configuration - directory and URL mapping for content served by Apache b) Apache-Tomcat Configuration in httpd.conf to make Tomcat work with Apache c) Tomcat servlet mapping rules and context entries in server.xml and web.xml Then d) Make sure a certain pattern isn't inadvertently being mapped in both the Apache and Tomcat rules set up by you. I think you need to understand a) better and then do d). Look at the Apache docs, then go through your entries in Apache .conf files and Tomcat .xml files with a fine tooth comb. Drink lots of liquid and take frequent breaks lest your brain explode! Good Luck, Nitin Borwankar, [EMAIL PROTECTED] Mark Senefsky wrote: Greetings all... Thanks to all who responded to my configuration problem (Newbie Help). My test directories all work fine: http://www.modeforge.com/examples/jsp/index.html http://www.modeforge.com/examples/servlets/index.html But anything I put into Apache htdocs gives me a 404 error. I looked at: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html But I don't understand. Thanks in advance. Mark _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
AW: strange behavior with netscape browser
There is no way. It is the first command I call in doGet and doPut. Greethings, Thomas -Ursprüngliche Nachricht- Von: Filip Hanik [mailto:[EMAIL PROTECTED]] Gesendet: Tuesday, June 19, 2001 9:07 PM An: [EMAIL PROTECTED] Betreff: RE: strange behavior with netscape browser YOU MUST CALL respone.setContentType(text/html); before you write to the output stream. IE assumes this content type, netscape doesn't Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 12:01 PM To: [EMAIL PROTECTED] Subject: strange behavior with netscape browser Hello, my application sends strange responses: If I try to access the servlet /xobix2/servlet/ONLI -everything works fine with IE. -Netscape Browser returns the error 404 /xobix2/servlet not found. Can anybody imagine why this happens? I append the corresponding accesslog and a http-header: Greethings, Thomas Rimmele _ HTTP header (Tool: clickbot): HTTP/1.1 200 Date: Tue, 19 Jun 2001 18:51:34 GMT Server: Apache/1.3.17 (Unix) mod_jk Set-Cookie2: JSESSIONID=nn82taguz1.w000;Version=1;Discard;Path=/xobix2 Set-Cookie: JSESSIONID=nn82taguz1.w000;Path=/xobix2 Transfer-Encoding: chunked Content-Type: text/html d19 HTML HEAD(...) Access.log (clickbot request) 146.159.49.128 - - [19/Jun/2001:20:52:48 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 Access.log (netscape browser request) 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ONLI HTTP/1.0 200 8846 146.159.49.128 - - [19/Jun/2001:20:43:27 +0200] GET /xobix2/servlet/ HTTP/1.0 404 179 Access.log (IE browser request) 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /xobix2/servlet/ONLI HTTP/1.1 200 8866 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_swissinfo.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/deh_map.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/dot_trans.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_fussnav.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/rand_linie.gif HTTP/1.1 304 - 146.159.49.128 - - [19/Jun/2001:20:43:32 +0200] GET /template_resources/x2test_dateien/de_rand_fuss_redesign.gif HTTP/1.1 304 -
Re: Regarding loading a class on startup
Pankaj Chhaparwal wrote: Hi, I want to load a class in the memory when the tomcat server starts. Basically this class has some static data which I want the application to use. I want to keep the data at application level. Regards, Pankaj Hi :-) - in Servlet spec2.3, there is a new feature about application lifecycle events: ServletContextListener interface, please see the following link: http://www.javaworld.com/javaworld/jw-01-2001/jw-0126-servletapi_p.html - now I don't know which CL(classloader) will load a class which implements ServletContextListener, so I think it is context level, but I am not sure if it is container level(cross several-contexts in the same container). - I have a question: where can I put this listener-class? in WEB-INF/classes? or wrap it in a jar file and put the jar file in WEB-INF/lib? can I put it in TOMCAT_HOME/lib(loaded by ShareCL) - there is also another new feature in Servlet spec2.3: HttpSessionListener Bo June 19, 2001
OutOfMemory Error
Hi Everybody ! I am geting this OutOfMemory Error for a couple of days now with no stack trace. Any idea what is wrong with TOMCAT ? Is that anythiing to do with Low memory available ?? thanks - Shailendra T. Kontham Advancework Inc.,
Re: AW: strange behavior with netscape browser
At 12:20 PM 6/19/2001, Thomas wrote: There is no way. It is the first command I call in doGet and doPut. Huh? You have no way of issuing setContentType(text/html); through HTTPServletResponse in your doGet() method? As in HTTPServletResponse.setContentType(text/html); -Tim
Re: Servlet chaining
try struts - jakarta.apache.org/struts I think Reynir Hübner wrote: hi everyone, Does anyone know of implementation of a good ServletChaining API (for tomcat) that´s available for download ? I know Filters will be introduced into Tomcat 4 and I look forward to working with those but untill it will be released I need something similar. thanx bye -r
RE: OutOfMemory Error
Chances are you either: 1. Are using a very small stack (using -Xmx with a small number) 2. You are putting items into sessions that you aren't removing and your sessions aren't expiring fast enough to keep your system in memory 3. You have a servlet with a class or static variable that is some form of a list or map and you keep adding to it I have Tomcat installed on a server at a client location. Its been up for 30 days this time, 45 at the longest, and the memory has stayed pretty constant (creeping up and then back down with usage) Randy -Original Message- From: Shailendra T Kontham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 4:20 PM To: [EMAIL PROTECTED] Subject: OutOfMemory Error Hi Everybody ! I am geting this OutOfMemory Error for a couple of days now with no stack trace. Any idea what is wrong with TOMCAT ? Is that anythiing to do with Low memory available ?? thanks - Shailendra T. Kontham Advancework Inc.,
Re: Regarding loading a class on startup
If your class is a servlet you may want to use load-on-startup 1 /load-on-startup in your web.xml hth * * Boris NiyazovPh: 212-854-4094 Fax: 212-854-1749 * * Systems Manager Email: [EMAIL PROTECTED] * * Columbia Law School URL: http://www.law.columbia.edu * * Hi, I want to load a class in the memory when the tomcat server starts. Basically this class has some static data which I want the application to use. I want to keep the data at application level. Regards, Pankaj - Boris
Re: Can't happen - classname is null, who added this
I get this message if I replace one of my classes while Tomcat is running. Try restarting Tomcat. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions.
incomplete output
I'm having problems with what looks like a lack of a flush somewhere inside tomcat. I'm running Tomcat 3.2.2b3 on RedHat Linux 6.2 with IBM's JDK 1.3. My web app is mildly complicated, with nested %@ include's and an invocation of RequestDispatcher.include(). The bytes returned to the browser are missing a range between somewhere inside a nested %@ include'd file and the start of the RequestDispatcher.include() output. Has anybody else seen bugs in this neck of the woods? Got any workarounds? I've looked at the release notes for 3.2.2, and don't see something that looks like this. Thanks, Mike
multithreaded beans, struts, doing it right...
Hi folks, I have a question about building robust beans. Context: Building a Model-2 application with tomcat that uses a home-grown MVC framework (probably going to replaced with struts). My concern is over the design of my business logic beans, which are stateful controllers. Each of my user sessions can have one or more of these beans and each represents a separate thread of activity for the user. This is working OK except for the threading issue in that multiple requests (accidentally) sent the to same controller cause obvious problem. I have since added a level of synchronization and am hoping this will deal with most problems. Something I certainly don't want to do is to move away from stateful controllers (to avoid the threading problem) because I believe this is the right approach. Also from reading the struts docs carefully it appears that this is still something that must be considered with struts, i.e. once the Action object has passed on control to a bean, the bean has the concurrecy problem to deal with. So, I would be interested in people's opinion on their approach to managing concurrency in controller/business logic beans. Thanks in advance, Russ
Re: multithreaded beans, struts, doing it right...
By multiple threads of activity do you mean the user has multiple windows open? If so, perhaps in the user's session you could have a Map of business logic beans instead of just one. And somehow have the client identify which thread of activity the currenty action is part of, from there get the apprpriate bean and you're back in single-threaded mode (o: Then again, if this isn't what you mean, then thats probably no use! is that what you mean? cheesr dim On Wed, 20 Jun 2001 08:08, Russ Freeman wrote: Hi folks, I have a question about building robust beans. Context: Building a Model-2 application with tomcat that uses a home-grown MVC framework (probably going to replaced with struts). My concern is over the design of my business logic beans, which are stateful controllers. Each of my user sessions can have one or more of these beans and each represents a separate thread of activity for the user. This is working OK except for the threading issue in that multiple requests (accidentally) sent the to same controller cause obvious problem. I have since added a level of synchronization and am hoping this will deal with most problems. Something I certainly don't want to do is to move away from stateful controllers (to avoid the threading problem) because I believe this is the right approach. Also from reading the struts docs carefully it appears that this is still something that must be considered with struts, i.e. once the Action object has passed on control to a bean, the bean has the concurrecy problem to deal with. So, I would be interested in people's opinion on their approach to managing concurrency in controller/business logic beans. Thanks in advance, Russ
Security exceptions.
Hi all I am running tomcat 3.2.2 with Apache 1.3.19 using JDK 1.3.1 by Sun. The script /usr/bin/tomcat is called with -security parameter. The file /var/tomcat/conf/tomcat.policy contains, among others, the lines: grant codeBase file:/usr/local/idle/web/- { permission java.security.AllPermission; }; When I try to call some .jsp file which creates the bean from /usr/local/idle/web/WEB-INF/lib/idlebase.jar, I get the exception: Error: 500 Location: /idle/common/jsp/courseList.jsp Internal Servlet Error: javax.servlet.ServletException: access denied (java.io.FilePermission /usr/local/idle/web/WEB-INF/lib/idlebase.jar read) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java) at jsp._0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0._jspService(_0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0.java:180) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java) at org.apache.tomcat.core.Handler.service(Handler.java) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java) at org.apache.tomcat.core.ContextManager.service(ContextManager.java) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java) at java.lang.Thread.run(Thread.java:484) Root cause: java.security.AccessControlException: access denied (java.io.FilePermission /usr/local/idle/web/WEB-INF/lib/idlebase.jar read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272) at java.security.AccessController.checkPermission(AccessController.java:399) at java.lang.SecurityManager.checkPermission(SecurityManager.java:545) at java.lang.SecurityManager.checkRead(SecurityManager.java:890) at java.io.File.isDirectory(File.java:567) at org.apache.tomcat.loader.AdaptiveClassLoader.getResourceAsStream(AdaptiveClassLoader.java) at java.lang.Class.getResourceAsStream(Class.java:1220) at spbtu.util.LogUtil.(LogUtil.java:37) at spbtu.util.LogUtil.(LogUtil.java:23) at jsp._0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0._jspService(_0002fjsp_0002fcourseList_0002ejspcourseList_jsp_0.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java) at org.apache.tomcat.core.Handler.service(Handler.java) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java) at org.apache.tomcat.core.ContextManager.service(ContextManager.java) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java) at java.lang.Thread.run(Thread.java:484) The exception is caused by my class which is trying to read (getResourceAsStream) some resource file existing in the same .jar. Any ideas what's wrong here? Regards, Sergey
Has the servlet be compiled?
I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory -or just put it (file.java) in appropriate directory? and how can I compile a servlet? Thank you in advance, Mario.
flushing
How can I flush Tomcat? Nothing from the PrintWriter reaches the browser until the servlet completes. flush() does nothing. Has anybody altered the facade classes to enable flushing? Why is Tomcat set up that way? Thanks.
Problem with Tomcat as a Service
I am using JavaService to start Tomcat as a service. It installs and starts just fine, but when I try to access a jsp, it hangs. In jasper.log it shows the usual lines about the jsp being accessed, but hangs after the line: Classpath according to the Servlet Engine is ... Noting shows up in the work directory and no error messages in any log. I tried putting tools.jar in the Tomcat lib, adding it to the service classpath, but it doesn't help. Any ideas why jasper is hanging and how to fix/identify the problem? Thanks, Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions.
Re: Has the servlet be compiled?
On Wed, Jun 20, 2001 at 12:24:22AM +0200, [EMAIL PROTECTED] wrote: I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory Yes, compile it and put the bytecode in WEB-INF/classes -or just put it (file.java) in appropriate directory? and how can I compile a servlet? With a Java compiler (javac, jikes, etc), just like regular Java code. Cheers, Neil
RE: Has the servlet be compiled?
-complie and put it (file.class) in appropriate directory yes, put it in your-web-app/WEB-INF/classes and how can I compile a servlet? javac.exe I suggest you take a look at the examples and then read the servlet specification. It will answer most of your questions Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 3:24 PM To: [EMAIL PROTECTED] Subject: Has the servlet be compiled? I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory -or just put it (file.java) in appropriate directory? and how can I compile a servlet? Thank you in advance, Mario.
Re: Has the servlet be compiled?
You must compile the file (.JAVA) and put the CLASS file on WEB-INF/classes directory. Regards Daniel ___ Daniel de Almeida Alvares Santos - SP - Brasil [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 7:24 PM Subject: Has the servlet be compiled? I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory -or just put it (file.java) in appropriate directory? and how can I compile a servlet? Thank you in advance, Mario.
Re: Has the servlet be compiled?
answer to your question: you need to compile it. servlet classes need to be available to the application - compile them in to $TOMCAT_HOME/webapps/myapp/WEB-INF/classes where myapp is the name of your context. You will also need to change web.xml to define the servlet (strictly speaking I think you can get away without doing this, but its good practice). this isn't really tomcat specific stuff though - you'd be well served by getting your hands on a decent servlet book (the O'Rielly one is pretty good). cheers dim On Wed, 20 Jun 2001 08:24, you wrote: I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory -or just put it (file.java) in appropriate directory? and how can I compile a servlet? Thank you in advance, Mario.
Compile ??
where do I have to put my java Files so that I can compile and Import org.apache.tomcat . Please help thanks venkatesh
Re: flushing
Doesn't tomcat need to set the Content-length HTTP header in the response before sending anything? That would explain (to me at least) why flush doesn't send it to the client. I'm guessing all it does is tick over the content-length counter. cheers dim On Wed, 20 Jun 2001 08:26, you wrote: How can I flush Tomcat? Nothing from the PrintWriter reaches the browser until the servlet completes. flush() does nothing. Has anybody altered the facade classes to enable flushing? Why is Tomcat set up that way? Thanks.
Re: incomplete output
Mike, I had similar problems, but not exact. My experience may help you. 1. Check directives like: %@ page buffer=18 autoFlush=true % and make sure that autoFlush=true 2. Do not close out stream in include servlets and pages. I hope it could help. Dmitry R., [EMAIL PROTECTED] Chief Software Architect, MetricStream.COM Santa Clara, CA -Original Message- From:Mike Spreitzer [EMAIL PROTECTED] Sent:Tue, 19 Jun 2001 18:04:22 -0400 To: [EMAIL PROTECTED] Subject: incomplete output I'm having problems with what looks like a lack of a flush somewhere inside tomcat. I'm running Tomcat 3.2.2b3 on RedHat Linux 6.2 with IBM's JDK 1.3. My web app is mildly complicated, with nested %@ include's and an invocation of RequestDispatcher.include(). The bytes returned to the browser are missing a range between somewhere inside a nested %@ include'd file and the start of the RequestDispatcher.include() output. Has anybody else seen bugs in this neck of the woods? Got any workarounds? I've looked at the release notes for 3.2.2, and don't see something that looks like this. Thanks, Mike ___ Visit http://www.visto.com/info, your free web-based communications center. Visto.com. Life on the Dot.
Re: Has the servlet be compiled?
You could put your java files in directory tomcat/work/your_host(localhost)/context_name and look what happen. Tomcat compiles JSP sources automatically in this directory, so there is a chance that you files will be compiled too. Dmitry R., [EMAIL PROTECTED] Chief Software Architect, MetricStream.COM Santa Clara, CA -Original Message- From:[EMAIL PROTECTED] Sent:Wed, 20 Jun 2001 00:24:22 +0200 To: [EMAIL PROTECTED] Subject: Has the servlet be compiled? I have to compile the servlet? I ha a simple servlet (Hello world) what I have to do: -complie and put it (file.class) in appropriate directory -or just put it (file.java) in appropriate directory? and how can I compile a servlet? Thank you in advance, Mario. ___ Visit http://www.visto.com/info, your free web-based communications center. Visto.com. Life on the Dot.
Re: Public IP IIS and Private IP Tomcat?
thanks.. a lot for now i tested the schema with both public-ip... :) i got emotioned when I accessed win2k and heard linux's hd moving to give jsps... As soon as possible i'll install the second NIC on w2k and set linux on private address.. but I think there will be no differences other than change worker config. :o)
Re: Compile ??
servlet and JavaBean .java files are to be compiled and placed into: \webapps\yourapp\WEB-INF\classes\ The engine will find necessary classes if you made correct entry into \webapps\yourapp\WEB-INF\web.xml (if not familiar with .xml - just follow their examples .jsp files are not to be compiled but just placed under: \webapps\yourapp\WEB-INF\jsp\ The engine will compile them. No code specific entry is needed in web.xml for .jsp files By then it is assumed that you made an entry for your specific application into: \conf\server.xml and policy file is updated with: permission java.lang.RuntimePermission "shutdownHooks"; r/luba - Original Message - From: Venkatesh Sangam To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 6:42 PM Subject: Compile ?? where do I have to put my java Files so that I can compile and Import org.apache.tomcat . Please help thanks venkatesh
Re: flushing
Out is buffered for content length calculation as it's done in Sun's HTTP client implementation. Try to use HTTP 1.1 chuncked stream not requiring to set content length. Dmitry R., [EMAIL PROTECTED] Chief Software Architect, MetricStream.COM Santa Clara, CA -Original Message- From:T [EMAIL PROTECTED] Sent:Tue, 19 Jun 2001 18:26:03 -0400 To: [EMAIL PROTECTED] Subject: flushing How can I flush Tomcat? Nothing from the PrintWriter reaches the browser until the servlet completes. flush() does nothing. Has anybody altered the facade classes to enable flushing? Why is Tomcat set up that way? Thanks. ___ Visit http://www.visto.com/info, your free web-based communications center. Visto.com. Life on the Dot.
Re: multithreaded beans, struts, doing it right...
Kind of :) In fact your solution isn't far away. I am currently supporting multiple threads of activity within the same browser window and hence session. Let's say we have a big table on a page with two columns, where each column is like a view. Each column view is displaying a different aspect of some business data and each column/pane has its own set of links too. If the user clicks a link in the left pane, the URI is sent with ID 1 encoded in the URI and if they click a link in the right pane, the URI is sent with ID 2 encoded in it. (The ID is a lookup into a Map of business objects). This is similar to what you were saying I think. However this works OK until the user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. So far I have ensured that each business object is thread safe and I have yet to detmine if this will work or whether I have just covered up another problem! Does this help? Cheers, Russ - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Russ Freeman [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 11:24 PM Subject: Re: multithreaded beans, struts, doing it right... By multiple threads of activity do you mean the user has multiple windows open? If so, perhaps in the user's session you could have a Map of business logic beans instead of just one. And somehow have the client identify which thread of activity the currenty action is part of, from there get the apprpriate bean and you're back in single-threaded mode (o: Then again, if this isn't what you mean, then thats probably no use! is that what you mean? cheesr dim On Wed, 20 Jun 2001 08:08, Russ Freeman wrote: Hi folks, I have a question about building robust beans. Context: Building a Model-2 application with tomcat that uses a home-grown MVC framework (probably going to replaced with struts). My concern is over the design of my business logic beans, which are stateful controllers. Each of my user sessions can have one or more of these beans and each represents a separate thread of activity for the user. This is working OK except for the threading issue in that multiple requests (accidentally) sent the to same controller cause obvious problem. I have since added a level of synchronization and am hoping this will deal with most problems. Something I certainly don't want to do is to move away from stateful controllers (to avoid the threading problem) because I believe this is the right approach. Also from reading the struts docs carefully it appears that this is still something that must be considered with struts, i.e. once the Action object has passed on control to a bean, the bean has the concurrecy problem to deal with. So, I would be interested in people's opinion on their approach to managing concurrency in controller/business logic beans. Thanks in advance, Russ
Re: multithreaded beans, struts, doing it right...
user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. This probably better be intercepted, even if the logic is thread safe. Too confusion to the client. You can watch user activity thread in your session object. - Original Message - From: Russ Freeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 6:59 PM Subject: Re: multithreaded beans, struts, doing it right... Kind of :) In fact your solution isn't far away. I am currently supporting multiple threads of activity within the same browser window and hence session. Let's say we have a big table on a page with two columns, where each column is like a view. Each column view is displaying a different aspect of some business data and each column/pane has its own set of links too. If the user clicks a link in the left pane, the URI is sent with ID 1 encoded in the URI and if they click a link in the right pane, the URI is sent with ID 2 encoded in it. (The ID is a lookup into a Map of business objects). This is similar to what you were saying I think. However this works OK until the user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. So far I have ensured that each business object is thread safe and I have yet to detmine if this will work or whether I have just covered up another problem! Does this help? Cheers, Russ - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Russ Freeman [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 11:24 PM Subject: Re: multithreaded beans, struts, doing it right... By multiple threads of activity do you mean the user has multiple windows open? If so, perhaps in the user's session you could have a Map of business logic beans instead of just one. And somehow have the client identify which thread of activity the currenty action is part of, from there get the apprpriate bean and you're back in single-threaded mode (o: Then again, if this isn't what you mean, then thats probably no use! is that what you mean? cheesr dim On Wed, 20 Jun 2001 08:08, Russ Freeman wrote: Hi folks, I have a question about building robust beans. Context: Building a Model-2 application with tomcat that uses a home-grown MVC framework (probably going to replaced with struts). My concern is over the design of my business logic beans, which are stateful controllers. Each of my user sessions can have one or more of these beans and each represents a separate thread of activity for the user. This is working OK except for the threading issue in that multiple requests (accidentally) sent the to same controller cause obvious problem. I have since added a level of synchronization and am hoping this will deal with most problems. Something I certainly don't want to do is to move away from stateful controllers (to avoid the threading problem) because I believe this is the right approach. Also from reading the struts docs carefully it appears that this is still something that must be considered with struts, i.e. once the Action object has passed on control to a bean, the bean has the concurrecy problem to deal with. So, I would be interested in people's opinion on their approach to managing concurrency in controller/business logic beans. Thanks in advance, Russ
Re: Hi
Hi filip, the member function request.getWrapper() is depcrecated in PerformanceInterceptor .. help Venkatesh
Re: multithreaded beans, struts, doing it right...
Ok, yeah that makes sense. What you want to do then is ensure that your business objects are only processing one thread at once. I'm guessing that you could do this in a similar way that ejb containers serialize access to an ejb. (THinking aloud here): Lets see, you currently have an object, called say BusinessBean that has a method called business(Object parameters), or something similar? rename business to doBusiness. create a member of the BusinessBean for a lock and a flag to indicate if we're active or not: // the lock to serializing access private Object LOCK = new Object(); // are we currently active private boolean active = false; replace the business method with something like this: ReturnType business(Object parameters) { // is it ok to execute boolean ok = false; // while its not ok - look to see when it becomes ok while (!ok) { // ensure we're the only one looking synchronized(LOCK) { // if no one else is executing - lets go if (!active) { ok = true; // set the active flags so other // threads will now wait active = true; } } // if its not ok to execute, wait if (!ok) wait(); } // execute the method and hold the return ReturnType r = doBusiness(parameters); // now reset the active flag and notify any waiting threads synchronized(LOCK) { active = false; notify(); } // the final return return r; } as I said.,.. thinking aloud (or via email)... but I think something like that you would ensure that only one thread is executing on the doBusiness at one time... although if you have a problem with the same command being executed twice then you have to do other things too (o: If I've missed something here, I'd love someone to point it out - I'm hoping to get something out of this too (o: cheesr dim On Wed, 20 Jun 2001 08:59, Russ Freeman wrote: Kind of :) In fact your solution isn't far away. I am currently supporting multiple threads of activity within the same browser window and hence session. Let's say we have a big table on a page with two columns, where each column is like a view. Each column view is displaying a different aspect of some business data and each column/pane has its own set of links too. If the user clicks a link in the left pane, the URI is sent with ID 1 encoded in the URI and if they click a link in the right pane, the URI is sent with ID 2 encoded in it. (The ID is a lookup into a Map of business objects). This is similar to what you were saying I think. However this works OK until the user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. So far I have ensured that each business object is thread safe and I have yet to detmine if this will work or whether I have just covered up another problem! Does this help? Cheers, Russ - Original Message - From: Dmitri Colebatch [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Russ Freeman [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 11:24 PM Subject: Re: multithreaded beans, struts, doing it right... By multiple threads of activity do you mean the user has multiple windows open? If so, perhaps in the user's session you could have a Map of business logic beans instead of just one. And somehow have the client identify which thread of activity the currenty action is part of, from there get the apprpriate bean and you're back in single-threaded mode (o: Then again, if this isn't what you mean, then thats probably no use! is that what you mean? cheesr dim On Wed, 20 Jun 2001 08:08, Russ Freeman wrote: Hi folks, I have a question about building robust beans. Context: Building a Model-2 application with tomcat that uses a home-grown MVC framework (probably going to replaced with struts). My concern is over the design of my business logic beans, which are stateful controllers. Each of my user sessions can have one or more of these beans and each represents a separate thread of activity for the user. This is working OK except for the threading issue in that multiple requests (accidentally) sent the to same controller cause obvious problem. I have since added a
Re: multithreaded beans, struts, doing it right...
Interesting, are you saying:- 1) that there is some generic facility I can use to do this in tomcat or 2) Each business object should decide whether it can handle another request (assuming it knows one is in progess, e.g. using some state flag) ? Cheers, Russ - Original Message - From: Luba Powell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 12:04 AM Subject: Re: multithreaded beans, struts, doing it right... user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. This probably better be intercepted, even if the logic is thread safe. Too confusion to the client. You can watch user activity thread in your session object.
Re: multithreaded beans, struts, doing it right...
I don't think that there is anything like that in Tomcat. But if you would like prevent user from being confused by popup windows - it might be desirable to check session flag: transaction in progress, complete, etc. But you say that your logic is thread-safe. So I assume that you implemented some semaphore like what Dmitri describes. So this is a thin client solution. Hope there is something more elegant out there. r/luba - Original Message - From: Russ Freeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 7:29 PM Subject: Re: multithreaded beans, struts, doing it right... Interesting, are you saying:- 1) that there is some generic facility I can use to do this in tomcat or 2) Each business object should decide whether it can handle another request (assuming it knows one is in progess, e.g. using some state flag) ? Cheers, Russ - Original Message - From: Luba Powell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 12:04 AM Subject: Re: multithreaded beans, struts, doing it right... user accidentally double clicks one of the links and the same business object gets two requests, where the first isn't finished before it recieves the second. This probably better be intercepted, even if the logic is thread safe. Too confusion to the client. You can watch user activity thread in your session object.
Re: multithreaded beans, struts, doing it right...
(o: shit... I've just gone and re-invented the wheel.. On Wed, 20 Jun 2001 09:29, you wrote: 1) that there is some generic facility I can use to do this in tomcat yes there is, kinda, but I dont know it will do what you need. If your servlet implements SingleThreadedModel then tomcat will ensure that multiple requests are not passed to the instance at once. But this doesn't mean tomcat cant handle multiple requests at once by creating multiple instances. And because your business logic isn't in the servlet, but in another object which is in the session, you'll still have the same problem. cheesr dim