RE: jasper jsp precompilation error
This method was added in Servlet API version 2.3. Can you check if you are using that version ? Have a look at whats in your classpath at JSP precompilation time !!! -Original Message- From: Aaron Phillips [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 23:27 To: tomcat-user@jakarta.apache.org Subject: jasper jsp precompilation error Hi I am trying to do JSP precompilation as described at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html. I can run the application fine if I do not precompile, but when I do attempt to precompile the JSP, I get the message: BUILD FAILED /home/aaron/projects/cdquery/build.xml:307: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths (Ljava/lang/String;)Ljava/util/Set; I am using Tomcat 5.0.30 Ant 1.6.2. Does anyone have an idea what I should do? Below is my ant target XML. Thanks, Aaron target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${catalina.home}/bin include name=*.jar/ /fileset fileset dir=${catalina.home}/server/lib include name=*.jar/ /fileset fileset dir=${catalina.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${web.home} webXmlFragment=${web.home}/WEB-INF/generated_web.xml outputDir=${web.home}/WEB-INF/src / /target ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jasper jsp precompilation error
Hi I am trying to do JSP precompilation as described at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html. I can run the application fine if I do not precompile, but when I do attempt to precompile the JSP, I get the message: BUILD FAILED /home/aaron/projects/cdquery/build.xml:307: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths (Ljava/lang/String;)Ljava/util/Set; I am using Tomcat 5.0.30 Ant 1.6.2. Does anyone have an idea what I should do? Below is my ant target XML. Thanks, Aaron target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${catalina.home}/bin include name=*.jar/ /fileset fileset dir=${catalina.home}/server/lib include name=*.jar/ /fileset fileset dir=${catalina.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${web.home} webXmlFragment=${web.home}/WEB-INF/generated_web.xml outputDir=${web.home}/WEB-INF/src / /target
AW: JSP Precompilation
Maybe there are a few classfiles missing, which are only used with these two jsps. Bernhard -Ursprüngliche Nachricht- Von: Ramnish Kalsi [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 17. August 2005 20:52 An: 'Tomcat Users List' Betreff: JSP Precompilation I am trying to use jasper2 to pre-compile the JSPs as part of build process. The compiler is complaining with the message: ERROR - the file 'blah/blah/jsp' generated the following general exception: java.lang.NullPointerException' After spending some time, i realized that the jsp files which had invalid usage of tags were the culprits. The errors disappeared after tag cleaning. Now this error is only coming for 2 files, and i am positive that there is nothing wrong with tags. What could be other possible reasons ? Is there any way of configuring the compiler to output detailed stacktrace, if it fails at any jsp file compilation. Tomcat version is 4.1. thanks, ramnish. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** - 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 Precompilation
I am trying to use jasper2 to pre-compile the JSPs as part of build process. The compiler is complaining with the message: ERROR - the file 'blah/blah/jsp' generated the following general exception: java.lang.NullPointerException' After spending some time, i realized that the jsp files which had invalid usage of tags were the culprits. The errors disappeared after tag cleaning. Now this error is only coming for 2 files, and i am positive that there is nothing wrong with tags. What could be other possible reasons ? Is there any way of configuring the compiler to output detailed stacktrace, if it fails at any jsp file compilation. Tomcat version is 4.1. thanks, ramnish. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP precompilation, jspc, NullPointerException
Hi, I try to get the precompilation working with tomcat 5.5.7 under Windows NT. I use the following target: target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/bin include name=*.jar/ /fileset fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml outputDir=${webapp.path}/WEB-INF/src / /target And I'm getting a NullPointer Exception (see below), looks like the Jasper cannot be created. Anyone has a clue why this happens? Thanks for your help Bernhard jspc: [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCom pilationContext.java:220) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:847) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:989) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces sorImpl.java:39) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet hodAccessorImpl.java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:585) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123 ) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja va:275) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:364) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:341) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:369) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1214) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1062 ) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:673) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:188) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) BUILD FAILED D:\work\jspdeploy2\precompile.xml:25: org.apache.jasper.JasperException - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why doesn't JSP precompilation solve this problem?
No, I'm not using container-managed security. No, my .css files are not in a different application context (webapp) as the pages. But, yes, I am using MSIE6. Other than the common MSIE6, unfortunately our problems don't appear to be that similar. Frank -Original Message- From: alexander dosher [mailto:[EMAIL PROTECTED] Sent: 13 March 2005 00:03 To: Tomcat Users List Subject: Re: Why doesn't JSP precompilation solve this problem? When I deploy the application, and I newly visit each page, all of the text is displayed but the other visual elements (such as font-sizes, table layouts, colours, and other formatting set by CSS)appear broken. are you using container-managed security? are your .css files in a different application context than the page? is your browser MSIE6? if so, this *might* be similar to a problem i'm having, which stems from the fact that tomcat will serve unauthenticated http 304s (Not Modified). so IE will render the page content it has cached, but if the .css files come from a different context (or maybe even the same one, i haven't tried it like that) IE won't reload them - and apparently it doesn't cache them like it does the page. and you get non-styled ugliness. haven't got a solution, short of filing the 403s thing as a bug, but this might help explain what you're seeing... --alex. - 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: Why doesn't JSP precompilation solve this problem?
Sounds odd. For debugging - try using Mozilla (or Firefox). For Mozilla there is a utility for viewing the header sent and received. Firefox also has one called the webdeveloper toobar which can also do the same. Try loading the css files (or other broken assets) and check the responses being sent and received to find sketchy activity. -Tim Frank Burns wrote: I'm using Tomcat v5.0.28 and have built a Struts-based application, using Tiles, to construct the web pages. When I deploy the application, and I newly visit each page, all of the text is displayed but the other visual elements (such as font-sizes, table layouts, colours, and other formatting set by CSS)appear broken. When I'm developing the pages and want to check that they are visually correct, I lose a lot of time having to re-hit the pages -- sometimes up to twenty times before they will render properly -- and it's driving me bonkers! I thought the problem might have something to do with the fact that the JSPs have to be compiled by Tomcat (Jasper) when they are first accessed. However, I now precompile all of my JSPs before deploying the application but exactly the same problems occur. I have no idea why this is happening. Can anyone explain why? And, especially, can anyone tell me how to resolve this? Sincerely, Frank Burns. - 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]
Why doesn't JSP precompilation solve this problem?
I'm using Tomcat v5.0.28 and have built a Struts-based application, using Tiles, to construct the web pages. When I deploy the application, and I newly visit each page, all of the text is displayed but the other visual elements (such as font-sizes, table layouts, colours, and other formatting set by CSS)appear broken. When I'm developing the pages and want to check that they are visually correct, I lose a lot of time having to re-hit the pages -- sometimes up to twenty times before they will render properly -- and it's driving me bonkers! I thought the problem might have something to do with the fact that the JSPs have to be compiled by Tomcat (Jasper) when they are first accessed. However, I now precompile all of my JSPs before deploying the application but exactly the same problems occur. I have no idea why this is happening. Can anyone explain why? And, especially, can anyone tell me how to resolve this? Sincerely, Frank Burns. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why doesn't JSP precompilation solve this problem?
When I deploy the application, and I newly visit each page, all of the text is displayed but the other visual elements (such as font-sizes, table layouts, colours, and other formatting set by CSS)appear broken. are you using container-managed security? are your .css files in a different application context than the page? is your browser MSIE6? if so, this *might* be similar to a problem i'm having, which stems from the fact that tomcat will serve unauthenticated http 304s (Not Modified). so IE will render the page content it has cached, but if the .css files come from a different context (or maybe even the same one, i haven't tried it like that) IE won't reload them - and apparently it doesn't cache them like it does the page. and you get non-styled ugliness. haven't got a solution, short of filing the 403s thing as a bug, but this might help explain what you're seeing... --alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Coding In Paradise: Tomcat JSP Precompilation is SLOW!!
The entire JSP compilation process, using Ant and the jasper2 ant task, takes about 30 minutes! This is far too long. I mean, there are systems that are doing more than just compiling text, such as advanced 3D graphics and speech recognition, that are far faster than Tomcat's JSP compilation. Fun! Why isn't fixing this a huge priority!? http://codinginparadise.org/weblog/2005/01/tomcat-jsp-precompilation-is-slow.html -- Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat. Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod! Kevin A. Burton, Location - San Francisco, CA AIM/YIM - sfburtonator, Web - http://peerfear.org/ GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
Re: Coding In Paradise: Tomcat JSP Precompilation is SLOW!!
Why not hit every URL with curl or wget before deploying and include Tomcat's work directory with your deployment? How does that compare for speed? Also, have you tried giving Ant some extra heap to play with? I think this is how (on unix): export ANT_OPTS=-Xms256M -Xmx256M yours, Julius On Fri, 2005-07-01 at 17:01 -0800, Kevin A. Burton wrote: The entire JSP compilation process, using Ant and the jasper2 ant task, takes about 30 minutes! This is far too long. I mean, there are systems that are doing more than just compiling text, such as advanced 3D graphics and speech recognition, that are far faster than Tomcat's JSP compilation. Fun! Why isn't fixing this a huge priority!? http://codinginparadise.org/weblog/2005/01/tomcat-jsp-precompilation-is-slow.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Coding In Paradise: Tomcat JSP Precompilation is SLOW!!
Julius Davies wrote: Why not hit every URL with curl or wget before deploying and include Tomcat's work directory with your deployment? How does that compare for speed? We've already tried that... First off its the same speed... second there are horrible out of memory issues with the JspPrecompiler. Its a lovely piece of code! Also, have you tried giving Ant some extra heap to play with? I think this is how (on unix): export ANT_OPTS=-Xms256M -Xmx256M How would that help us? Won't it just run out of memory if heap were an issue? Kevin -- Use Rojo (RSS/Atom aggregator). Visit http://rojo.com. Ask me for an invite! Also see irc.freenode.net #rojo if you want to chat. Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html If you're interested in RSS, Weblogs, Social Networking, etc... then you should work for Rojo! If you recommend someone and we hire them you'll get a free iPod! Kevin A. Burton, Location - San Francisco, CA AIM/YIM - sfburtonator, Web - http://peerfear.org/ GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation with Tomcat 5
On Tue, Aug 10, 2004 at 11:44:54PM -0400, [EMAIL PROTECTED] wrote: : BUILD FAILED : java.lang.IncompatibleClassChangeError: Implementing class Given the definition of IncompatibleClassChangeError[1], it sounds like you have a rogue JAR or classfile somewhere in the classpath. If you're upgrading from Tomcat 4 - 5 beware of lingering v4 code. Check the various endorsed dirs, as people sometimes put JARs there out of desperation and then forget about them. Also, this looks odd: : classpath id=jspc.classpath : pathelement path=${env.JAVA_HOME}/lib/tools.jar/ I don't know whether it's wrong, just that my precompilation works without it. =) : fileset dir=${env.CATALINA_HOME} : include name=jasper-compiler.jar/ : /fileset Wouldn't this be common/lib/jasper-compiler.jar ? -and wouldn't you also need servlet-api.jar and jsp-api.jar? -QM [1] = http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IncompatibleClassChangeError.html Thrown when an incompatible class change has occurred to some class definition. The definition of some class, on which the currently executing method depends, has since changed. -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP Precompilation with Tomcat 5
I have been trying to resolve a frustration JSP precompilation problem with Tomcat 5. I had everythng working in prior Tomcat releases but ever since the upgrade to 5 I am getting the following error when I try to precompile my JSPs. BUILD FAILED java.lang.IncompatibleClassChangeError: Implementing class java.lang.IncompatibleClassChangeError: Implementing class at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at org.apache.tools.ant.loader.AntClassLoader2.defineClassFromData(AntClassLoader2.java:76) at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1073) at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1137) at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090) at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457) at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) Here is the excerpt from my build.xml target name=jspc depends=prepare, compile description=prepares JSP source files !-- echoproperties/ -- echo message=About to define JspC task/ taskdef classname=org.apache.jasper.JspC name=jasper2 !-- -- classpath id=jspc.classpath pathelement path=${env.JAVA_HOME}/lib/tools.jar/ fileset dir=${env.CATALINA_HOME} include name=jasper-compiler.jar/ /fileset pathelement path=${srcDir}/WEB-INF/lib/taglibs.jar/ /classpath /taskdef echo message=after JspC task defintion/ echo message=About to invoke jasper2/ jasper2 validateXml=false uriroot=${srcDir} webXmlFramgment=${srcDir}/WEB-INF/generated_web.xml outputDir=${jspDir}/ /target target name=jspCompile depends=jspc description=compiles JSP source files javac srcdir=${jspDir} destdir=${srcDir}/WEB-INF/classes classpathref=classpath/ /target I would greatly appreciate any and all help in resolving this issue as I am at my wits end and out of ideas to try. Thanks in advance! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP Precompilation in Tomcat 5.0.26
Hello: I am attempting to upgrade from Tomcat 4.0.6 to 5.0.26 (embedded in JBoss 3.2.5). However, following the upgrade, I can no longer seem to precompile my JSPs as I did before. The following build.xml extract worked fine in 4.0.6: jspc srcdir=${srcDir} destdir=${jspDir} package=${pkgName} verbose=2 compilerclasspath=${env.CATALINA_HOME}/jasper-compiler.jar include name=**/*.jsp / classpath pathelement path=${env.CATALINA_HOME}/servlet-api.jar/ pathelement path=${env.CATALINA_HOME}/commons-logging.jar/ pathelement path=${env.CATALINA_HOME}/jasper-compiler.jar/ pathelement path=${env.CATALINA_HOME}/jasper-runtime.jar/ pathelement path=${env.XERCES_HOME}/xmlParserAPIs.jar/ pathelement path=${env.XERCES_HOME}/xercesImpl.jar/ pathelement path=${srcDir}/WEB-INF/lib/taglibs.jar/ /classpath /jspc Follwing the 5.0.26 upgrade, this now produces errors such as the following: [jasperc] org.apache.jasper.JasperException: Unrecognized option: -v2. Use -help for help. I have also unsuccessfuly tried the apparently new, Tomcat 5 recommended way of precompiling as follows: taskdef classname=org.apache.jasper.JspC name=jasper2 classpath pathelement path=${env.JAVA_HOME}/lib/tools.jar/ fileset dir=${env.CATALINA_HOME} include name=*.jar/ /fileset fileset dir=${env.CATALINA_HOME}/ include name=servlet*.jar/ /fileset fileset dir=${env.CATALINA_HOME}/ include name=commons*.jar/ /fileset pathelement path=${srcDir}/WEB-INF/lib/taglibs.jar/ /classpath /taskdef jasper2 validateXml=false uriroot=${srcDir} webXmlFramgment=${srcDir}/WEB-INF/generated_web.xml outputDir=${jspDir}/ This produces the following error java.lang.IncompatibleClassChangeError: Implementing class What am I missing and/or not doing in the new version? What does this error mean in this context and how can I get more information about it (for example what class is being changed in an incompatible manner)? This is a stock Tomcat 5.0.26/JBoss 3.2.5 installation. I'd appreciate any and all tips on what to investigate or how I might track this down and resolve it. Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP Precompilation using Jasper
HI to all, I am using Jasper(Tomcat) for converting the JSP Page to .java files. I have configured my ant build file to add jspc task and providing the necessary attributes. jspc srcdir=jsp destdir=source verbose=9 uriroot=${jboss_home}\server\default\deploy\wsc.ear\wsc.war classpathref=project.class.path webinc=${jspc.webxml.fragment} include name=**/*.jsp/ /jspc On using, EmptyStackException is thrown. Can anyone provide me any suggestions ? Thanks :) Parmar __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP Precompilation / JSPC / JSP servlet mapping
Hi, I've set my Tomcat 4.1.24 installation to production mode, i.e. I've set 'development' to false, 'reloading' to true and 'fork' to true in CATALINA_HOME/conf/web.xml. I have some JSPs that are modified from time to time. My questions are: 1a. Why is the package name for java files generated from a JSP compilation different when using JSPC and when you let Jasper compile the JSP when you access it (especially for JSP in directories in a context)? 1b. Can you use JSPC to precompile JSPs into the work directory without having to wait till they are accessed or using something like UNIX's wget to 'touch' the file and force a compilation? 2. How exactly does Jasper precompile JSPs into the work directory? Can one write an Ant build file to precompile JSPs in a context to the work dir the same way Jasper does? 3. If you've precompiled your JSPs and mapped them in web.xml would Jasper precompile them and reload them if they are subsequently modified? 4. What are the advantages of mapping JSPs in web.xml as opposed to having Jasper compile them in the work directory? Zach. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
At 09:24 AM 7/18/2003, you wrote: Hi, I've set my Tomcat 4.1.24 installation to production mode, i.e. I've set 'development' to false, 'reloading' to true and 'fork' to true in CATALINA_HOME/conf/web.xml. If you're in production, reloading should be false (you don't want to poll for changed resources). I have some JSPs that are modified from time to time. My questions are: ... all answered many times. STFA for precompile or derivatives: http://marc.theaimsgroup.com/?l=tomcat-user RTFM under Web Application Compilation http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html If you still can't find the answers, post again and we'll clarify. justin 1a. Why is the package name for java files generated from a JSP compilation different when using JSPC and when you let Jasper compile the JSP when you access it (especially for JSP in directories in a context)? 1b. Can you use JSPC to precompile JSPs into the work directory without having to wait till they are accessed or using something like UNIX's wget to 'touch' the file and force a compilation? 2. How exactly does Jasper precompile JSPs into the work directory? Can one write an Ant build file to precompile JSPs in a context to the work dir the same way Jasper does? 3. If you've precompiled your JSPs and mapped them in web.xml would Jasper precompile them and reload them if they are subsequently modified? 4. What are the advantages of mapping JSPs in web.xml as opposed to having Jasper compile them in the work directory? Zach. Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
Then, the declarations and mappings for the servlets which were generated during the precompilation must be added to the web application deployment descriptor. Insert the ${webapp.path}/WEB-INF/generated_web.xml at the right place inside the ${webapp.path}/WEB-INF/web.xml file. Restart the web application (using the manager) and test it to verify it is running fine with precompiled servlets. An appropriate token placed in the web application deployment descriptor may also be used to automatically insert the generated servlet declarations and mappings using Ant filtering capabilities. This is actually how all the webapps distributed with Tomcat are automatically compiled as part of the build process. This is the part that is very unclear. Please explain the use of the webXmlFragment and how it can be used to place the mappings into a web.xml. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
At 01:46 PM 7/18/2003, you wrote: ...An appropriate token placed in the web application deployment descriptor may also be used to automatically insert the generated servlet declarations and mappings using Ant filtering capabilities. This is actually how all the webapps distributed with Tomcat are automatically compiled as part of the build process. This is the part that is very unclear. Please explain the use of the webXmlFragment and how it can be used to place the mappings into a web.xml. See Ant's Filter task documentation. Basically, you take your web.xml as you have it (without any of the precompiled jsp information) and add a token like @jspServletXml where you want the fragment placed at. Then define a filter in your build xml (using jspServletXml and webXmlFragment) and copy your existing web.xml to a new location (with filtering=true) -- this replaces @jspServletXml with jasper2's generated xml. Disclaimer: I don't use this method because the Ant tasks don't do what I need it to do (I need to support builds with precompile for multiple appservers). Instead, I manually enter all information for our precompiled jsps in the web.xml and use a different script for running jspc. justin Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP precompilation and including webinc.xml in web.xml
Al, If it's of any use at this point, your setup should work under 4.1. I did something very similar that worked with 4.1.8. Al Tingley wrote: Hello, We are trying to automate the pre-compilation of our JSP files with JspC and the inclusion of the generated webinc.xml file in our application web.xml file. We have constructed an application web.xml as shown below. Both web.xml and webinc.xml are local to the .../webapps/application/WEB-INF/ directory. Our problem is that Tomcat complains when starting up with the message: org.xml.sax.SAXParseException: Relative URI webinc.xml; can not be resolved without a base URI. Note the local reference to webinc.xml below in the DOCTYPE tag. If we change the reference to webinc.xml to an absolute URI of the form below (on Windows): file://E/jakarta-tomcat-4.0.4b3/webapps/appname/WEB-INF/webinc.xml ... we get a null pointer exception when Tomcat starts up (parser error at the line where we reference the file to be included): 2002-06-04 08:55:27 ContextConfig[/voicemail] Parse error in application web.xml java.lang.NullPointerException at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXParser.java:314) ... What are we doing wrong? We're using Tomcat 4.0.4b3. Thanks, Alan Tingley Iperia, Inc. --- The application web.xml file: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; [!ENTITY includes SYSTEM webinc.xml] web-app !-- all of the precompiled jsp declarations and mappings are in this included file from the JspC -- includes; /web-app --- Output when starting up Tomcat: Starting service Tomcat-Standalone Apache Tomcat/4.0.4-b3 PARSE error at line 6 column -1 org.xml.sax.SAXParseException: Relative URI webinc.xml; can not be resolved without a base URI. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ smime.p7s Description: S/MIME Cryptographic Signature
Re: JSP precompilation and including webinc.xml in web.xml
Al == Al Tingley [EMAIL PROTECTED] writes: Al Hello, Al We are trying to automate the pre-compilation of our JSP files with JspC and Al the inclusion of the generated webinc.xml file in our application Al web.xml file. We have constructed an application web.xml as shown below. Al Both web.xml and webinc.xml are local to the Al .../webapps/application/WEB-INF/ directory. Al Our problem is that Tomcat complains when starting up with the message: Al org.xml.sax.SAXParseException: Relative URI webinc.xml; can not Al be resolved without a base URI. Al Note the local reference to webinc.xml below in the DOCTYPE tag. I got the complete precompilation process to work, but I gave up on trying to reference the include file with an entity reference. It just doesn't work. What I was able to do was write an XSLT stylesheet that takes the main web.xml and the generated include file and generates a new web.xml that incorporates both files. It uses the Ant style task to do the transformation. A slight wrinkle is that the generated include file is not a fully well-formed XML file, in that it doesn't have a root element. So, in order for the XML parser (used by Ant) to grok it, I had to write a simple well-formed wrapper that references the include file with an entity reference. It's ironic that I'm using the same mechanism in this process that I gave up with using inside of Tomcat. I'll show all the pieces of my solution here. This is the excerpt from my build-war Ant target related to this: - delete dir=jspc/ mkdir dir=jspc/ java classname=org.apache.jasper.JspC fork=yes arg line=-v -d jspc -p org.apache.jsp -uriroot build -webinc web-inf/webinc.xml -webapp build / classpath pathelement location=${catalina.home}/common/lib/jasper-compiler.jar/ pathelement location=${catalina.home}/common/lib/jasper-runtime.jar/ pathelement location=weblib/servlet.jar/ /classpath /java !-- Here, run a style task to merge the two web.xml pieces. -- style basedir=build/WEB-INF in=web-inf/web.xml out=build/WEB-INF/web2.xml style=web-inf/webmerge.xsl param name=includeFile expression=includeWrapper.xml/ /style move file=build/WEB-INF/web2.xml tofile=build/WEB-INF/web.xml/ javac srcdir=jspc destdir=classes debug=on optimize=off deprecation=on classpath pathelement location=${catalina.home}/common/lib/jasper-compiler.jar/ pathelement location=${catalina.home}/common/lib/jasper-runtime.jar/ fileset dir=weblib include name=*.jar/ /fileset /classpath include name=**/*.java/ /javac copy todir=build/WEB-INF/classes fileset dir=webprops include name=**/*.properties/ /fileset fileset dir=classes include name=com/intsoft/strutstest/**/*.class/ include name=org/apache/jsp/**/*.class/ /fileset /copy jar jarfile=deploy/strutstest.war fileset dir=build include name=**/ exclude name=*.jsp/ /fileset /jar - Following this is the includeWrapper.xml file, which references the generated include file. Note that I have to reference a path of web-inf/webinc.xml, which is the path to the generated file in my build tree (not my deploy tree). I'm using Ant 1.4. In Ant 1.5.1, there is apparently some new features in the style task that allow the specification of an alternate EntityResolver that would allow me to avoid hardcoding the name of the directory the file is in. - ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; [ !ENTITY webinc PUBLIC webinc file:web-inf/webinc.xml ] web-app webinc; /web-app - And finally, here is the stylesheet (webmerge.xsl) that does the transformation: - ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; !-- This takes a parameter indicating the name of the secondary file to merge in. When we've matched the web-app element, we will first insert the servlet elements of the include file, then the servlet elements of the main file, then the servlet-mapping elements of the include file, then the servlet-mapping elements of the main file, and then all the remaining elements of the main file (which will be specified explicitly by element type. -- xsl:output method=xml indent=yes doctype-public=-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN doctype-system=http://java.sun.com/dtd/web-app_2_3.dtd/ xsl:param name=includeFile/ !-- get the required elements of web-app, in their defined order, according to the DTD. -- xsl:template match=/web-app web-app xsl:apply-templates select=icon/ xsl:apply-templates select=display-name/ xsl:apply-templates select=description/
JSP precompilation and including webinc.xml in web.xml
Hello, We are trying to automate the pre-compilation of our JSP files with JspC and the inclusion of the generated webinc.xml file in our application web.xml file. We have constructed an application web.xml as shown below. Both web.xml and webinc.xml are local to the .../webapps/application/WEB-INF/ directory. Our problem is that Tomcat complains when starting up with the message: org.xml.sax.SAXParseException: Relative URI webinc.xml; can not be resolved without a base URI. Note the local reference to webinc.xml below in the DOCTYPE tag. If we change the reference to webinc.xml to an absolute URI of the form below (on Windows): file://E/jakarta-tomcat-4.0.4b3/webapps/appname/WEB-INF/webinc.xml ... we get a null pointer exception when Tomcat starts up (parser error at the line where we reference the file to be included): 2002-06-04 08:55:27 ContextConfig[/voicemail] Parse error in application web.xml java.lang.NullPointerException at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXParser.java:314) ... What are we doing wrong? We're using Tomcat 4.0.4b3. Thanks, Alan Tingley Iperia, Inc. --- The application web.xml file: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; [!ENTITY includes SYSTEM webinc.xml] web-app !-- all of the precompiled jsp declarations and mappings are in this included file from the JspC -- includes; /web-app --- Output when starting up Tomcat: Starting service Tomcat-Standalone Apache Tomcat/4.0.4-b3 PARSE error at line 6 column -1 org.xml.sax.SAXParseException: Relative URI webinc.xml; can not be resolved without a base URI. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: jsp precompilation
You might want to look at a mixture between JSPC (Tomcat) and Ant I'm searching a script ( bash-unix and/or bat-windows ) You should then use Ant and create Ant tasks that you need (if you need to write some...) that would : - generate java files from jsp - compile generated java files use JSPC (why not within Ant ? I don't remember if JSPC has a task on its own but you can write one if it does not, or use a simple shell-command task) - compile servlet java files Use Ant and the JDK you're working with - create the .war Definitely, you should use Ant ;-) http://jakarta.apache.org/ant Cheers Denis -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: jsp precompilation
Laurent Michenaud wrote: Hi, I'm searching a script ( bash-unix and/or bat-windows ) that would : - generate java files from jsp In Tomcat's ./bin dir there is jasper.sh, this is how you invoke it: ${CATALINA_HOME}/bin/jasper.sh jspc MyPage.jsp This will produce MyPage.java - compile generated java files javac -classpath ${CATALINA_HOME}/common/lib/servlet.jar MyPage.java - compile servlet java files javac MyServlet.java - create the .war mv MyPage.class ${MY_WEB_APP_HOME}/WEB-INF/classes/path/to/my/package/ jar cf MyWebApp.war ${MY_WEB_APP_HOME} Or be advanced - make a build.xml for Ant and do it that way. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]