JSP Compilation Issues
I have a JSP page that is large (contains a large series of tables for displaying lots of data). It is about 2000 lines of HTML. When trying to run this on Tomcat 4.1.27 I get the following error: [ServletException in:/schedule/operational/view.month.jsp] Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file C:\dean\dev-tools\Tomcat 4.1\work\Standalone\localhost\_\schedule\operational\view_month_jsp.java:116 12: code too large for try statement } catch (Throwable t) { ^ C:\dean\dev-tools\Tomcat 4.1\work\Standalone\localhost\_\schedule\operational\view_month_jsp.java:30: code too large for try statement try { ^ C:\dean\dev-tools\Tomcat 4.1\work\Standalone\localhost\_\schedule\operational\view_month_jsp.java:17: code too large public void _jspService(HttpServletRequest request, HttpServletResponse response) ^ 3 errors ' I reviewed the jsp_*.java file that was created (I am assuming by Jasper) and saw that evert individual HTML taq is outputted to the new line, e.g. table width=80trtd align=center colspan=5nbsp;/td/trtrtd align=center colspan=5RDO/td/tr trtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/tdtdnbsp;/ td/tr/table Which is two lines in my JSP, becomes the following in the servlet/java file: out.write(table width=\80\); out.write(tr); out.write(td align=\center\ colspan=\5\nbsp;); out.write(/td); out.write(/tr); out.write(tr); out.write(td align=\center\ colspan=\5\RDO); out.write(/td); out.write(/tr\r\n\t\t\t\t\t\t\t\t\t\t); out.write(tr); out.write(tdnbsp;); out.write(/td); out.write(tdnbsp;); out.write(/td); out.write(tdnbsp;); out.write(/td); out.write(tdnbsp;); out.write(/td); out.write(tdnbsp;); out.write(/td); out.write(/tr); out.write(/table\r\n\t\t\t\t\t); i.e. it is blowing out the individual tags to individual lines (including end tags), and thus making my 2000 line html become 11,000 lines in the servlet and causing the above error (I believe that the there is a 10,000 line limit for a try statement). Is there options to force jasper to compile and not parse out any tag to a new line?? Or is there a way around this??? Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Urgent : Can we restrict access to a directory in tomcat
There is no guaranteed way to stop someone directly access a gif image via a browser url, because this is how an image is accessed by the browser itself anyways. The browser just makes a HTTP get request to the web-server (in this case tomcat) requesting the URL of the image to be included in the web page. i.e. in a standard jsp/servlet response to a web request the image request is embedded in a img src=.../somedir/some-img.gif. This is going to cause a browser request directory to the directory containing the image, which can also be duplicated in the browser. The only potential method that can catch most (but not all) of these would be to create a separate image handling jsp/servlet, say imageHandler. When imageHanlder servlet recieves an image request it can check the http-referrer header and ensure that the referrer is the url of the page to which the images are supposed to load, i.e. is the page containing the images in /servlet/somepage then the http-referrer that imageHandler see should be able to checked that it is /servlet/somepage. Someone can circumvent this control by the Internet, but just manually setting this header themselves (via a program or the like) and then having access directly to the images You would then have to update all image referrences on the somepage servelt/jsp however to something like img src=/servlet/imagehandler?gif=somerefernce. On Mon, 2003-06-09 at 18:32, Syed Nayyer Kamran wrote: hi there, I want to restrict the user to access the images directly through the web. They should be able to access these images through web pages developed as jsp/servlet but should not be able to access these images displayed on page by copying the image url to the address bar. Is tomcat directly support this functionality. or any other solution. Thanks in advance for any solution of the problem. Nayyer Kamran
RE: why has tomcat just crashed
Is localhost somehow removed from the host file?? (windows/systems32/drivers/etc/hosts)? It should be aliased to 127.0.0.1 with: 127.0.0.1 localhost Dean -Original Message- From: JS [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 10:57 AM To: [EMAIL PROTECTED] Subject: RE: why has tomcat just crashed They all work fine, google, bbc, msn. I am connected to my network at uni at the moment, but tomcat still doesnt start at home. I just read on a Java Developer forum to try using http://127.0.0.1:8080 It worked fine??? How come it doesn't work with localhost:8080?? Thanks Howdy, The error you posted seems to be network-related, not specific to tomcat. What happens when you try to do nslookup www.cnn.com (or whatever other site you like)? Yoav Shapira Millennium ChemInformatics -Original Message- From: JS [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 1:28 PM To: [EMAIL PROTECTED] Subject: why has tomcat just crashed Hi All, I recently began using the Java Web Services Devloper Pack (JWSDP) installation of tomcat, which had been running fine up until now.I changed the server.xml file briefly to try and install a new context for my app, but later replaced my changes with the original backup of the server.xml file. Now tomcat is refusing to start up, any idea why this is the case? Heres the error The requested URL could not be retrieved --- - While trying to retrieve the URL: http://localhost:8080/ The following error was encountered: Unable to determine IP address from host name for localhost The dnsserver returned: Name Error: The domain name does not exist. This means that: The cache was not able to resolve the hostname presented in the URL. Check if the address is correct. Your cache administrator is webmaster. Regards JS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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]
Tomcat 4.1.18 not finding JAR's under WEB_INF/lib directory
I am trying to upgrade from 4.0.6 to 4.1.18. I can get the existing webapp to run correctly, when run it with both CATALINA_HOME and CATALINA_BASE set to the same directory, however if I try and start tomcat with CATALINA_HOME and CATALINA_BASE being set differently, I get The system cannot find the path Specified error (see below). The root cause indicates that it is a missing JAR file, but that file exists under the CATALINA_BASE/edgile/WEB-INF/lib directory, but for some reason is not being found. It is found and correctly started when I move the edgile webapp to the webapps directory under CATALINA_HOME. It is not an option to run it with CATALINA_HOME and CATALINA_BASE set the same. Thanks, Dean Errors reported in Tomcat Logs: 2003-03-26 07:41:56 HostConfig[localhost]: Deploying web application directory edgile 2003-03-26 07:41:56 StandardHost[localhost]: Installing web application at context path /edgile from URL file:C:\dean\dev\edgile\admin\webapps\edgile 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploying class repositories to work directory C:\dean\dev\edgile\admin\work\Standalone\localhost\edgile 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy class files /WEB-INF/classes to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\classes 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/batik-awt-util.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\batik-awt-util.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/batik-dom.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\batik-dom.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/batik-svggen.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\batik-svggen.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/batik-util.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\batik-util.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/batik-xml.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\batik-xml.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/cewolf.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\cewolf.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/jcommon-0.7.1.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\jcommon-0.7.1.jar 2003-03-26 07:41:56 WebappLoader[/edgile]: Deploy JAR /WEB-INF/lib/jfreechart-0.9.4.jar to C:\dean\dev\edgile\admin\webapps\edgile\WEB-INF\lib\jfreechart-0.9.4.jar 2003-03-26 07:41:56 ContextConfig[/edgile] Exception processing JAR at resource path /WEB-INF/lib/batik-util.jar javax.servlet.ServletException: Exception processing JAR at resource path /WEB-INF/lib/batik-util.jar at org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:930) at org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java: 243) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:166) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3567) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8 21) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j ava:257) at org.apache.catalina.core.StandardHost.install(StandardHost.java:772) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:569 ) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at org.apache.catalina.core.StandardService.start(StandardService.java:497) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at
RE: Can Tomcat 4 be configured to listen on two ports simultaneously
Are you starting tomcat as root? You will need to start as root in order to be able to bind to port 80 on Linux (any port under 1024). Dean -Original Message- From: Marina McGale [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 9:43 AM To: [EMAIL PROTECTED] Subject: Can Tomcat 4 be configured to listen on two ports simultaneously Hi. I am using Tomcat 4.1.12 and would like it to listen on both port 80 and 8080 because I have already sent out URLs with 8080 in them but want to remove the 8080 for the future (and still want everyone to be able to access my apps). I had tried adding another Connector for port 80 for Tomcat running stand-alone in the server.xml file (so there are two Connectors - one each for port 80 and 8080) and it worked on my localhost (Windows) machine but not when I tried the same thing on Redhat 8. I do not have Apache running so there is no conflict between it and Tomcat trying to listen on the same port. Thanks for any help. M. - 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]