Tomcat Version detection
Hi there, I am running tomcat under linux, unfortunately can't remember whether it is 4.1.24 or 4.1.31, which made me relise, I don't know how to find out. When i look at the logs it jsut says Tomcat 4.1 unlike on windows where it actually gives the full version number. So where would i look to find the tomcat version? Regards Steve
Re: Serving files using tomcat
Ok thanks, Well I have worked it out, it turns out I needed the header response.setHeader(Content-disposition,attachment; filename=\report.pdf\); added, this made it work. So now the problem id that Internet Explorer flashes up the Open, Save, Cance dialog box twice. Once the second one flashes up the first dissapears so I am not too concerned. But wondering if this is a quirk, or have I done something wrong. My code is now fis = new FileInputStream(rf.getPdf()); response.setContentType(application/pdf); response.setContentLength(FileUtils.countBytes(rf.getPdf())); // may be overkill thought it may be misreporting the file length. response.setHeader(Content-disposition,attachment; filename=\report.pdf\); dos = response.getOutputStream(); int read = -1; byte[] bytes = new byte[10]; while((read = fis.read(bytes)) != -1) dos.write(bytes, 0, read); dos.flush(); return null; - Original Message - From: David B. Saul [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Thursday, May 05, 2005 6:43 AM Subject: RE: Serving files using tomcat May not be critical but try using the ServletOutputStream instead of OutputStream. DOC URL: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletResponse.html //Clear content of the underlying buffer in the response //without clearing headers or status code. response.resetBuffer(); response.setContentLength(output.length); //Returns a ServletOutputStream suitable for writing binary data in the response. //The servlet container does not encode the binary data. ServletOutputStream os = response.getOutputStream(); os.write(output); os.close(); Additionally, append pdf=.pdf\ to the URL. -Original Message- From: Anhony [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 04, 2005 9:20 AM To: Tomcat Users List Subject: Re: Serving files using tomcat I use this code and it works in my app. Their are small differences between how we copy the data to the response output. I don't know for sure, but this may account for why the fragment I posted works. The difference is small, I think it would be worth giving it a try. AS- - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, May 04, 2005 11:47 AM Subject: Re: Serving files using tomcat Unfortunately that is what I do OutputStream dos = null; FileInputStream fis = null; try { fis = new FileInputStream(rf.getPdf()); response.setContentType(application/pdf); response.setContentLength((int) rf.getPdf().length()); //response.setHeader(response.) dos = response.getOutputStream(); int read = -1; byte[] bytes = new byte[10]; while((read = fis.read(bytes)) != -1) dos.write(bytes, 0, read); dos.flush(); return mapping.findForward(PDF); } catch (Exception e) { // TODO Auto-generated catch block if(e instanceof SocketException) return mapping.findForward(reload); throw new IOException(e.toString()); } finally { if(dos != null) dos.close(); if(fis != null) fis.close(); } Acrobat now loads but the PDF doesn't appear. Probably worth mentioning that I use struts, so I forward to a blank page with the content type set to application/pdf, maybe that is the problem, but not sure what else to do with the return. When I do the same thing with a dynamic image and forward to a page with a jpg content type, the image appears without a problem. Steve - Original Message - From: Anhony [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, May 05, 2005 1:02 AM Subject: Re: Serving files using tomcat Greetings, Take a look at the code fragment below. It should serve as a good starting point. I hope this helps. AS- private void processPDFRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, Exception { int bytesCopied = 0; FileInputStream fin = null; OutputStream out = null; String fileAddress = The fully qualified path to your PDF file; if( fileAddress == null ) return; int ext = fileAddress.lastIndexOf( '.' ); if( ext != -1 ) { ext = fileAddress.substring( ext+1, fileAddress.length() ).toLowerCase(); if( ext == pdf ) response.setContentType(application/pdf); else Do whatever you think best to do } else Do whatever you think best to do try { out = response.getOutputStream(); fin = new FileInputStream( fileAddress ); bytesCopied = StreamCopier.copy( fin, out ); } finally { if( fin != null
Serving files using tomcat
Hi, I have been looking around and haven't found a solution that works basically I have a PDF that gets created dynamically. Now to save memory I have the PDF written to a file rather than a ByteArray. The only way I can be sure that I wont encounter errors creating the file is to use File.createTempFile. The creation goes of ok. And I have checked the file itself and the PDF looks great. How do i now serve this to the user who has requested it. If I try to write it to the response (using the same method I use to creare dynamic image, this works), it just shows up a blank screen. The problem also is, even if it did show the PDF, acrobat, to my understand will read only chunks of the stream and will go pack to get more. Thisis a problem because there is nothing to go back for. So the point, If I can just redirect the browser to a file in the tomcat temp directory (can I do that, will the use have access to that directory), then how do I translate the location of the temp directory to a url that is accesible outside. If not then what other suggestions can people give me. Thanks in advance Steve
Re: Serving files using tomcat
Unfortunately that is what I do OutputStream dos = null; FileInputStream fis = null; try { fis = new FileInputStream(rf.getPdf()); response.setContentType(application/pdf); response.setContentLength((int) rf.getPdf().length()); //response.setHeader(response.) dos = response.getOutputStream(); int read = -1; byte[] bytes = new byte[10]; while((read = fis.read(bytes)) != -1) dos.write(bytes, 0, read); dos.flush(); return mapping.findForward(PDF); } catch (Exception e) { // TODO Auto-generated catch block if(e instanceof SocketException) return mapping.findForward(reload); throw new IOException(e.toString()); } finally { if(dos != null) dos.close(); if(fis != null) fis.close(); } Acrobat now loads but the PDF doesn't appear. Probably worth mentioning that I use struts, so I forward to a blank page with the content type set to application/pdf, maybe that is the problem, but not sure what else to do with the return. When I do the same thing with a dynamic image and forward to a page with a jpg content type, the image appears without a problem. Steve - Original Message - From: Anhony [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, May 05, 2005 1:02 AM Subject: Re: Serving files using tomcat Greetings, Take a look at the code fragment below. It should serve as a good starting point. I hope this helps. AS- private void processPDFRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, Exception { int bytesCopied = 0; FileInputStream fin = null; OutputStream out = null; String fileAddress = The fully qualified path to your PDF file; if( fileAddress == null ) return; int ext = fileAddress.lastIndexOf( '.' ); if( ext != -1 ) { ext = fileAddress.substring( ext+1, fileAddress.length() ).toLowerCase(); if( ext == pdf ) response.setContentType(application/pdf); else Do whatever you think best to do } else Do whatever you think best to do try { out = response.getOutputStream(); fin = new FileInputStream( fileAddress ); bytesCopied = StreamCopier.copy( fin, out ); } finally { if( fin != null ) fin.close(); if( out != null ) { out.flush(); out.close(); } } } - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat User List tomcat-user@jakarta.apache.org Sent: Wednesday, May 04, 2005 9:29 AM Subject: Serving files using tomcat Hi, I have been looking around and haven't found a solution that works basically I have a PDF that gets created dynamically. Now to save memory I have the PDF written to a file rather than a ByteArray. The only way I can be sure that I wont encounter errors creating the file is to use File.createTempFile. The creation goes of ok. And I have checked the file itself and the PDF looks great. How do i now serve this to the user who has requested it. If I try to write it to the response (using the same method I use to creare dynamic image, this works), it just shows up a blank screen. The problem also is, even if it did show the PDF, acrobat, to my understand will read only chunks of the stream and will go pack to get more. Thisis a problem because there is nothing to go back for. So the point, If I can just redirect the browser to a file in the tomcat temp directory (can I do that, will the use have access to that directory), then how do I translate the location of the temp directory to a url that is accesible outside. If not then what other suggestions can people give me. Thanks in advance Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serving files using tomcat
Yes i see no difference, I assume StreamCopier.copy() just does what my code does. I cannot find it in any of the standard jars, so I assume this is one of your own. Other than that everything else seems to be fine. Oh well I am sure I will owrk it out Steve - Original Message - From: Anhony [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, May 05, 2005 2:19 AM Subject: Re: Serving files using tomcat I use this code and it works in my app. Their are small differences between how we copy the data to the response output. I don't know for sure, but this may account for why the fragment I posted works. The difference is small, I think it would be worth giving it a try. AS- - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, May 04, 2005 11:47 AM Subject: Re: Serving files using tomcat Unfortunately that is what I do OutputStream dos = null; FileInputStream fis = null; try { fis = new FileInputStream(rf.getPdf()); response.setContentType(application/pdf); response.setContentLength((int) rf.getPdf().length()); //response.setHeader(response.) dos = response.getOutputStream(); int read = -1; byte[] bytes = new byte[10]; while((read = fis.read(bytes)) != -1) dos.write(bytes, 0, read); dos.flush(); return mapping.findForward(PDF); } catch (Exception e) { // TODO Auto-generated catch block if(e instanceof SocketException) return mapping.findForward(reload); throw new IOException(e.toString()); } finally { if(dos != null) dos.close(); if(fis != null) fis.close(); } Acrobat now loads but the PDF doesn't appear. Probably worth mentioning that I use struts, so I forward to a blank page with the content type set to application/pdf, maybe that is the problem, but not sure what else to do with the return. When I do the same thing with a dynamic image and forward to a page with a jpg content type, the image appears without a problem. Steve - Original Message - From: Anhony [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, May 05, 2005 1:02 AM Subject: Re: Serving files using tomcat Greetings, Take a look at the code fragment below. It should serve as a good starting point. I hope this helps. AS- private void processPDFRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, Exception { int bytesCopied = 0; FileInputStream fin = null; OutputStream out = null; String fileAddress = The fully qualified path to your PDF file; if( fileAddress == null ) return; int ext = fileAddress.lastIndexOf( '.' ); if( ext != -1 ) { ext = fileAddress.substring( ext+1, fileAddress.length() ).toLowerCase(); if( ext == pdf ) response.setContentType(application/pdf); else Do whatever you think best to do } else Do whatever you think best to do try { out = response.getOutputStream(); fin = new FileInputStream( fileAddress ); bytesCopied = StreamCopier.copy( fin, out ); } finally { if( fin != null ) fin.close(); if( out != null ) { out.flush(); out.close(); } } } - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat User List tomcat-user@jakarta.apache.org Sent: Wednesday, May 04, 2005 9:29 AM Subject: Serving files using tomcat Hi, I have been looking around and haven't found a solution that works basically I have a PDF that gets created dynamically. Now to save memory I have the PDF written to a file rather than a ByteArray. The only way I can be sure that I wont encounter errors creating the file is to use File.createTempFile. The creation goes of ok. And I have checked the file itself and the PDF looks great. How do i now serve this to the user who has requested it. If I try to write it to the response (using the same method I use to creare dynamic image, this works), it just shows up a blank screen. The problem also is, even if it did show the PDF, acrobat, to my understand will read only chunks of the stream and will go pack to get more. Thisis a problem because there is nothing to go back for. So the point, If I can just redirect the browser to a file in the tomcat temp directory (can I do that, will the use have access to that directory), then how do I
Error Redirection
Hi there, This is probably an obvious question, but if a JSP or some other error occurs that would usually make tomcat do a printStackTrace() into HTML and display it on the browser. e.g -- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.NullPointerException at com.crm.web.form.EditSupplierForm.validate(EditSupplierForm.java:46) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j ava:912) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source) at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) at org.apache.catalina.core.StandardContext.invoke(Unknown Source) at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Unknown Source) at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source) at org.apache.catalina.core.ContainerBase.invoke(Unknown Source) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Compil ed Code)) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:568) --- is there a way to make it forward to a clean error page when on a production system? Regards Steve
Re: Error Redirection
oh ok thanks, new it would be simple oh but is there a default, catch all option, actually i will look the tag up. Thanks Steve - Original Message - From: Fritz Schneider [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Monday, May 02, 2005 11:44 AM Subject: RE: Error Redirection Steve, Have you tried a custom error page for error 500? error-page error-code500/error-code location/_error/500.html/location /error-page Fritz -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Sunday, May 01, 2005 6:33 PM To: Tomcat User List Subject: Error Redirection Hi there, This is probably an obvious question, but if a JSP or some other error occurs that would usually make tomcat do a printStackTrace() into HTML and display it on the browser. [snip...] is there a way to make it forward to a clean error page when on a production system? Regards Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proper way to open threads in a servlet
Hi there, I am concerned that opening a thread in my serlvet using new Thread(Runnable) style code, is causing a massive hang in my system. Basically what the thread does is email people to notify them of a change in an order on the system. I want the emails to be sent in a separate thread so that the user doesn't have to wait for this to complete to return to the system. Basically the email is a non crucial part, the action has already been performed. I know this isn't specifically a Tomcat question, but I thought I would ask it anyway. The two ways this could work is that the email is placed in a queue, that is checked periodically, or just somehow the email(s) are sent in the background, but without opening a new thread using code. Can anyone give me some pointers on how to do this. Yes I have been searching around, but haven't found much information. Tahnks in advance Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Hang on Linux (hangs the entire system)
Hi there, I am posting this in a few areas because I cannot pinpoint where the problem stems from. I have a standard Pentium III bases pc running linux. It has only 380 meg (or therabouts) of ram Using IBM JVM 1.4.1 and tomcat 4.1.18 (I know there are later version, but they all hang) I have 2 webapps running. One of them uses Apache to translate two different domain to the right ibay for it's content but uses the same code base. The second webapp is accessed, currently, using http://www.mycomapny.com:8080/MyApp style URL. The webapp just hangs. It will not load any pages, and when it hangs, both webapps hang. So I think this is a Tomcat or Java or Linux error. Once the hang occurs I cannot do a ps -ef as this also hangs. My only option is to reboot the machine. But it hangs half way and has to be physically powered off. We are going to put a new, more powerful computer in there, but for now I wanted to see if anyone else had experienced such a problem. Can you give me some pointers as to where to look for the source of the problem. This has happened before, and I got no information about it. I know it's a pretty vague explanation, but I don't know what more informationI can give you. The log files do not show any errors, and it never happens at the same point in the web application. At first I thought it happen when concurrent users logged in, but that's not the case either, and I have trimmed down the sychornicity management when accesing Singletons in my web app. Now I have been through all my code, and cannot find anything that should be causing an error. I have run the code under a number of different cirsumstances on my development machine (Windows 2000) and everything runs without a problem. Any help would be appreciated Regards Steve
pointing subdomains to different web applications??
Hi there, still looking through various news groups for the answer, but figured this was the best place. I have a number fo domains and subdomains on my system. They are set up properly on the server to be house in different information bays. What I want to know is, how do I configured tomcat to recognise say.. containers.mydomain.com and point it to a different web application to the one that www.mydomain.com points to? Is this even possible in tomcat? If it is, I would imagine it's a pretty simple answer, so hopefully someone there can help me out. Thanks in advance Steve
TempDir???
Hi there, I have been reading about ways to get Tomcat to write to a file. Basically I need to write a file, that only needs to be available while tomcat is running. It is used by a background process to dynamically configure itself, depending on what configuration tomcat is running on at that time. When tomcat shuts down it will delete this file, thus indicating to the background process to shut down also. My problem is, that in Linux I cannot just write to the /tmp directory. Is the javax.servlet.context.tempdir attribute set to a defualt of some kind or do I have to set it myself. If it is set to a default, how do I access it getServletContext().getAttributr(javax.servlet.context.tempdir) returns null. If I ahve to set it, what permission to I have to give the directory it is to be? Thanks in advance Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TempDir???
Forgot that, worked out the problem, all sorted Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED] Sent: Friday, 14 May 2004 11:54 AM To: Tomcat Users List Subject: TempDir??? Hi there, I have been reading about ways to get Tomcat to write to a file. Basically I need to write a file, that only needs to be available while tomcat is running. It is used by a background process to dynamically configure itself, depending on what configuration tomcat is running on at that time. When tomcat shuts down it will delete this file, thus indicating to the background process to shut down also. My problem is, that in Linux I cannot just write to the /tmp directory. Is the javax.servlet.context.tempdir attribute set to a defualt of some kind or do I have to set it myself. If it is set to a default, how do I access it getServletContext().getAttributr(javax.servlet.context.tempdir) returns null. If I ahve to set it, what permission to I have to give the directory it is to be? Thanks in advance Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Downloading previous versions of Tomcat
Hi everyone Having had numerous hanging problems with Tomcat 2.1.24, and no confirmatio that any bugs that cause haging are solved in 4.1.27 we are trying to find a copy of 4.1.18 for Linux to set up and text here, as our production site hangs every couple of days. Having gone through all our code and made sure that we aren't the cause of the hang, we have found that it still happens for no apparent reason. Unfortunately, we can't find tomcat 4.1.18 anywhere, does anyone knwo where we can download a copy? Regards Steve Vanspall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.24 Jasper Compile Problem
Hi there, I have this problem where Tomcat 4.1.24 doesn't let me compile the jsp's, I assume, as you will se ein the error message, that tomcat has a problem with there being spaces in the path to where it can find the JSP java code files. in my case this is under the Program Files/Apache Group/Tomcat 4.1 directory. the error I am getting is org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] javac: invalid flag: C:\Program [javac] Usage: javac [javac] where possible options include: [javac] -gGenerate all debugging info [javac] -g:none Generate no debugging info [javac] -g:{lines,vars,source}Generate only some debugging info [javac] -nowarn Generate no warnings [javac] -verbose Output messages about what the compiler is doing [javac] -deprecation Output source locations where deprecated APIs are used [javac] -classpath Specify where to find user class files [javac] -sourcepath Specify where to find input source files [javac] -bootclasspath Override location of bootstrap class files [javac] -extdirsOverride location of installed extensions [javac] -d Specify where to place generated class files [javac] -encoding Specify character encoding used by source files [javac] -source Provide source compatibility with specified release [javac] -target Generate class files for specific VM version [javac] -help Print a synopsis of standard options 4.1.19 had this problem also, 4.1.18 doesn't though. I figured I would see if anyone is aware of this problem, and a way around it. Prefereably, that solution would not be move webapp to a path that has no spaces in it. I was hoping that the problem would be fixed in this version, yes i did report the bug to apache. The reason I need 4.1.18+ is because there is a logging problem with 4.1.18 and SSL Any help would be appreciated Regards Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4.1.24 Jasper Compile Problem
Thanks, that will be my last resort. It's a pity that's what has to be done, because the older versions are fine with spaces in the path Steve -Original Message- From: Rosdi bin Kasim [mailto:[EMAIL PROTECTED] Sent: Wednesday, 2 April 2003 2:37 PM To: Tomcat Users List Subject: Re: Tomcat 4.1.24 Jasper Compile Problem [javac] javac: invalid flag: C:\Program Avoid using directory name with spaces, try to install your tomcat in c:\tomcat41 for example. - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 12:16 PM Subject: Tomcat 4.1.24 Jasper Compile Problem Hi there, I have this problem where Tomcat 4.1.24 doesn't let me compile the jsp's, I assume, as you will se ein the error message, that tomcat has a problem with there being spaces in the path to where it can find the JSP java code files. in my case this is under the Program Files/Apache Group/Tomcat 4.1 directory. the error I am getting is org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] javac: invalid flag: C:\Program [javac] Usage: javac [javac] where possible options include: [javac] -gGenerate all debugging info [javac] -g:none Generate no debugging info [javac] -g:{lines,vars,source}Generate only some debugging info [javac] -nowarn Generate no warnings [javac] -verbose Output messages about what the compiler is doing [javac] -deprecation Output source locations where deprecated APIs are used [javac] -classpath Specify where to find user class files [javac] -sourcepath Specify where to find input source files [javac] -bootclasspath Override location of bootstrap class files [javac] -extdirsOverride location of installed extensions [javac] -d Specify where to place generated class files [javac] -encoding Specify character encoding used by source files [javac] -source Provide source compatibility with specified release [javac] -target Generate class files for specific VM version [javac] -help Print a synopsis of standard options 4.1.19 had this problem also, 4.1.18 doesn't though. I figured I would see if anyone is aware of this problem, and a way around it. Prefereably, that solution would not be move webapp to a path that has no spaces in it. I was hoping that the problem would be fixed in this version, yes i did report the bug to apache. The reason I need 4.1.18+ is because there is a logging problem with 4.1.18 and SSL Any help would be appreciated Regards Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP's not compiling under 4.1.19
Hi there, This is an intermittent problem that I have been having with both Tomcat 4.1.18 and 4.1.19 Each time I think I have fixed ti something else start it off again. Basically the JSP' wont compile, I get the following error org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandle r.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:2 93) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:345) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:357) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:4 74) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:1 84) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 14) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:417) at org.apache.struts.action.RequestProcessor.processActionForward(RequestProces sor.java:390) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at
Question about detecting version
Hi there, This may be an off-beat question. Basically I am creating an installation application for my software, for some people who are going to demonstrate it. What I want to be able to do, is detect whether the correct version of Tomcat is installed on their system. The installer will only be used in a Windows NT/2000 environment. I being platform specific goes against the whole point of JAva, but this is a case where the guy doign the demo is all the way over the other side of the world. Have found some classes that will read the registry in a Sun Java environment, but Tomcat only lists the version as 4.1, is there a way to tell whether it is 4.1.1x as opposed to 4.1.1y etc? Regards Steve Vanspall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem Compiling JSP's Tomcat 4.1.19
Hi there, I have recently upgraded to Tomcat 4.1.19 in an attempt to overcome the SSL hanging problem accuring in 4.1.18 I have made a few other changes to my web-app, now I get this error org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. I have tried a number of options, having looked it up in the archives. Nothing seems to help, I cannot work out what has happened, and why it's not working. Can anyone help me. or point me in the right direction. I am using Tomcat 4.1.19 Struts 1.1b2 SUN JDK 1.4.1 (have tried going back down to 1.3.1) Thanks in advance Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Question about tomcat 4.1.19
Hi there, I reported a bug, in tomcat 4.1.18, to bugzilla. The reply I got stated that it was fixed in Tomcat 4.1.19, having not found a link to the binary for 4.1.19, I navigated tharere, and found an alpha release of it on the website. Does this mean it is still in development stage? Does anyone have any idea of it's stability? Not completely sure what alpha means, but assume, logically, it is the release before a beta release. Regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Loggin with Tomcat 4.1.18LE for JDK 1.4
Hi there, I have recently switched from Tomcat 4.1.18 to 4.1.18LE for JDK 1.4 I had hoped it would stop this logging problem I am having. For a while it looked ike it had, but now it has started again. The error I am getting is org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Now I no this is a Tomcat problem, because I have switched all my application loggin to the JDK 1.4 Logger. Can anyone suggest where the problem may lie. Is there a way to completely switch logging off?? Removing the logger tag in server.xml causes all loogin to be done to the console. I really need this sorted out, as I am trying to send a second release of my software out. Any help would be appreciated regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Loggin with Tomcat 4.1.18LE for JDK 1.4
HAving read around I guess I should add that I am using SSL Perhaps that is a help Still can't find a solution Steve -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED]] Sent: Thursday, 16 January 2003 1:58 PM To: Tomcat Users List Subject: Loggin with Tomcat 4.1.18LE for JDK 1.4 Hi there, I have recently switched from Tomcat 4.1.18 to 4.1.18LE for JDK 1.4 I had hoped it would stop this logging problem I am having. For a while it looked ike it had, but now it has started again. The error I am getting is org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Now I no this is a Tomcat problem, because I have switched all my application loggin to the JDK 1.4 Logger. Can anyone suggest where the problem may lie. Is there a way to completely switch logging off?? Removing the logger tag in server.xml causes all loogin to be done to the console. I really need this sorted out, as I am trying to send a second release of my software out. Any help would be appreciated regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat hangs under SSL connection, Clarification of Problem I have been experiencing, really need help
Hi there I am having a reall problem with Tomcat. These are my specs Tomcat 4.1.18LE for JDK 1.4 (Also have a problem with 4.1.18 standard) Struts 1.1-b2 and naturally JDK 1.4.1 My application seems to work, without a hitch, until I implement the SSLext for Struts 1.1-b2 Then things go bad. You canbe using the webapp for any length of time, and then, all of a sudden it will hangs. The problem it hits is in the commons.logging area org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log I have tried commenting out the Logger tags in server.xml, so that all the logging goes directly to the console. THinking htis may be a Log4j problem, I switched to JDK 1.4 logging. None of this has helps, the only thing that stops the container from hanging, is if I remove all SSL connection from the app. I have posted with a few messages, but now have worked out under what circumstances it happens. Can anyone help me This is really frustrating Thanks in advance Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Problem with tomcat logging
Hi there, I have a problem with Tomcat 4.1.18 basically I am getting the following message org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log At first I thought that there was a problem with my app, so having searched other mailing lists, I switched from Log4J to JDK 1.4 Logging. It turns out that the Tomcat loggin process causes this error. I have switched it off for now, but would prefer to have the logging go out to a file. Is there a way to fix this problem, or perhaps have Tomcat log using a different class? Any help would be great Regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat LE
Hi there, I have noticed that there is a Tomcat LE for JDK 1.4 What is the difference between that and the standard Tomcat. I have been having a logging problem where Tomcat throws a org.apache.commons.logging.impl.Jdk14Logger does not implement log exception. Will this tomcat help? Are there any features that won't be present? Thanks in advance Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Problem with Log4j
Hi there, I am using Tomcat 4.1.18 with JDK 1.4.1 After a while, using the application, the following error pops us, and the web-app hangs. Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log This is an intermittent error. Until this happen, all logging works without a hitch Has anyone else had this problem? any solutions Thanks in advance Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Problem with Log4j
Thanks for you reply Is it configurable like Log4j? currently trying to find info about it Regards Steve Vanspall -Original Message- From: Joe Tomcat [mailto:[EMAIL PROTECTED]] Sent: Monday, 13 January 2003 10:13 AM To: Tomcat Users List Subject: Re: Problem with Log4j On Mon, 2003-01-13 at 18:35, Steve Vanspall wrote: Hi there, I am using Tomcat 4.1.18 with JDK 1.4.1 After a while, using the application, the following error pops us, and the web-app hangs. Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log This is an intermittent error. Until this happen, all logging works without a hitch Has anyone else had this problem? Here is a solution: If you are using JDK 1.4.1, you can use Java 1.4's native logging abilities. See java.util.logging. It is quite a powerful feature, and it uses a low-priority thread to do most of its work, so it might perform better than log4j. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Restrict access to JSP's/URL's
Hi there, I am using Tomcat 4.1.12 and Strut1.1-b2 (it think that's the struts version) anyway, I can see that Tomcat has a tomcat-users.xml file. This file, as I understand, can restrict access according to a the user-level. What I want to know is, is there a way to restrict access to the url/jsp's according to a dynamically retrieved user level. e.g. All our user login id's and passwords are stored in our database. In a similar table they have a role_cde attributed to them. Both these beans are stord in the session when someone logs in. Can I restrict access to certain actions/jsp's similarly to the way tomcat-user.xml is used to restrict access? better yet, is there a non container-specific way to do it. I would rather not code my own xml file, if there is already something built in to the architecture I have running. Any help would be appreciated Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Restrict access to JSP's/URL's
Thanks. Will be doing that. What I was wondering is, is there anything built into tomcat to allow me to get say a security level of a certain action. That way seeing if it matches the users security level. Or will I need to make another xml file of my own to configure each action, and which roles can access it? regards Steve Vanspall -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED]] Sent: Friday, 6 December 2002 11:18 AM To: Tomcat Users List Subject: Re: Restrict access to JSP's/URL's Check out Filters and stick an authorization filter in front of your restricted URLs /Will - Original Message - From: Steve Vanspall [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 3:56 PM Subject: Restrict access to JSP's/URL's Hi there, I am using Tomcat 4.1.12 and Strut1.1-b2 (it think that's the struts version) anyway, I can see that Tomcat has a tomcat-users.xml file. This file, as I understand, can restrict access according to a the user-level. What I want to know is, is there a way to restrict access to the url/jsp's according to a dynamically retrieved user level. e.g. All our user login id's and passwords are stored in our database. In a similar table they have a role_cde attributed to them. Both these beans are stord in the session when someone logs in. Can I restrict access to certain actions/jsp's similarly to the way tomcat-user.xml is used to restrict access? better yet, is there a non container-specific way to do it. I would rather not code my own xml file, if there is already something built in to the architecture I have running. Any help would be appreciated Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Restriction of access to action/JSP's
Ok I think I can pinpoint my question a bit more now. I know I need to code my own filter for this. What I need to find out, is, how does Tomcat decide which of it's users (in tomcat-users.xml) can access different actions. presumably there is a setting for the action itself. Or perhaps for a group of URL's if it's for the action itself, is there a way to access that actions properties in java. Does Struts ro tomcat store them somewhere, and can I acces the information from a filter. That way, I could check the user level, and decide what to do with the response. Regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Restriction of access to action/JSP's
Thanks that is a big help. Things seem to e falling into place. Steve -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, 6 December 2002 1:54 PM To: Tomcat Users List Subject: Re: Restriction of access to action/JSP's On Fri, 6 Dec 2002, Steve Vanspall wrote: Date: Fri, 6 Dec 2002 12:59:19 +1100 From: Steve Vanspall [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Restriction of access to action/JSP's Ok I think I can pinpoint my question a bit more now. I know I need to code my own filter for this. What I need to find out, is, how does Tomcat decide which of it's users (in tomcat-users.xml) can access different actions. Tomcat looks at the URL patterns in your security-constraint element(s). If the context-relative part of the request URL matches, it enforces the auth-constraint and/or user-data-constraint clauses associated with that security-constraint. Note that all of this is based solely on the original request URL -- security constraints are *not* applied on request dispatcher includes and forwards. presumably there is a setting for the action itself. Or perhaps for a group of URL's if it's for the action itself, is there a way to access that actions properties in java. Does Struts ro tomcat store them somewhere, and can I acces the information from a filter. That way, I could check the user level, and decide what to do with the response. Struts, like any application, can perform dynamic security checks in addition to those performed by container, by calling: * request.getRemoteUser() - to get the username of the logged-in user * request.getUserPrincipal() - to get the Principal object representing the logged-in user (advanced use cases only) * request.isUserInRole() - to check whether the logged-in user possesses the specified role name In particular, Struts uses the last of these method calls if you include a role attribute on your action definition. You can, in your own servlets and filters, do exactly the same thing if you want to. Note that there is no way for an application-level filter to dynamically define user and role information *before* the container applies security constraints. All of that happens before any user-level filters or servlets are ever invoked. Regards Steve Vanspall Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problem with servlet.jar
Hi there, I am using Tomcat 4.1.12. Everything was working fine. However to make sure that my webapp will work when installed elsewhere, I tried installing it on another machine. I installed Tomcat 4.1.12 JDK 1.4.1 and my web-app When I start it up I get the following message WebappClassLoader: validateJarFile(C:\Program Files\Apache Group\Tomcat 4.1\webapps\CRMSoftwareApp\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class However I am using the servlet.jar file that comes with tomcat. I just moved it into my web-app lib directory, to please Eclipse. This installation is identical to the one on my other machine and it works fine. Can anyone help Thanks in advance Steve
org.apache.coyote.http11.Http11Processor.process takes too long
Hi there, here is the situation. I have a special List that cretes Html code as a java-bean is added to it. This eliminates the need for an extra iteration when the JSP loads, to prepare the HTML in teh page. This List is kept in the Application scope, and is retrieved when needed by placing a %=form.getList().getHtml()% tag in my JSP. The problem I am having is that if the String that getHtml return is particularly long, a line in org.apache.coyote.http11.Http11Processor.process(java.io.InputStream, java.io.OutputStream) seems to take a reasonably long time to process. This has not happened with the previous versions of tomcat. Basically it should only be doing an out.write on the String. on the suggestion of someone in the Struts user mailing list, I changes to JSTL tags and replaced %=form.getList().getHtml()% with c:out value=${form.list.html} escapeXml=false/ this, I expected would do the same thing. Hence the same holdup in the Method: apache.coyote.http11.Http11Processor.process Can anyone help expalin what might be the problem here, and how to avoid tomcat using the method it is trying to invoke. Unfortuantely I cannot find the source code for apache.coyote.http11.Http11Processor.process or the Sourcecode for Tomcat 4.1.12 so I don't know exactly where it si sticking. Any help would be appreciated Steve
handling reload
Hi there, I have a problem with my web-app where I want to be able to just return to the surrent page if the refresh button has been pushed on the browser. I don't want it to go into the action at all in this case. I will give you an example of what my problem is. Say someone wants to signup a new member: when they click the link to begin, my version of a Token is set, this is a basically just an object that sits inthe session under an attribute name, say addMember. this holds a boolean as to whether it is open or closed, and a long representing the long representation fo the time this token was set. so anyway, when the click the link to add a member, it checks to see that there isn't already an open token in the session for the addMember procedure. if there is an open token, it throws an error. however if they begin and there isn't one, it sets the token. After performing this request, if they hit refresh in the brower, the action tests for the token, then, finding it open, it throws an error. Can anyway suggest a way to stop the action from being re-done on a refresh. Regards Steve Vanspall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: port 8080
I had the same problem, check the services under control panel, you will most probably have something else using that port. I personally had IBM HTTP server using it. But it may be a database service, if you have one running. If you know what it is, and it is not essential to run, you can stop the process. otherwise you can change the port Tomcat uses. the settings can be found in the server.xml file. just search for 8080 and change the port. You may have to do a bit of trial and error to get a free port, I used 9090 when I was testing different version of Tomcat. -Original Message- From: Marquez, Maceo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 17 April 2002 4:58 AM To: '[EMAIL PROTECTED]' Subject: port 8080 I am brand new to the Tomcat communicty and recently installed Tomcat successfully on my win2000 pc. However, when I restart the pc, Tomcat is no longer able to start, and gives the error listed below. -I restarted the computer, nothing -I reset the %CATALINA_HOME%/conf/server.xml connector port to 1977, as suggested in 'troubleshooting' like so: Connector className=org.apache.catalina.connector.http.HttpConnector port=1977 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=6/ Still, the error: Catalina.start: LifecycleException: Error creating server socket (java.net.Bind Exception): java.net.BindException: Address in use: JVM_Bind LifecycleException: Error creating server socket (java.net.BindException): jav a.net.BindException: Address in use: JVM_Bind at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne ctor.java:491) at org.apache.catalina.core.StandardService.initialize(StandardService.j ava:454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav a:553) at org.apache.catalina.startup.Catalina.start(Catalina.java:780) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) - Root Cause - java.net.BindException: Address in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:452) at java.net.ServerSocket.init(ServerSocket.java:170) at java.net.ServerSocket.init(ServerSocket.java:121) at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(Defau ltServerSocketFactory.java:118) at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne ctor.java:485) at org.apache.catalina.core.StandardService.initialize(StandardService.j ava:454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav a:553) at org.apache.catalina.startup.Catalina.start(Catalina.java:780) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Hot Code Swapping with tomcat 4.0.3
Hi there I am using Tomcat 4.0.3 with sun jdk1.4, both which are supposed to allow hot swapping of code. Unfortunately it seems that when debugging the code swapping doesn't work. Is there an additional switch I should be using with the JVM When I used tomcat 3.3 the session would restart, but atleast it would let me change the code. With Tomcat 4.0.3 neither happens. Also the shutdown.bat file doesn't seem to shutdown Tomcat at all. Any suggestions Regards Steve Vanspall -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Internatinalisation Question
Hi there I have been dealing with this problem for the last few days I am definately making progress now. I found that the @ page tag actually works the form receives information correctly, the only problem now is that the character put when converted to rgular java character set, go in correctly, but the utf-8 representation of these characters are incorrect. Obviously this is due to the fact that the character I am entering in do not have the same character representaion in UTF-8 as they do in ISO-8859-1. so 亞乽乨亪仮 gets converted to 亞乽乨亪仮 i UTF-8. I understand that the above chinese character will not make sense I just picked them out of the windows character set. Now for the question. are the chracter I enter in from the Windows Character Set program, the same as the ones that would be entered in from a native chinese keyboard. If so, why is the conversion not working, If not, where can I get a program that will emulate the chracters that would be entered, so as I can see if the problem lies in Windows or with my conversions. My ultimate aim is to create in which I can set the language on the pages, but have the code itself not have to be changed. This app would need to work in Thai, Chinese as well as Western European Languages. My database is set to use UTF-8. Any further help would be greatly appreciated Regards Steve Vanspall PS: Surely there are application that have had to deal with this before? -Original Message- From: Andrew B. Sudell [mailto:[EMAIL PROTECTED]] Sent: Monday, 15 April 2002 10:57 AM To: [EMAIL PROTECTED] Subject: Internatinalisation Question Steve: I noticed your thread on tomcat-user. Something about it seemed wrong to me. But I didn't but in with an answer, as I can't quite put my finger on it. Mind if I ask a few questions? I've got a hunch there's something real important that's been left unsaid. Steve Vanspall writes: Ok having tested a bit more, I think I can give a clearer description of my problem. I am currently in the process of making my application multilingual. I have succesfully altered my database to be such, and it uses UTF-8 character set now. I have changed the meta-inf tag to set the charset to UTF-8. Retrieving information from the database seems to be ok, however, all the pages have forms for entering/altering data. If I enter foreign characters into the form the are received in the database as a string of HTML style character codes. e.g. #23445;#34259;#54301; That's were I start feeling things are weird. I'm assuming here you are entering data into a html form, ie into a text input or something like that. Right? What you are typing above, eg #12345; are html entities. I don't expect to see them in data from the form. That's what's bothering me. Data from a form is generally url-encoded, so any numeric representations of characters are generally of the form %0B, ie hex bytes with leading percents. Those the servlet api will deal with form you -- modulo getting the encoding right so it doesn't mis-transcode the bytes. Are you posting the data or is the action a get? What browser? Do you specify a content type for the form? Can you send me a copy of the form? those aren't the exact integer, but that is the pattern. now the character encoding filter in tomcat 4.0.3 is not doing anything with these characters because it is reading them one by one '' '#' '2' '3' '4' '4' '5' ';' and finding them to be normal characters does not try to convert them. I have then added to the request interception method (doFilter) and added a method that strip the '#' and ';' from either end of the number. It then creates and int out of the reamining string ('23445'). When I cast this int to a char, it seems to come up with the correct character when I debug. This is correct right up until I try to sonvert the string to UTF-8 or just enter it into the database. It then becomes ''. My questions are: 1. as I don't have a foregn keyboard, and am entering the characters in using the Windows Character map; am I entering them in in a form that is not the same as if someone using a chinese keyboard would enter them? Don't know. Don't have access to Windows at the moment [between jobs and run a MS-free home], and haven't used the character map. What's it do? One trick I have used in the past was to just cut and paste data from a good page in the proper encoding. There are some nice example pages at http://vancouver-webpages.com/multilingual/index.shtml that I've used in the past. But, that's mostly native encodings. There are some native and unicode samples at http://www.unicode.org/iuc/iuc10/ , oddly enough, the Unicode conference announcements are multi-lingual. There is also a decent page at the UN. They have the Universal Declaration of rights in every language known to man (just about literally). http
RE: Authentication without using forms
We have a similar situation here. In our case we keep the bean in which you store this information, in session when they logon. You could just store the userid and password in session when they log-on and remove it when they log off. e.g. session.getAttribute(User Information, UserInfoBean); that's how the forms store there information when forwarding to other pages. -Original Message- From: Antonio De Lilla [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 16 April 2002 11:09 AM To: Tomcat Users List Subject: Authentication without using forms Hi All, Please, if someone can help. I'm running Tomcat 4.0.3 with j2sdk1.4 on Linux 7.1 I'm trying to authentify a user to access secure pages without using forms. I would like to call directly j_security_check passing the userid and password as parameters. The problem is that the user has been already authentified, and I don't want to ask him his userid and password again to access the secure pages. Thanks in advanced. Tony -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Internatinalisation Question
The problem seems to have been solved As it suddely fell into place, I need to see what I suddenly did right. Hate it when this happens. But bottom line is that the character filtering does work for tomcat 4. thanks to those who helped. -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 16 April 2002 11:10 AM To: Tomcat Users List Subject: RE: Internatinalisation Question Hi there I have been dealing with this problem for the last few days I am definately making progress now. I found that the @ page tag actually works the form receives information correctly, the only problem now is that the character put when converted to rgular java character set, go in correctly, but the utf-8 representation of these characters are incorrect. Obviously this is due to the fact that the character I am entering in do not have the same character representaion in UTF-8 as they do in ISO-8859-1. so 亞乽乨亪仮 gets converted to 亞乽乨亪仮 i UTF-8. I understand that the above chinese character will not make sense I just picked them out of the windows character set. Now for the question. are the chracter I enter in from the Windows Character Set program, the same as the ones that would be entered in from a native chinese keyboard. If so, why is the conversion not working, If not, where can I get a program that will emulate the chracters that would be entered, so as I can see if the problem lies in Windows or with my conversions. My ultimate aim is to create in which I can set the language on the pages, but have the code itself not have to be changed. This app would need to work in Thai, Chinese as well as Western European Languages. My database is set to use UTF-8. Any further help would be greatly appreciated Regards Steve Vanspall PS: Surely there are application that have had to deal with this before? -Original Message- From: Andrew B. Sudell [mailto:[EMAIL PROTECTED]] Sent: Monday, 15 April 2002 10:57 AM To: [EMAIL PROTECTED] Subject: Internatinalisation Question Steve: I noticed your thread on tomcat-user. Something about it seemed wrong to me. But I didn't but in with an answer, as I can't quite put my finger on it. Mind if I ask a few questions? I've got a hunch there's something real important that's been left unsaid. Steve Vanspall writes: Ok having tested a bit more, I think I can give a clearer description of my problem. I am currently in the process of making my application multilingual. I have succesfully altered my database to be such, and it uses UTF-8 character set now. I have changed the meta-inf tag to set the charset to UTF-8. Retrieving information from the database seems to be ok, however, all the pages have forms for entering/altering data. If I enter foreign characters into the form the are received in the database as a string of HTML style character codes. e.g. #23445;#34259;#54301; That's were I start feeling things are weird. I'm assuming here you are entering data into a html form, ie into a text input or something like that. Right? What you are typing above, eg #12345; are html entities. I don't expect to see them in data from the form. That's what's bothering me. Data from a form is generally url-encoded, so any numeric representations of characters are generally of the form %0B, ie hex bytes with leading percents. Those the servlet api will deal with form you -- modulo getting the encoding right so it doesn't mis-transcode the bytes. Are you posting the data or is the action a get? What browser? Do you specify a content type for the form? Can you send me a copy of the form? those aren't the exact integer, but that is the pattern. now the character encoding filter in tomcat 4.0.3 is not doing anything with these characters because it is reading them one by one '' '#' '2' '3' '4' '4' '5' ';' and finding them to be normal characters does not try to convert them. I have then added to the request interception method (doFilter) and added a method that strip the '#' and ';' from either end of the number. It then creates and int out of the reamining string ('23445'). When I cast this int to a char, it seems to come up with the correct character when I debug. This is correct right up until I try to sonvert the string to UTF-8 or just enter it into the database. It then becomes ''. My questions are: 1. as I don't have a foregn keyboard, and am entering the characters in using the Windows Character map; am I entering them in in a form that is not the same as if someone using a chinese keyboard would enter them? Don't know. Don't have access to Windows at the moment [between jobs and run a MS-free home], and haven't used the character map. What's it do? One trick I have used in the past was to just cut and paste data from a good page in the proper encoding. There are some nice example pages at http
RE: jvm monitoring
try netbeans, http://www.netbeans.org/nonav/index2.html I didn't use it for that purpose, but another developer of ours did. Thiss requires that you set your jvm to debug it sounds like there is an infinite recursion of iteration in your code. -Original Message- From: Laurent Michenaud [mailto:[EMAIL PROTECTED]] Sent: Friday, 12 April 2002 11:45 PM To: [EMAIL PROTECTED] Subject: jvm monitoring Hi, We 've got problems with our application running under Tomcat-3.3.1 with IBM JDK 1.3.1. Memory is growing until it crashes( not enough memory exception ). We have modified the parameter -Xms and -Xmx but it has not changed anything. We think the problem comes from our application. We are searching for a mean of monitoring the objects, instances, heap size, garbage collector, in the JVM. Do u know any tools to do that ? We have tried jprofiler but it does not show the objects created in the different context. Michenaud Laurent - Adeuza - [ Développeur Web - Administrateur Réseau ] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Internatinalisation Question
Ok having tested a bit more, I think I can give a clearer description of my problem. I am currently in the process of making my application multilingual. I have succesfully altered my database to be such, and it uses UTF-8 character set now. I have changed the meta-inf tag to set the charset to UTF-8. Retrieving information from the database seems to be ok, however, all the pages have forms for entering/altering data. If I enter foreign characters into the form the are received in the database as a string of HTML style character codes. e.g. #23445;#34259;#54301; those aren't the exact integer, but that is the pattern. now the character encoding filter in tomcat 4.0.3 is not doing anything with these characters because it is reading them one by one '' '#' '2' '3' '4' '4' '5' ';' and finding them to be normal characters does not try to convert them. I have then added to the request interception method (doFilter) and added a method that strip the '#' and ';' from either end of the number. It then creates and int out of the reamining string ('23445'). When I cast this int to a char, it seems to come up with the correct character when I debug. This is correct right up until I try to sonvert the string to UTF-8 or just enter it into the database. It then becomes ''. My questions are: 1. as I don't have a foregn keyboard, and am entering the characters in using the Windows Character map; am I entering them in in a form that is not the same as if someone using a chinese keyboard would enter them? I.E. is the encoding different. Given that the java code seems to be ok with the integer as chars, I am thinking this is not the case. 2. Is there something I am doing wrong with the conversion? At the moment I am doing new String(origString.getBytes(), UTF-8); 3. If I am entering them in incorrectly; is there an emulation tool that can help me enter the character in correctly? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Foreing Character encoding from jsp form (Character Encoding doesn't work)
HI there, I am having problem with reading foreign characters from a form. I am trying to make it do that Chinese characters can be entered. When I enter them the a received by the request in the form #23495;#34054; etc... I have set the character encoding and filter for UTF-8 in web.xml, I know that it goes through the filter, but the output is the same. presumably because it reads each character in as '' '#' '2' '3' 4' '9' '5' ';', seeing these character as regular ascii character, it doesn't try to change them All my pages are set to UTF-8 charcter encoding. I have altered the filter code myself to intercept the filter and recursive replace these code. basically converting the integere one by one into chars. two problems arise from this. 1. When I then add then string them together using a string buffer/string I get a string of '??', this is also how it is entered into the database (which is set to UTF-8 encoding also) 2. Surely there is a better way to do this. Can anybody help me here, Thanks in advance Steve Vanspall -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Foreing Character encoding from jsp form (Character Encoding doesn't work)
Great. thank you for that -Original Message- From: Evan Child [mailto:[EMAIL PROTECTED]] Sent: Friday, 12 April 2002 10:28 AM To: 'Tomcat Users List' Subject: RE: Foreing Character encoding from jsp form (Character Encoding doesn't work) I found it somewhere on the Internet, which I cannot now remember, but here it is. We've been using it for the past couple of months, and it appears to work well. Good luck, Evan public static String convertURLEncodedUTF8Str(String s) { if (s == null) { return ; } StringBuffer sbuf = new StringBuffer () ; int l = s.length() ; int ch = -1 ; int b, sumb = 0; for (int i = 0, more = -1 ; i l ; i++) { /* Get next byte b from URL segment s */ switch (ch = s.charAt(i)) { case '%': ch = s.charAt (++i) ; int hb = (Character.isDigit ((char) ch) ? ch - '0' : 10+Character.toLowerCase((char) ch) - 'a') 0xF ; ch = s.charAt (++i) ; int lb = (Character.isDigit ((char) ch) ? ch - '0' : 10+Character.toLowerCase ((char) ch)-'a') 0xF ; b = (hb 4) | lb ; break ; case '+': b = ' ' ; break ; default: b = ch ; } /* Decode byte b as UTF-8, sumb collects incomplete chars */ if ((b 0xc0) == 0x80) { // 10xx (continuation byte) sumb = (sumb 6) | (b 0x3f) ; // Add 6 bits to sumb if (--more == 0) sbuf.append((char) sumb) ; // Add char to sbuf } else if ((b 0x80) == 0x00) { // 0xxx (yields 7 bits) sbuf.append((char) b) ; // Store in sbuf } else if ((b 0xe0) == 0xc0) { // 110x (yields 5 bits) sumb = b 0x1f; more = 1; // Expect 1 more byte } else if ((b 0xf0) == 0xe0) { // 1110 (yields 4 bits) sumb = b 0x0f; more = 2; // Expect 2 more bytes } else if ((b 0xf8) == 0xf0) { // 0xxx (yields 3 bits) sumb = b 0x07; more = 3; // Expect 3 more bytes } else if ((b 0xfc) == 0xf8) { // 10xx (yields 2 bits) sumb = b 0x03; more = 4; // Expect 4 more bytes } else /*if ((b 0xfe) == 0xfc)*/ { // 110x (yields 1 bit) sumb = b 0x01; more = 5; // Expect 5 more bytes } /* We don't test if the UTF-8 encoding is well-formed */ } return sbuf.toString() ; } -Original Message- From: Lee Chin Khiong [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:23 PM To: 'Tomcat Users List' Subject: RE: Foreing Character encoding from jsp form (Character Encoding doesn't work) Yes, can I have it too. Thanks. -Original Message- From: Evan Child [mailto:[EMAIL PROTECTED]] Sent: Friday, April 12, 2002 8:21 AM To: 'Tomcat Users List' Subject: RE: Foreing Character encoding from jsp form (Character Encoding doesn't work) What browser are you using to submit the form? Before you start getting parameters, you need to do a request.setCharacterEncoding(UTF-8); I couldn't understand from below if you're already doing that. Assuming that you ultimately want the characters to end up in a utf-8 encoding. If the browser url-encodes the parameters, (for example if this is an HTTP GET request), you'll need to get a decoder to decode that and convert it into regular UTF-8. I have a decoder in java, if you want it. Thanks, Evan -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:27 PM To: Tomcat Users List Subject: Foreing Character encoding from jsp form (Character Encoding doesn't work) HI there, I am having problem with reading foreign characters from a form. I am trying to make it do that Chinese characters can be entered. When I enter them the a received by the request in the form #23495;#34054; etc... I have set the character encoding and filter for UTF-8 in web.xml, I know that it goes through the filter, but the output is the same. presumably because it reads each character in as '' '#' '2' '3' 4' '9' '5' ';', seeing these character as regular ascii character, it doesn't try to change them All my pages
RE: Foreing Character encoding from jsp form (Character Encoding doesn't work)
that. Assuming that you ultimately want the characters to end up in a utf-8 encoding. If the browser url-encodes the parameters, (for example if this is an HTTP GET request), you'll need to get a decoder to decode that and convert it into regular UTF-8. I have a decoder in java, if you want it. Thanks, Evan -Original Message- From: Steve Vanspall [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 11, 2002 6:27 PM To: Tomcat Users List Subject: Foreing Character encoding from jsp form (Character Encoding doesn't work) HI there, I am having problem with reading foreign characters from a form. I am trying to make it do that Chinese characters can be entered. When I enter them the a received by the request in the form #23495;#34054; etc... I have set the character encoding and filter for UTF-8 in web.xml, I know that it goes through the filter, but the output is the same. presumably because it reads each character in as '' '#' '2' '3' 4' '9' '5' ';', seeing these character as regular ascii character, it doesn't try to change them All my pages are set to UTF-8 charcter encoding. I have altered the filter code myself to intercept the filter and recursive replace these code. basically converting the integere one by one into chars. two problems arise from this. 1. When I then add then string them together using a string buffer/string I get a string of '??', this is also how it is entered into the database (which is set to UTF-8 encoding also) 2. Surely there is a better way to do this. Can anybody help me here, Thanks in advance Steve Vanspall -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Still need help with foreign characters
Ok here's the problem I beleive I have succesfully converted the html codes given to me into characters ie. #12451; into the character repesented by integer 12451; atleast when I debug, the variables show up correctly. my problem now is that when the character is inserted into the database, it becomes an upside-down question mark. The database encoding is set to UTF-8, as is the jsp encoding. Can anyone help me here? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]