Tomcat5 and precompiling JSPs with Ant

Hi I'm trying to precompile my JSPs in ANT and I'm using Tomcat5. Below is my taskdef:
<target name="jsp" depends="build">
    <!--
         The Ant JSPC task doesn't work with Tomcat 5.0
         so in the meantime we need to define our own task.
      -->
    <taskdef name="jspc50" classname="org.apache.jasper.JspC">
        <classpath id="jspc50.classpath">
            <fileset dir="${tomcat.home}">
                <include name="*.jar"/>
            </fileset>
        </classpath>
    </taskdef>
    <jspc50 outputDir="${classes}"
            uriroot="${src}"
            package="jsp"
            validateXml="false">
        <include name="**/*.jsp" />
        <exclude name="**/includes/**/*.jsp" />
    </jspc50>
    <javac srcdir="${classes}"
           destdir="${classes}"
           debug="true"
           optimize="false"
           includes="**/*.java"
           source="1.4">
    </javac>
</target>Now, this actually works but if I use an absolute include directive in my JSPs like:
<%@ include file="/includes/header.jsp" %>Then I get the "/include/header.jsp" not found. However, if I change to
<jsp:include page="/includes/header.jsp" />It works fine. Now, I want to use an absolute path and I also want to use the include directive. Has anybody seen this problem and know a solution?
Thanks,
Mike

Hi All,
Pls. help
I have deployed my application on Sun Appln server 9.0. When I try to lauch the application it gives following error.
[#|2007-11-06T17:31:16.451+0530|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Th
readID=13;_ThreadName=httpWorkerThread-8080-0;_RequestID=076de172-4f31-4f76-888d-a19cc736c3ee;|Stand
ardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagExtraInfo
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:100)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.sun.enterprise.util.ConnectorClassLoader.loadClass(ConnectorClassLoader.java:176)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1405)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1292)
at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:478)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:298)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:176)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:445)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:513)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1579)
at org.apache.jasper.compiler.Parser.parse(Parser.java:151)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:129)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:360)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:397)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:505)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1579)
at org.apache.jasper.compiler.Parser.parse(Parser.java:151)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:113)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:224)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:526)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:507)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:530)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:412)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.jav
a:397)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at com.fdu.mdsgui.web.filter.LocaleFilter.doFilter(LocaleFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:188)
at com.fdu.mdsgui.web.filter.MDSSecurityFilter.doFilter(MDSSecurityFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:24
0)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:6
67)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.ja
va:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
|#]

Similar Messages

  • Precompile jsps via ant

    I have a development project that has been setup to use JDeveloper 10.1.3.5.0 to create and EAR for deployment. The EAR is comprised of three sub applications - appData, appEjb, appWeb. Each subapplication has its own resource to deploy in JDeveloper. The appWeb has an additional resource defined in JDeveloper to deploy the EAR.
    I am attempting to move the build process out of JDeveloper and into ant in order to integrate the application with an automated build management framework.
    I have been successful in creating an ant build.xml to pull the code from source control, compile the three subapplications, jar the appData, and jar the appEjb. The issue I am having is precompiling the jsp files in the appWeb.
    The JDeveloper resource for appWeb.deploy precompiles all the jsps and packages the jsp class files along with all the other appWeb content as part of the appWeb.war.
    I thought JDeveloper was utilizing an internal J2EE standalone OC4J. I created a classpath and taskdef as follows
    <path id="ojspc.classpath">
    <fileset dir="jdevstudio">
    <include name="**/*.jar"/>
    </fileset>
    <pathelement location="${env.JAVA_HOME}/lib/tools.jar" />
    <pathelement location="${outDir}/appData"/>
    <pathelement location="${outDir}/appWeb"/>
    <pathelement location="${outDir}/appEjb"/>
    </path>
    <taskdef name="ojspc" classpathref="ojspc.classpath" classname="org.apache.tools.ant.taskdefs.optional.jsp.OjspC" />
    My original attempts had a much more constrained classpath definition (using the classpath found in the manifest file within j2ee\home\ojspc.jar); however, ant is unable to find the OjspC class and thus I expanded the classpath to include all jar files.
    After reading through blogs, forums, and documentation, I am unable to figure out how to define a task within ant to precompile the jsps in my project which mirrors the work being done via the JDeveloper deploy resource. Does anyone know the actual class to use for precompiling the jsps?
    Any help is greatly apprciated,
    /dclink

    GR wrote:
              > Is there any ant task for precompiling jsp provided by weblogic 8.1.2?
              > (Ant's wljspc doesnt work with 8.1.2).
              Have you tired a regular java task that calls the class weblogic.jspc?
              A little more direct but I imagine it would work
              ~Ryan
              

  • Re: Precompiling JSP with admin/managed servers

    Thanks, but I'm not doing any copying.
              The admin/managed-server communication copies things to the managed server,
              which then always recompiles the pages when hit.
              -Greg
              Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              "Robert Coonrad" <[email protected]> wrote in message
              news:[email protected]...
              >
              > check out post 8366...i found that i was not preserving
              > the lastmodified date on my jsps and this was causing
              > unnecessary re-compilation.
              >
              > hope it helps...
              > bobc
              >
              > "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
              > >I believe I have exhausted all permutations of EARing/notEARing,
              > >WARing/notWARing, placing precompiled jsp class files in WEB-INF/classes,
              > >placing them in a static location and setting workingDir to that
              location,
              > >combinations of the above.
              > >
              > >No matter what, the managed server re-compiles pages the first time they
              > >are
              > >hit. Non admin/managed-server I have no problems.
              > >
              > >Can anyone from BEA comment on this problem? Or give me a workaround
              > >for
              > >getting a cluster working with precompiled jsps?
              > >
              > >-Greg
              > >
              > >"Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote in message
              > >news:[email protected]...
              > >> Grrr... The JSP engine is extremely frustrating! I've spent many hours
              > >> fighting the "staleness" checker in WL. I've been through all of the
              > >> newsgroup messages pertaining to pre-compiling, etc., and I've gotten
              > >> pre-compilation working on single-server deployments, but admin/managed
              > >> server deployments have me beat.
              > >>
              > >> WL6.1, SP1, Solaris
              > >>
              > >> I've done the pageCheckSeconds=-1 and the workingDir is set to a fixed
              > >> place. The fixed place contains pre-compiled versions of all jsps
              > >made on
              > >> that machine using jspc not 20 minutes earlier using the JSP files
              > >in the
              > >> exploded EAR file used by the admin server as the model for managed
              > >> servers.. The managed servers are on the same machine.
              > >>
              > >> When the admin server gives an application to a managed server, the
              > >managed
              > >> server creates a temporary directory containing all of the webapp
              > >> components, etc. The file timestamps on these files is the set by
              > >the
              > >> copying process to the time of the managed server boot (why?!?!????!?),
              > >so
              > >> the staleness check always thinks they are new and could care less
              > >what
              > >> precompiled jsps I have in my workingDir, the WEB-INF/classes
              directory,
              > >or
              > >> anywhere else. The pageCheckSeconds=-1 seems to be completely ignored
              > >in
              > >> this scenario.
              > >>
              > >> If I tell the managed server to precompile everything on boot (about
              > >45
              > >> minutes for this app) it will create versions of the classes that match
              > >th
              > >e
              > >> new JSP file timestamps, but this does not even survive a reboot of
              > >the
              > >> managed server because it AGAIN creates a new temp version of
              everything
              > >on
              > >> the next reboot with new timestamps.
              > >>
              > >> If I wait for the managed server to boot and find the directory like
              > >> .../applications/.wlnotdelete_man1/wlap7336/webapp/... and physically
              > >copy
              > >> (via cp -pr to retain timestamps) all of the original webapp components
              > >on
              > >> top of the temp versions, the staleness checker is happy and the
              > >> pre-compiled versions work fine.
              > >>
              > >> There HAS to be a way to package pre-compiled versions of the JSPs
              > >in the
              > >> "model" application in the admin server and keep from having to
              precompile
              > >> the JSPs on every managed server every time managed server is booted..
              > >>
              > >> It would help if we had a way to bypass the staleness checking
              > >completely..
              > >> Or you guys should make the timestamps on the files copied by the
              > >> admin/managed deployment process match properly so the staleness
              checker
              > >> doesn't think the JSP is different.
              > >>
              > >> It would also help if the engineer who wrote this could explain the
              > >rules
              > >> being implemented by the staleness checker. So far all the messages
              > >in
              > >the
              > >> newsgroup have amounted to point solutions for problems without a good
              > >> understanding of what the engine is checking for and/or doing under
              > >the
              > >> covers. Looking at the generated .java files for the JSP pages helps,
              > >but
              > >> it is not good enough...
              > >>
              > >> Anyone out there have a working admin/managed server JSP application?
              > >> -Greg
              > >>
              > >> -----------------------------------------------------------
              > >> Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              > >> www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              > >>
              > >>
              > >>
              > >
              > >
              >
              

    The admin/managed-server communication copies things to the managed server, which then always recompiles the pages when hit.
              This is a known issue and is fixed. The timestamps of the compiled classes was not being preserved when extracted from the war file used to distribute to the managed servers. This will be available in WLS6.1 Service Pack 3 - and there is a temporary patch available for SP2. Please ask your friendly BEA support person for it (you can refer to CR058946)
              I'd give you the patch myself, but they like to keep track of these things...
              Regards,
              Alex
              "Girish" <[email protected]> wrote in message news:[email protected]...
              >
              > "Aditya Kiran Gavvala" <[email protected]> wrote:
              > >Greg,
              > >
              > >I have been following your posts, because our application deployment
              > >ran
              > >into exact same problem you ran into. I had spent a full two days
              > >researching into the problem. And I figured the solution. Hope this
              > >helps.
              > >
              > >Here are my discoveries:
              > >
              > >The following applies only to the following environment:
              > >OS: Linux (perhaps for Win/Unix/Solaris etc)
              > >WLS 6.0 SP2 ( no rolling patches): I found Rolling Patch2 (RP2) not useful
              > >for this problem.
              > >Clustered environment with Admin/Managed servers
              > >
              > >- When you compile JSP using weblogic.jspc compiler it puts the JSP file
              > >timestamp into the compiled class. You can see it in the generated java
              > >file
              > >(you need to supply -keepgenerated switch to jspc)
              > >
              > >- When a request is made to a JSP page after the application is deployed,
              > >it
              > >seems to be retrieving this timestamp from the compiled class file and
              > >comparing it with the JSP file timestamp. If they dont match a compile
              > >command gets run by the server. Thereby you see a compile happening at
              > >run
              > >time.
              > >
              > >- If you have exploded directory deployment, when you start the managed
              > >servers they create a ".war" file (under some temp dir) with all the
              > >JSP
              > >source files going into the file. You can notice this by looking into
              > >the
              > >server log file. Therefore all JSP source files get a brand new timestamp
              > >in
              > >the archive (a timestamp later than what was put class files by
              > >weblogic.jspc). So, the server at run time sees that the timestamp in
              > >the
              > >class file is older than the JSP source file and runs a recompile. So
              > >DONT
              > >DO EXPLODED directory deployment if your environment is as described
              > >in this
              > >post.
              > >
              > >- If you have ".war" file deployment, you will not have a problem. At
              > >the
              > >start up time managed server still creates "".war" file under a temp
              > >directory however it seems to be copying the content of the your ".war"
              > >file. So, the timestamps of JSP remain the same as they were before.
              > >SO NO
              > >RE-COMPILATION.
              > >
              > >- Another important thing to remember is to make sure you specify the
              > >workingDir in the weblogic.xml file. That is where the precompiled class
              > >files should reside. This should be any directory the server uses as
              > >scratch
              > >pad to compile classes or find (pre)compiled classes. This is not a
              > >directory inside your .war file is what I am trying to get at.
              > >
              > >Hope this helps,
              > >Aditya
              > >
              > >"Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote in message
              > >news:[email protected]...
              > >> Thanks, but I'm not doing any copying.
              > >>
              > >> The admin/managed-server communication copies things to the managed
              > >server,
              > >> which then always recompiles the pages when hit.
              > >>
              > >> -Greg
              > >>
              > >> -----------------------------------------------------------
              > >> Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              > >> www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              > >>
              > >> "Robert Coonrad" <[email protected]> wrote in message
              > >> news:[email protected]...
              > >> >
              > >> > check out post 8366...i found that i was not preserving
              > >> > the lastmodified date on my jsps and this was causing
              > >> > unnecessary re-compilation.
              > >> >
              > >> > hope it helps...
              > >> > bobc
              > >> >
              > >> > "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
              > >> > >I believe I have exhausted all permutations of EARing/notEARing,
              > >> > >WARing/notWARing, placing precompiled jsp class files in
              > >WEB-INF/classes,
              > >> > >placing them in a static location and setting workingDir to that
              > >> location,
              > >> > >combinations of the above.
              > >> > >
              > >> > >No matter what, the managed server re-compiles pages the first time
              > >they
              > >> > >are
              > >> > >hit. Non admin/managed-server I have no problems.
              > >> > >
              > >> > >Can anyone from BEA comment on this problem? Or give me a workaround
              > >> > >for
              > >> > >getting a cluster working with precompiled jsps?
              > >> > >
              > >> > >-Greg
              > >> > >
              > >> > >"Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote in message
              > >> > >news:[email protected]...
              > >> > >> Grrr... The JSP engine is extremely frustrating! I've spent many
              > >hours
              > >> > >> fighting the "staleness" checker in WL. I've been through all
              > >of the
              > >> > >> newsgroup messages pertaining to pre-compiling, etc., and I've
              > >gotten
              > >> > >> pre-compilation working on single-server deployments, but
              > >admin/managed
              > >> > >> server deployments have me beat.
              > >> > >>
              > >> > >> WL6.1, SP1, Solaris
              > >> > >>
              > >> > >> I've done the pageCheckSeconds=-1 and the workingDir is set to
              > >a
              > >fixed
              > >> > >> place. The fixed place contains pre-compiled versions of all
              > >jsps
              > >> > >made on
              > >> > >> that machine using jspc not 20 minutes earlier using the JSP files
              > >> > >in the
              > >> > >> exploded EAR file used by the admin server as the model for managed
              > >> > >> servers.. The managed servers are on the same machine.
              > >> > >>
              > >> > >> When the admin server gives an application to a managed server,
              > >the
              > >> > >managed
              > >> > >> server creates a temporary directory containing all of the webapp
              > >> > >> components, etc. The file timestamps on these files is the set
              > >by
              > >> > >the
              > >> > >> copying process to the time of the managed server boot
              > >(why?!?!????!?),
              > >> > >so
              > >> > >> the staleness check always thinks they are new and could care
              > >less
              > >> > >what
              > >> > >> precompiled jsps I have in my workingDir, the WEB-INF/classes
              > >> directory,
              > >> > >or
              > >> > >> anywhere else. The pageCheckSeconds=-1 seems to be completely
              > >ignored
              > >> > >in
              > >> > >> this scenario.
              > >> > >>
              > >> > >> If I tell the managed server to precompile everything on boot
              > >(about
              > >> > >45
              > >> > >> minutes for this app) it will create versions of the classes that
              > >match
              > >> > >th
              > >> > >e
              > >> > >> new JSP file timestamps, but this does not even survive a reboot
              > >of
              > >> > >the
              > >> > >> managed server because it AGAIN creates a new temp version of
              > >> everything
              > >> > >on
              > >> > >> the next reboot with new timestamps.
              > >> > >>
              > >> > >> If I wait for the managed server to boot and find the directory
              > >like
              > >> > >> .../applications/.wlnotdelete_man1/wlap7336/webapp/... and physically
              > >> > >copy
              > >> > >> (via cp -pr to retain timestamps) all of the original webapp
              > >components
              > >> > >on
              > >> > >> top of the temp versions, the staleness checker is happy and the
              > >> > >> pre-compiled versions work fine.
              > >> > >>
              > >> > >> There HAS to be a way to package pre-compiled versions of the
              > >JSPs
              > >> > >in the
              > >> > >> "model" application in the admin server and keep from having to
              > >> precompile
              > >> > >> the JSPs on every managed server every time managed server is
              > >booted..
              > >> > >>
              > >> > >> It would help if we had a way to bypass the staleness checking
              > >> > >completely..
              > >> > >> Or you guys should make the timestamps on the files copied by
              > >the
              > >> > >> admin/managed deployment process match properly so the staleness
              > >> checker
              > >> > >> doesn't think the JSP is different.
              > >> > >>
              > >> > >> It would also help if the engineer who wrote this could explain
              > >the
              > >> > >rules
              > >> > >> being implemented by the staleness checker. So far all the messages
              > >> > >in
              > >> > >the
              > >> > >> newsgroup have amounted to point solutions for problems without
              > >a
              > >good
              > >> > >> understanding of what the engine is checking for and/or doing
              > >under
              > >> > >the
              > >> > >> covers. Looking at the generated .java files for the JSP pages
              > >helps,
              > >> > >but
              > >> > >> it is not good enough...
              > >> > >>
              > >> > >> Anyone out there have a working admin/managed server JSP application?
              > >> > >> -Greg
              > >> > >>
              > >> > >> -----------------------------------------------------------
              > >> > >> Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              > >> > >> www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              > >> > >>
              > >> > >>
              > >> > >>
              > >> > >
              > >> > >
              > >> >
              > >>
              > >>
              > >
              > >
              >
              [att1.html]
              

  • Precompiling JSP with admin/managed servers

    Grrr... The JSP engine is extremely frustrating! I've spent many hours
              fighting the "staleness" checker in WL. I've been through all of the
              newsgroup messages pertaining to pre-compiling, etc., and I've gotten
              pre-compilation working on single-server deployments, but admin/managed
              server deployments have me beat.
              WL6.1, SP1, Solaris
              I've done the pageCheckSeconds=-1 and the workingDir is set to a fixed
              place. The fixed place contains pre-compiled versions of all jsps made on
              that machine using jspc not 20 minutes earlier using the JSP files in the
              exploded EAR file used by the admin server as the model for managed
              servers.. The managed servers are on the same machine.
              When the admin server gives an application to a managed server, the managed
              server creates a temporary directory containing all of the webapp
              components, etc. The file timestamps on these files is the set by the
              copying process to the time of the managed server boot (why?!?!????!?), so
              the staleness check always thinks they are new and could care less what
              precompiled jsps I have in my workingDir, the WEB-INF/classes directory, or
              anywhere else. The pageCheckSeconds=-1 seems to be completely ignored in
              this scenario.
              If I tell the managed server to precompile everything on boot (about 45
              minutes for this app) it will create versions of the classes that match the
              new JSP file timestamps, but this does not even survive a reboot of the
              managed server because it AGAIN creates a new temp version of everything on
              the next reboot with new timestamps.
              If I wait for the managed server to boot and find the directory like
              .../applications/.wlnotdelete_man1/wlap7336/webapp/... and physically copy
              (via cp -pr to retain timestamps) all of the original webapp components on
              top of the temp versions, the staleness checker is happy and the
              pre-compiled versions work fine.
              There HAS to be a way to package pre-compiled versions of the JSPs in the
              "model" application in the admin server and keep from having to precompile
              the JSPs on every managed server every time managed server is booted..
              It would help if we had a way to bypass the staleness checking completely..
              Or you guys should make the timestamps on the files copied by the
              admin/managed deployment process match properly so the staleness checker
              doesn't think the JSP is different.
              It would also help if the engineer who wrote this could explain the rules
              being implemented by the staleness checker. So far all the messages in the
              newsgroup have amounted to point solutions for problems without a good
              understanding of what the engine is checking for and/or doing under the
              covers. Looking at the generated .java files for the JSP pages helps, but
              it is not good enough...
              Anyone out there have a working admin/managed server JSP application?
              -Greg
              Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              

              check out post 8366...i found that i was not preserving
              the lastmodified date on my jsps and this was causing
              unnecessary re-compilation.
              hope it helps...
              bobc
              "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
              >I believe I have exhausted all permutations of EARing/notEARing,
              >WARing/notWARing, placing precompiled jsp class files in WEB-INF/classes,
              >placing them in a static location and setting workingDir to that location,
              >combinations of the above.
              >
              >No matter what, the managed server re-compiles pages the first time they
              >are
              >hit. Non admin/managed-server I have no problems.
              >
              >Can anyone from BEA comment on this problem? Or give me a workaround
              >for
              >getting a cluster working with precompiled jsps?
              >
              >-Greg
              >
              >"Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote in message
              >news:[email protected]...
              >> Grrr... The JSP engine is extremely frustrating! I've spent many hours
              >> fighting the "staleness" checker in WL. I've been through all of the
              >> newsgroup messages pertaining to pre-compiling, etc., and I've gotten
              >> pre-compilation working on single-server deployments, but admin/managed
              >> server deployments have me beat.
              >>
              >> WL6.1, SP1, Solaris
              >>
              >> I've done the pageCheckSeconds=-1 and the workingDir is set to a fixed
              >> place. The fixed place contains pre-compiled versions of all jsps
              >made on
              >> that machine using jspc not 20 minutes earlier using the JSP files
              >in the
              >> exploded EAR file used by the admin server as the model for managed
              >> servers.. The managed servers are on the same machine.
              >>
              >> When the admin server gives an application to a managed server, the
              >managed
              >> server creates a temporary directory containing all of the webapp
              >> components, etc. The file timestamps on these files is the set by
              >the
              >> copying process to the time of the managed server boot (why?!?!????!?),
              >so
              >> the staleness check always thinks they are new and could care less
              >what
              >> precompiled jsps I have in my workingDir, the WEB-INF/classes directory,
              >or
              >> anywhere else. The pageCheckSeconds=-1 seems to be completely ignored
              >in
              >> this scenario.
              >>
              >> If I tell the managed server to precompile everything on boot (about
              >45
              >> minutes for this app) it will create versions of the classes that match
              >th
              >e
              >> new JSP file timestamps, but this does not even survive a reboot of
              >the
              >> managed server because it AGAIN creates a new temp version of everything
              >on
              >> the next reboot with new timestamps.
              >>
              >> If I wait for the managed server to boot and find the directory like
              >> .../applications/.wlnotdelete_man1/wlap7336/webapp/... and physically
              >copy
              >> (via cp -pr to retain timestamps) all of the original webapp components
              >on
              >> top of the temp versions, the staleness checker is happy and the
              >> pre-compiled versions work fine.
              >>
              >> There HAS to be a way to package pre-compiled versions of the JSPs
              >in the
              >> "model" application in the admin server and keep from having to precompile
              >> the JSPs on every managed server every time managed server is booted..
              >>
              >> It would help if we had a way to bypass the staleness checking
              >completely..
              >> Or you guys should make the timestamps on the files copied by the
              >> admin/managed deployment process match properly so the staleness checker
              >> doesn't think the JSP is different.
              >>
              >> It would also help if the engineer who wrote this could explain the
              >rules
              >> being implemented by the staleness checker. So far all the messages
              >in
              >the
              >> newsgroup have amounted to point solutions for problems without a good
              >> understanding of what the engine is checking for and/or doing under
              >the
              >> covers. Looking at the generated .java files for the JSP pages helps,
              >but
              >> it is not good enough...
              >>
              >> Anyone out there have a working admin/managed server JSP application?
              >> -Greg
              >>
              >> -----------------------------------------------------------
              >> Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              >> www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              >>
              >>
              >>
              >
              >
              

  • Pl/sql with object and Precompiler C with ott8

    Hallo Oracleuser,
    I have problems by transfering object data or object of table data from/to a stored procedure to/from Pro c.
    I've tested an oracle-demo-program. The precompiler stopps with an error PCC-S-02408 when checking the includefile generated by ott8.
    The error
    Is there someone, who has a runable example.
    Lorenz Wenck

    You can use the mod_plsql to have the PL/SQL front the html directly (which makes passing paramters a snap). Even if you use some other technology to fron the user code the mod_plsql can accept parameters from a POST/GET.

  • Precompile JSP with useBean

    "I am trying to precompile some of my jsps. When I try to precompile the JSP that uses useBean. I got the following error: Exception in thread "main" java.lang.ExceptionInInitializerError:
              

              Shanna Chan <[email protected]> wrote:
              >"I am trying to precompile some of my jsps. When I try to precompile the
              >JSP that uses useBean. I got the following error: Exception in thread "main"
              >java.lang.ExceptionInInitializerError:
              I hit this problem a lot too. On investigation, it's always because I forget that
              with jspc, there are
              *two* classpaths: the one you call weblogic.jspc with, and the one you pass to javac
              with the -classpath option.
              You need your bean classes in both, as the jsp-java parser instantiates beans before
              generating (I guess
              as a validity check).
              

  • Problem in Creating .wsdl file and mapping.xml with ant

    hi
    i am created my .wsdl file and mapping.xml file with wscompile tool but when i run this by ant tool it show a problem.
    the command runs on command prompt but when run throught ant file it shows a following error :-
    Execute failed: java.io.IOException: CreateProces: wscompile -define -mapping build\classes\META-INF\mapping.xml -d . -nd build\.................and so on
    so if anybody have any idea then plz help me asap
    thanx

    The following Ant snippet is the way I've defined my wscompile task. I'm creating a web application and it looks like yours might be an EJB endpoint, but you can adjust where necessary:
    <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
         <classpath refid="compile.classpath" />
    </taskdef>
    <target name="init">
         <echo message="-------- ${appname} --------" />
    </target>
    <!-- This target compiles the server components using an existing WSDL as the driving document.
           The configuration file must use the <wsdl> element giving the location (local file system
           or URL) of the WSDL document.
           Note: the fork argument is needed to over come a bug when using the mapping argument. See
           http://forum.java.sun.com/thread.jspa?threadID=592994&tstart=0
      -->
         <target name="generate-server-from-WSDL" depends="init">
              <wscompile fork="yes"
                           keep="true"
                           base="${basedir}/WebContent/WEB-INF/classes"
                           import="true"
                           features="wsi"
                           xPrintStackTrace="true"
                           verbose="true"
                           mapping="${basedir}/WebContent/WEB-INF/jaxrpc-mapping.xml"
                           sourcebase="${basedir}/src"
                           config="${config.server.doclit.file}">
                   <classpath>
                        <path refid="compile.classpath" />
                   </classpath>
              </wscompile>
         </target>
         <target name="compile-server-from-WSDL" depends="generate-server-from-WSDL">
              <javac srcdir="${basedir}/src" destdir="${basedir}/WebContent/WEB-INF/classes" debug="${compile.debug}">
                   <classpath refid="compile.classpath" />
              </javac>
         </target>Just make sure that the named destination directories exist before you run the script.
    If you'd like more details on the wscompile Ant task, I found the following pages invaluable:
    https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html

  • Precompiling JSPs using ant

    Hi
    Does anyone know a documented way to precompile a JSP using an ant script. I've tried a lot, but didn't find a satisfying solution. The best solution I've found was calling OJSPC from commandline via ants "java" task, but even this solution does not work in JDeveloper 9.0.4 anymore.
    If anyone can give me a hint, I'd be really happy.
    Thanks

    Anybody ?

  • Precompiling JSPs with taglib dependency

    Hi, all.
              Could someone tell me how to specify taglib for jspc ?
              Whenever I try to precompile my JSPs, the ones that have dependency upon
              taglib always fail with the following message:
              java.lang.NullPointerException at
              weblogic.servlet.jsp.JspLexer.getHomeRelativeFile(JspLexer.java:59) at
              weblogic.servlet.jsp.JspLexer.isWebLogicTagLib(JspLexer.java, Compiled
              Code) at
              weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:69) at
              weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java,
              Compiled Code)
              at
              weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java, Compiled
              Code) at
              weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled Code)
              at
              weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1677) at
              weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1518) at
              weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled Code) at
              weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code) at
              weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code) at
              weblogic.servlet.jsp.JspParser.parse(JspParser.java:116) at
              weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97) at
              weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
              Compiled Code) at
              weblogic.jspc.runBody(jspc.java,
              Compiled Code) at
              weblogic.utils.compiler.Tool.run(Tool.java:80) at
              weblogic.jspc.main(jspc.java:111)
              I'm using WL5.1 with SP5.
              TIA,
              Kim.
              

    Yep, this is a known issue.
              Work is in progress.
              Kumar
              Kim Kofman wrote:
              >
              > Hi, all.
              > Could someone tell me how to specify taglib for jspc ?
              > Whenever I try to precompile my JSPs, the ones that have dependency upon
              > taglib always fail with the following message:
              > java.lang.NullPointerException at
              >
              > weblogic.servlet.jsp.JspLexer.getHomeRelativeFile(JspLexer.java:59) at
              >
              > weblogic.servlet.jsp.JspLexer.isWebLogicTagLib(JspLexer.java, Compiled
              > Code) at
              >
              > weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:69) at
              >
              > weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java,
              > Compiled Code)
              > at
              > weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java, Compiled
              > Code) at
              >
              > weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java, Compiled Code)
              > at
              >
              > weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1677) at
              >
              > weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1518) at
              >
              > weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled Code) at
              >
              > weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code) at
              >
              > weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code) at
              >
              > weblogic.servlet.jsp.JspParser.parse(JspParser.java:116) at
              >
              > weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97) at
              >
              > weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
              > Compiled Code) at
              > weblogic.jspc.runBody(jspc.java,
              > Compiled Code) at
              >
              > weblogic.utils.compiler.Tool.run(Tool.java:80) at
              > weblogic.jspc.main(jspc.java:111)
              >
              > I'm using WL5.1 with SP5.
              >
              > TIA,
              > Kim.
              

  • Starting and stopping composites with ant

    Hi All,
    I am receiving the below error when I try to stop/start a composite using ant script.
    export ORACLE_HOME=/apps/oracle/product/fmw/soa
    export ANT_HOME=$ORACLE_HOME/../modules/org.apache.ant_1.7.1/
    export ANT_BIN=$ORACLE_HOME/bin
    PATH=$ORACLE_HOME:$ANT_HOME:$ANT_BIN:$PATH
    +$ ant -f $ANT_BIN/ant-sca-mgmt.xml stopComposite -Duser=qetst1user -Dpassword=welcome1 -Dhost=qetst1.corp.netapp.com -Dport=9200 -DcompositeName=ProcessSalesOrderEbizFfmtEventConsumer -Dpartition=Q2I -Drevision=1.0.0+
    Buildfile: /apps/oracle/product/fmw/soa/bin/ant-sca-mgmt.xml
    [echo] oracle.home = /apps/oracle/product/fmw/soa/bin/..
    stopComposite:
    [input] skipping input as property host has already been set.
    [input] skipping input as property port has already been set.
    [input] skipping input as property user has already been set.
    [secure-input] skipping secure-input as property password has already been set.
    [input] skipping input as property compositeName has already been set.
    [input] skipping input as property revision has already been set.
    [echo] oracle.home = /apps/oracle/product/fmw/soa/bin/..
    compositeMgrTask:
    [java] Connecting to: service:jmx:t3://qetst1.corp.netapp.com:9200/jndi/weblogic.management.mbeanservers.runtime
    [java] connection initiated
    _*[java] Cannot find composite lifecycle mbean.*_
    BUILD SUCCESSFUL
    Total time: 12 seconds
    Thanks,
    Harsh Bansal

    Hi user11274260,
    Thanks for the reply. Can you direct me a way on how to achieve that using wlst as well. Any snippet of code or some other info would be very useful.
    Thanks.

  • Cannot access precompiled JSP

    My application contains several JSP working correctly, but after I choose to precompile my JSP files (putting the compiled classes in classpath). The server return a 404 indicating cannot find the JSP pages.
    It seems like the
    RequestDispatcher dispatcher=request.getRequestDispatcher("xxx.jsp");
    can no longer find the JSP page anymore. What should I put there instead? Moreover, I will still use JSP for faster development and debugging purposes, can I write it so that the same code runs for both raw JSP pages and precompiled JSP?
    Any suggestion will be appreciated!

    Thanks for your info on the creation of web.xml fragment, it really helps. I am using Ant to precompile the JSP to deploy on Jetty.
    But, the webxml and webinc attribute just does not output any file as specified. However, when I tried it with the task like this:
    <java classname="org.apache.jasper.JspC" fork="true" failonerror="true">
    <arg line="-l -d ${web}/WEB-INF/work -webinc ${web}/jspc.xml -webapp ${web}"/>
    it seems to create the webinc, however, the JSPC just doesn't work as it says
    org.xml.sax.SAXException: Internal Error: File /javax/servlet/resources/web-app_2_3.dtd not found
    Now both ways seems unworkable, do you or anyone have any idea?

  • JSP problem with ANT

    Hello!
    I built up a web site and I want to test them using ANT. It works fine with other web page, however it doesn't work with web pages with "session" statement. For example in login.jsp I have the following statement
    session.setAttribute("user", request.getParameter("userName"));
    And if the user's name and password are correct, the user is directed to home.jsp, where i have the following statement to retrieve the user's name:
    String id=session.getAttribute("user").toString();
    In order to test the above 2 pages with ANT, I have the following code in builder.xml:
    <?xml version='1.0'?>
    <project name="proj" default="test" basedir=".">
    <target name="test">
    <get src="http://path/login.jsp?userName=id&passWord=1111" dest="1.html" />
    </target>
    </project>
    When I run the script, I get the error that the home.jsp cannot be opened (see below)
    [get] Error opening connection java.io.IOException: Server returned HTTP response code: 500 for URL: http://path/home.jsp
    I am pretty sure the above error is caused by the "session" statement, because if I remove the statement in home.jsp, the page can be correctly opened. But I really need the "session" statement, Can someone tell me how to deal with it?
    thanks a million.

    Usually with a 500 error there's more detail in a server log somewhere. Can you find anything in stderr.log or some such?

  • Test jsp pages with ant

    Hello!
    I built up a web site and I want to test them using ANT. It works fine with other web page, however it doesn't work with web pages with "session" statement. For example in login.jsp I have the following statement
    session.setAttribute("user", request.getParameter("userName"));
    And if the user's name and password are correct, the user is directed to home.jsp, where i have the following statement to retrieve the user's name:
    String id=session.getAttribute("user").toString();
    In order to test the above 2 pages with ANT, I have the following code in builder.xml:
    <?xml version='1.0'?>
    <project name="proj" default="test" basedir=".">
    <target name="test">
    <get src="http://path/login.jsp?userName=id&passWord=1111" dest="1.html" />
    </target>
    </project>
    When I run the script, I get the error that the home.jsp cannot be opened (see below)
    [get] Error opening connection java.io.IOException: Server returned HTTP response code: 500 for URL: http://path/home.jsp
    I am pretty sure the above error is caused by the "session" statement, because if I remove the statement in home.jsp, the page can be correctly opened. But I really need the "session" statement, Can someone tell me how to deal with it?
    thanks a million.

    One mistake i find in your code is while retreiving the session value its session.getAttribute("userName"), as you stored the value using the parameter 'userName'. Is it not causing problem. Please check...

  • HT4623 I have an IPhone4 and is updated with version 6.1.3 and I am not able to connect with face time calls. I have checked the date ant time. I used to be able to use face time with no problem. since the late os upgrace I have not been able to connect w

    I have an IPhone4 and is updated with version 6.1.3 and I am not able to connect with face time calls. I have checked the date ant time. I used to be able to use face time with no problem. Since the late os upgrace I have not been able to connect with face time.

    Read http://support.apple.com/kb/ts3367

  • Call JSP with applet and wait till it is loaded

    Hi,
    I am calling a JSP with a java-script. The targetpage needs some time, until the applet is loaded. I would like to call a function in the applet.
    My problem is, that I cannot set 'location.href' and straight after that call the applet, because it will not be there. How can I delay the applet-call, until it is really there?
    function loadOrder(){
    top.mainFrame.location.href = 'auftragseditor.jsp';
    top.mainFrame.OrderApplet.setOrder( orderno )
    I also fitted a while(...) loop between the two statements, but obviously the page is not build up in another thread. The loading will wait.
    Thanks for your help
    Klaus

    Assuming that top.mainFrame.OrderApplet.setOrder( orderno ) causes an exception because
    the applet is not loaded yet you should put it in a try and catch.
    One other problem is that orderno is not defigned anywhere in your method.
    function loadOrder(){
      top.mainFrame.location.href = 'auftragseditor.jsp';
      callApplet( orderno );
    function callApplet(strPassToApplet){
      try{
         top.mainFrame.OrderApplet.setOrder( orderno )
      }catch(e){
        // try again in .1 seconds
        setTimeout("callApplet(\"" + strPassToApplet + \");",100);
    }

Maybe you are looking for

  • ORA-00164 but I cant find an autonomous transaktion

    Hello, I have the following statement SQL> create table tab2 as 2 select * from tab1@dblink; and get the error select * from tab1@dblink ERROR at line 2: ORA-00604: error occurred at recursive SQL level 1 ORA-00164: autonomous transaction disallowed

  • View Vacation/Sick Balances on Time Entry Page

    Hi All , I am trying to explore the possibility to view Vacation / Sick Balances on the Time Entry Page in OTL . Whenever an employee enters OTL to enter time through "Self Service Time" responsibility , emp. should be able to view the available vaca

  • Mass 'cancellation' of Stock items

    Hi Experts, Within the Item Master Data screen, my customer right clicks and chooses Cancel to remove an item. He has thousands of items which he no longer sells which need to be cancelled in this way.  Is there a way to do this via DTW? Thanks Greig

  • How do I save an image as viewed in the protanopic/deuteranopic proof view?

    I'd like to create a series of textures that are essentially deuteranopic versions of other files I have. Although I can view the files as they would be seen by a deuteranopic using a proof view, I cannot find a way to save the file as it appears in

  • Can I use a mountain lion time machine back up on new mavericks macs?

    My macbook retina was stolen at my school. I was wondering because I used time machine having mountain lion, does it affect anything when if i purchase a mavericks macbook pro? the just announced one. I have all my pictures (iphoto) in that last back