Precompiling JSPs using weblogic.jspc

Hello,
My question has more to do with getting the Weblogic precompiler to understand <%@ include file="myFilejsp" %> directives.
Test scenario:
In our application, we have used a common JSP page say 'commonJSP' as a header and have included 'commonJSP' in all our other JSP pages.
Suppose my commonJSP is like this:
<%
String hello= "Hello";
%>
and suppose my index.jsp is like this
<%@ include file="commonJSP" %>
<%
System.out.println(hello);
%>
Now when I serve index.jsp to clients it compiles correctly because the commonJSP is included in the source before compiling.
HOWEVER, when precompiling the JSPs in my web application using the <java weblogic.jspc ..> tag in my ant build file, I am getting errors on compiling index.jsp that 'hello' cannot be resolved.
When using the WebLogic JSP compiler, is there any way to tell the compiler to not treat JSP pages as individual 'servlet' classes but look at the 'big picture'?

Anybody ?

Similar Messages

  • Appending a _ in front of the jsp class name when using weblogic.jspc

     

    http://e-docs.bea.com/wls/docs60/jsp/reference.html
              java weblogic.jspc -d /weblogic/classes -keepgenerated primero.jsp
              "rb" <[email protected]> wrote in message
              news:[email protected]...
              >
              > hi,
              >
              > i do
              >
              > java weblogic.jspc -d /weblogic/classes primero.jsp
              >
              > and it only is generated a _primero.class and do not appear
              > the .java ?
              >
              > what i do bad ?
              >
              > thanks for advance
              >
              >
              > Rodrigo Fonseca da Fonseca <[email protected]> wrote:
              > >Hi,
              > >
              > >I'm using weblogic.jspc to compile some jsp fiels. The compilation is
              > >complete and successfully, but the names of generated files .java and
              > >..class are strange.
              >
              >
              >
              > >
              > >For example, compiling a file named change_login_data.jsp, the resulting
              > >files are change95_login_95_data.java and
              > >change95_login_95_data.class. Compiling a file named buy.jsp, the
              > >resulting files are buy.java and buy.class (fine situation). Why???
              > >
              > >I'm using:
              > >
              > >java weblogic.jspc -d c:\jsp_result -classpath
              > >
              >
              >c:\weblogic\myserver\serverclasses;c:\weblogic\lib\weblogicaux.jar;c:\weblo
              gic\classes
              > >-compiler jikes.exe -J-verbose -keepgenerated -verbose
              > >change_login_data.jsp
              > >
              > >
              > >thanks
              > >Rodrigo
              > >
              > >
              > >
              > >Mark Spotswood wrote:
              > >>
              > >> The namespace for java class files is more restrictive
              > >> than for JSP files. We prepend these underscores so
              > >> that if, for example, someone names their JSP "1.jsp",
              > >> we get a class file with a legal name. We did consider
              > >> not doing this for files which started with characters
              > >> we kenw to be valid (in fact we may have put it in a
              > >> service pack), but later found that this was not sufficient
              > >> because its possible to name a jsp file something that
              > >> clashes with java keywords ("class.jsp" for example).
              > >> Rather than making the scheme even more complex,
              > >> we decided to go back to the original sheme of always
              > >> prepending the underscore.
              > >> --
              > >> mark
              > >>
              > >> Mika Moilanen wrote:
              > >>
              > >> > >>>>> "Shankar" == Shankar Roy <[email protected]> writes:
              > >> >
              > >> > Shankar> Problem seems to go away with weblogic510sp4.jar in
              compilation
              > >classpath.
              > >> > Shankar> Shankar.
              > >> >
              > >> > Shankar> Shankar Roy wrote:
              > >> >
              > >> > >> Hi,
              > >> > >> Can anyone tell why when I invoke weblogic.jspc the class file
              that
              > >is
              > >> > >> generated has a _ in front of the class name
              > >> > >>
              > >> > >> java -classpath
              > >> > >>
              >
              >/space/shankar/weblogic/lib/weblogicaux.jar:/space/shankar/weblogic/classes
              /boot:/space/shankar/weblogic/classes:/space/shankar/dev/dev/lib/activation.
              jar:/space/shankar/dev/dev/lib/classes12.zip:/space/shankar/dev/dev/lib/mail
              .jar:/space/shankar/dev/dev/lib/oroinc.jar:/usr/java/lib/classes.zip
              > >> > >> weblogic.jspc -package com.careassured.jsp -commentary login.jsp
              > >> > >>
              > >> > >> produces a class file by the name _login.class
              > >> > >>
              > >> > >> Thanks for any help pointers.
              > >> > >> Shankar.
              > >> >
              > >> > Not with WLS5.1 and weblogic510sp6.jar, we still get '_' prefixed
              > >> > classes...
              > >> >
              > >> > Actually we're suffering quite a lot because of this bug in
              > >> > weblogic.jspc. Are there any plans for fix?
              > >> >
              > >> > --
              > >> > Best Regards,
              > >> > Mika
              > >> > ----------------------------------------------------------
              > >> > [email protected] phone: +358-0-511-23587
              > >> > Nokia Networks, PO box 320, FIN-00045 NOKIA GROUP, Finland
              > >> > ----------------------------------------------------------
              >
              

  • Using weblogic.jspc

    We are trying to use weblogic.jspc for precompiling the jsps in our application. Following the ANT task for doing the same.
              <target name="runJspc" depends="runAssembler">
                   <path id="jspc.path.id">
                        <path refid="class.path"/>
                        <fileset dir="${weblogic.gws.app}/APP-INF">
                             <include name="**/*.jar"/>
                        </fileset>
                   </path>     
              <java classname="weblogic.jspc" fork="yes" failonerror="yes">
                        <classpath refid="jspc.path.id"/>
                        <arg line="-webapp ${weblogic.gws.app}/web -compiler ${javac.exec} -classpath ${gws.cl} -compileAll -d ${weblogic.gws.app}/web/WEB-INF/classes -depend -k -keepgenerated -verbose -verboseJavac"/>
                   </java>
              </target>
              For some reason, this target runs forever, without printing any logs or anthing. It simply hangs at "runJspc :".
              To dig into details, I modified the target as follows :
              <target name="runJspc" depends="prepare">
              <path id="jspc.path.id">
              <path refid="class.path"/>
              <fileset dir="${weblogic.gws.app}/APP-INF">
              <include name="**/*.jar"/>
              </fileset>
              <pathelement path="${weblogic.gws.app}/web/WEB-INF"/>
              </path>
              <java classname="weblogic.jspc" fork="yes" failonerror="yes">
              <classpath refid="jspc.path.id"/>
              <arg line="-d ${weblogic.gws.app}/web/WEB-INF/classes -classpath ${gws.cl} -compiler ${javac.exec}" />
              <arg value="-k" />
              <arg value="-compileAll" />
              <arg value="-depend" />
              <arg value="-verboseJavac" />
              <arg value="${weblogic.gws.app}/web/retail/jsp_app/home/ft_home.jsp"/>
              <jvmarg line="-Xms512m"/>
              <jvmarg line="-Xmx512m"/>
              </java>
              </target>
              Now it throws below error & stops.
              runJspc:
              [java] [jspc] warning: expected file /WEB-INF/web.xml not found, tag libraries cannot be resolved.
              [java] <Apr 14, 2005 11:49:19 AM PDT> <Warning> <HTTP> <BEA-101181> <Could not find web.xml under WEB-INF in the doc root: ..>
              Is there any way to resolve one of the above two problems ?

    Hi Arun,
              It seems that in the second ant target, you decide to compile just a single jsp, while in the first you were trying to compile the complete jsps in a application.
              But in the second target, you forgot to mention -docroot / -webapp target. As a result, the specific error!!.
              To actually debug the first target, try running the program first on commandline , using weblogic.jspc directly passing the arguments.
              This way , you would have a better control over the target, and may be able to isolate the issue easily.

  • Problem using weblogic.jspc with wls6.1

              I've got this error using weblogic.jspc on jsp that works fine with the compiler
              of 5.1, is this a bug?
              java.lang.NullPointerException
              at weblogic.management.Admin.getServer(Admin.java:1252)
              at weblogic.servlet.internal.dd.ServletEntityResolver.initServerMBean(ServletEntityResolver.java:69)
              at weblogic.servlet.internal.dd.ServletEntityResolver.resolveEntity(ServletEntityResolver.java:94)
              at weblogic.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntity(DefaultEntityHandler.java:749)
              at weblogic.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubset(DefaultEntityHandler.java:566)
              at weblogic.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java:1139)
              at weblogic.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentScanner.java:2215)
              at weblogic.apache.xerces.framework.XMLDocumentScanner.access$0(Compiled
              Code)
              at weblogic.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(Compiled
              Code)
              at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
              Code)
              at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:967)
              at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:175)
              at weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:311)
              at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoader.java:327)
              at weblogic.servlet.internal.dd.DescriptorLoader.initialize(DescriptorLoader.java:242)
              at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:176)
              at weblogic.servlet.internal.dd.DescriptorLoader.loadDescriptor(DescriptorLoader.java:396)
              at weblogic.jspc.runBodyInternal(Compiled Code)
              at weblogic.jspc.runBody(jspc.java:169)
              at weblogic.utils.compiler.Tool.run(Tool.java:79)
              at weblogic.jspc.main(Compiled Code)
              --------------- nested within: ------------------
              weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested exception:
              [java.lang.NullPointerException]
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Error.<init>(Error.java:50)
              at weblogic.utils.NestedError.<init>(NestedError.java:24)
              

    Please post your full description. I can't see what you're replying to (must
              be too old).
              Alex
              "Gregory Chazalon" <[email protected]> wrote in message
              news:3c7383a8$[email protected]..
              > I've got te same problem (NullPointerException at the same line code in
              the same class). The most disturbing is that the weblogic.jspc works fine
              with wl6.1 SP2 but fails with wl6.1 SP1.
              >
              > Do you have a solution ? Can I download a CRXXXX.jar that fixes it ?
              >
              > I will appreciate any help.
              >
              

  • Error while precompiling the JSP using weblogic 7.0

    Hi
    I am trying to precompile jsp file which is there in a war.Main jsp file code includes one more jsp which is there in other folder under defaultweb directory.
    While deploying the war i am getting the following error.Can any bosy help me in this regard
    <Nov 23, 2002 5:01:28 PM IST> <Error> <HTTP> <101045> <[ServletContext(id=464413
    3,name=ArkinTestWeb,context-path=/ArkinTestWeb-3)] translation of /Admin/account
    _access.jsp failed: weblogic.utils.ParsingException: nested TokenStreamException
    : antlr.TokenStreamException: Could not include ./../includes/sessionStatusPage.
    jsp>
    <Nov 23, 2002 5:01:28 PM IST> <Error> <Deployer> <149201> <The Slave Deployer fa
    iled to complete the deployment task with id 1 for the application ArkinTestWeb.
    weblogic.management.ApplicationException: Prepare failed. Task Id = 5
    Module Name: ArkinTestWeb, Error: Could not load ArkinTestWeb: weblogic.utils.Ne
    stedException: ArkinTestWeb:ArkinTestWeb Failure while Precompiling JSPs: weblog
    ic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamExcepti
    on: Could not include ./../includes/sessionStatusPage.jsp - with nested exceptio
    n:
    [weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStream
    Exception: Could not include ./../includes/sessionStatusPage.jsp]
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:657)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:548)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sla
    veDeployer.java:1026)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDep
    loyer.java:700)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHan
    dler.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    >
    Regards
    Anand Mohan

    Hi
    All jsp pages are under one web application only.Can you help more on this.
    Regards
    Anand

  • Problem when using weblogic.jspc from an IDE

    I am trying to call JSPC from an IDE (as part of an Eclipse Builder). To optimize performance I want to avoid to spwan a new process. So I am trying to call weblogic.jspc's main method directly from the IDE. Everything works fine for simple simple pages.
              But when the page refers to a tag library with a tag providing a TagExtraInfo class, weblogic.jspc complains about the class not extending the TagExtraInfo base class although it does:
              Errors encountered while compiling 'D:\vrp-localdeploy\applications\wot\WOT' :
              Translation of /rentalcar/tiles/i18n/CarCapacityView.jsp failed: (line 17): Error in using tag library uri='/tags/i18n' prefix='i18n': For tag 'bundle', extra info class 'org.apache.taglibs.i18n.BundleTEI' does not extend javax.servlet.jsp.tagext.TagExtraInfo
              I could not figure out what exactly causes the problem. Using exactly the same settings workes just fine.
              Any suggestions?

    The full stack trace reads as follows:
              <p>
              Errors encountered while compiling 'D:\vrp-localdeploy\applications\wot\WOT' :
              <p>
              Translation of /common/include/i18n/definitions.inc failed: (line 17): Error in using tag library uri='/tags/i18n' prefix='i18n': For tag 'bundle', extra info class 'org.apache.taglibs.i18n.BundleTEI' does not extend javax.servlet.jsp.tagext.TagExtraInfo
              <br>
                   at weblogic.jspc.runJspc(jspc.java:559)
                   at weblogic.jspc.runBodyInternal(jspc.java:410)
                   at weblogic.jspc.runBody(jspc.java:319)
                   at weblogic.utils.compiler.Tool.run(Tool.java:146)
                   at weblogic.utils.compiler.Tool.run(Tool.java:103)
                   at weblogic.jspc.main(jspc.java:708)
                   at tui.vrp.tools.presentation.builder.PresentationBuilder.compileJSP(PresentationBuilder.java:1173)
                   at tui.vrp.tools.presentation.builder.PresentationBuilder.checkResource(PresentationBuilder.java:718)
                   at tui.vrp.tools.presentation.builder.PresentationBuilder$PresentationDeltaVisitor.visit(PresentationBuilder.java:102)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
                   at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
                   at tui.vrp.tools.presentation.builder.PresentationBuilder.incrementalBuild(PresentationBuilder.java:1268)
                   at tui.vrp.tools.presentation.builder.PresentationBuilder.build(PresentationBuilder.java:677)
                   at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
                   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
                   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
                   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
                   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
                   at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
                   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
                   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
                   at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
                   at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
                   at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
                   at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
                   at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
                   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
              <p>
              Unfortunately it doesn't really give any real reason - it is a general piece of code in jspc to report problems.
              <p>
              But I dug a lot bit deeper into the code and realized that the original problem is a ClassCastException in line 1290 of class StandardTagLib, which reads as follows:
              <p>
                   tagextrainfo = (TagExtraInfo)Beans.instantiate(classloader, s3);
              <p>
              This looks quite obvious that the class named by s3 simply is no extension of TagExtraInfo, but unfortunately the only class with that name being referenced by the class path does extend this class. I wondered what the problem might be and came up with the following answer:
              <p>
              The class of the bean instantiated by Beans.instantiate extends a class with the name "javax.servlet.jsp.tagext.TagExtraInfo" which is cast to another class with exactly <b>the same name, but a different class loader</b>. Since neither of the class loaders is parent of the other one, both classes are not considered being the same class although they have the same name. Sounds weird, but exactly this is the problem!
              <p>
              Where does it come from and why it works fine when the tool is executed in a separate thread or on the console?
              <p>
              From my understanding the problem is caused in line 395 of the class weblogic.jspc:
              <p>
                   GenericClassLoader genericclassloader = new GenericClassLoader(classpathclassfinder);
              <p>
              This line of code creates a class loader not knowing a parent class loader by which the class weblogic.jspc was loaded. All classes weblogic.jspc is using or calling will be loader by either the same or a parent class loader - this is important to understand. Since TagExtraInfo is directly referenced by StandardTagLib one instance of the class object (the object of type class) will be generated and linked when the class StandardTagLib is instantiated for the first time by the class loader which loaded weblogic.jspc (or by its parent). This is consequence which can not be avoided.
              <p>
              But now look at line 1290 of class StandardTagLib: It explicitly requests the class to be loaded by the GenericClassLoader instantiated in line 395 of the class weblogic.jspc. This class loader, off course, is not aware of the same class just being loaded by another class loader since it has no knowledge of it. It simply creates a fresh copy of the class object, which only differs in the reference to the class loader which created this class object.
              <p>
              Actually, I figured that the following line of code replacing the upper one, would resolve the problem:
              <p>
              GenericClassLoader genericclassloader = new GenericClassLoader(classpathclassfinder, this.getClass().getClassLoader());
              <p>
              Doing this, the GenericClassLoader would know its logical parent by reference and would implicitly - thanks to the implementation of java.lang.ClassLoader - try to find the class using its parent first, would find a valid class, and hence use the same instance of the class object instantiated by the parent class loader. The problem would be solved.
              <p>
              It works fine in the console or under a running application server, because they will always have the weblogic jar in their system class path. ClassLoaders not having a parent are implied to have the system class loader as their parent - the piece of code does work in this case.
              <p>
              Under Eclipse this is no option, off course. We would restrain us to exactly this version of the APIs used by the weblogic version in the system class path.
              <p>
              I was trying to patch this myself by extending weblogic.jspc by my own class to pass on a proper class loader knowing its parent, and I was sort of successful: The problem disappeared. But I can't gain exactly what I am looking for, because the method runJspc with four parameters (around line 447) of weblogic.jspc is private to the class and its public brother always passes true to this method as the fourth parameter - causing jspc to recompile all JSPs instead of just the requested ones.
              <p>
              Everything refers to WL81SP3.
              <p>
              That's were I got stuck currently. I have read some postings about this problem in the internet - some dating far back into the history. So, I have the impression that there have been some folks around with the same problem. I think the patch I suggested does not any harm and I could simply use jspc in my builder without any problems.
              <p>
              Regards,
              <p>
              Elmar Schwarz

  • Precompiling JSPs Outside Weblogic Home Directory

    Using Weblogic Server 9.2. Was able to precompile JSPs in a war file with weblogic.appc at the command line with only the weblogic.jar inside the Weblogic installation directory in my classpath. I then translated this into an Ant task, and because the script may need to run on a box that does not have Weblogic installed, copied weblogic.jar to my build area and included that one in my classpath. It immediately began throwing NoClassDefFound exceptions. Discovered the "Class-Path" list of additional jars in the MANIFEST inside weblogic.jar, searched these jars and found all of the missing classes--except for the last one. The missing class is org/apache/bcelx/classfile/ClassParser, and the error I'm getting is "WARNING: unable to get an input stream for jar:file:D:\APPS\Java\jdk1.5.0_13\jre\lib\rt.jar!" followed by java.lang.NoClassDefFoundError. The error occurs in javelin.java.JavaClassFile.getParseTree() at line 178. There is a BCEL Apache project, but they have no mention of BCELX on their website. Anyone know where I can find this class, or source code for javelin.java.JavaClassFile?
    Edited by willhandley at 06/06/2008 10:25 AM

    I tried the wlappc target:
    <target name="_precompile-jsp">
         <taskdef name="wlappc" classname="weblogic.ant.taskdefs.j2ee.Appc" classpathref="class.path" />
         <echo message="Precompiling JSPs in ${appfile}"/>
              <wlappc source="${appfile}" debug="true" verbosejavac="true" verbose="true" runtimeflags="-J-ms1024m -J-mx2048m"/>
    </target>
    But I keep getting:
    [java] [wlappc] java.lang.OutOfMemoryError: Java heap space
    We've got quite a lot of jsps in our application. It seems the memory options are being ignored and it seems other people have experienced the same problem with the memory options being ignored when using wlappc and have switched to weblogic.appc.
    When I switch to weblogic.appc I don't get the out of memory issue, though of course I'm still getting the initial stack trace reported. Any other ideas?

  • Error Using weblogic.jspc --- java.lang.ExceptionInInitializerError

    Hi,
              I am trying to use the weblogic.jspc compiler to pre-compile my jsp
              files so that I can verify that they compile w/o having to visit the
              page. I am using Weblogic 4.5.1. I am encountering the following
              error:
              java.lang.ExceptionInInitializerError
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Error.<init>(Compiled Code)
              at java.lang.LinkageError.<init>(Compiled Code)
              at java.lang.ExceptionInInitializerError.<init>(Compiled Code)
              at java.beans.Beans.instantiate(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.processBeanTag(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mXML_THING(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mTOKEN(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.nextToken(Compiled Code)
              at weblogic.servlet.jsp.JspLexer.parse(Compiled Code)
              at weblogic.servlet.jsp.JspParser.doit(Compiled Code)
              at weblogic.servlet.jsp.JspParser.parse(Compiled Code)
              at weblogic.servlet.jhtmlc.Jhtml2Java$Output.setSourceFile(Compiled
              Code)
              at weblogic.servlet.jhtmlc.Jhtml2Java.outputs(Compiled Code)
              at weblogic.utils.compiler.CodeGenerator.generate(Compiled Code)
              at weblogic.jhtmlc.runBody(Compiled Code)
              at weblogic.jspc.runBody(Compiled Code)
              at weblogic.utils.compiler.Tool.run(Compiled Code)
              at weblogic.jspc.main(Compiled Code)
              Have any of you seen this? Can you tell me what I am doing wrong
              (Classpath, etc.)?
              Any and all help would be greatly appreciated.
              The command line I am using is:
              java -verbose -classpath
              $CLASSPATH:/apps/weblogic/license:/apps/weblogic/classes:/apps/weblogic/lib/weblogicaux.jar
              weblogic.jspc -d $HOME/weblogic/myserver/classfiles/examples
              100-Welcome.jsp
              Regards,
              Richard
              

    Fixed with a patch CR0737797 and CR062538 for the 6.1 sp3 source line
              Prasanna Yalam

  • Java.io.IOException using weblogic.jspc

    I've seen a number of similar questions on this but no answers. Can
              anyone provide some insight?
              I have a JSP containing a custom tag library that compiles and executes
              successfully when deployed as a war file under wls 5.1 sp8 but running
              the weblogic.jspc compiler from the command line produces a
              java.io.IOException: cannot resolve '/WEB-INF/tlds/struts-template.tld'
              into a valid tag library.
              The web.xml file includes:
              <taglib>
              <taglib-uri>/WEB-INF/tlds/struts-template.tld</taglib-uri>
              <taglib-location>/WEB-INF/tlds/struts-template.tld</taglib-location>
              </taglib>
              The command I'm using is:
              java -Dweblogic.home=/opt/weblogic
              weblogic.jspc
              -d /home/wmeier/java/StrutsTemplate/build/jsp
              -docroot /home/wmeier/java/StrutsTemplate/web
              -contextPath StrutsTemplate
              -encoding default
              -keepgenerated
              -g
              introduction.jsp
              I can get the jsp compiler to work when I change the taglib uri
              declaration from
              <%@ taglib uri='/WEB-INF/tlds/struts-template.tld'...
              to
              <%@ taglib uri='/tlds/struts-template.tld'
              This modified uri also works as a war file under WebLogic but fails
              under the Tomcat 3.2 reference implementation.
              Does anyone have any ideas how I can get the compiler to work without
              hacking the taglib uri?
              Thanks,
              Bill Meier
              

    CeciNEstPasUnProgrammeur wrote:
    Hm, well... the API docs say for non-existing files you get an IllegalArgumentException, and IOException is for "no application registered" or "application won't start"...
    Just a guess: is the firewall blocking the execution?I don't think it is a fire wall issue since everything runs on the same machine (the file is created and invoked on the same machine)
    Any other ideas?

  • Error in precompiling JSPs using OJSPC

    Hi,
    I am precompiling JSPs in war file using ojspc as specified below.
         ojspc -output myapp.war app.war
    However I am getting following error:
    Detected archive, now processing contents of app.war...
    Setting up temp area...
    Expanding archive in temp area...
    WARNING: IGNORED file: /WEB-INF/lib/jsf-impl.jar
    WARNING: IGNORED file: /WEB-INF/lib/jsf-ri.jar
    Parse error in AddNewAttachment.jsp:
    oracle.jsp.parse.JspParseException: /AddNewAttachment.jsp: Line # 48,
    actionListener="#{addAttachmentBackingBean.cancel}"/>
    Error: A String literal value, "#{addAttachmentBackingBean.cancel}", has been pr
    ovided for attribute actionListener which has an associated deferred method with
    void signature
    Removing temp area...
    Can anbody help me to solve this problem?
    Thanks.
    Regards,
    Umesh

    Hi,
    If I create a method via the binding editor in JDev it creates a managed bean method with a void return type as default.
    eg.
        public void cmdlink_actionListener(ActionEvent actionEvent) {
            // Add event code here...
        }could it have anything to do with the two OJSPC warnings? jsf-impl.jar should be included in your war file. I haven't seen this warning when OJSPC is compiling.
    Brenden

  • 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 ?

  • How to use weblogic.jspc -J option

    Can anyone give me an example on how to use the
              weblogic.jspc -J option? Specifically, I want
              my "-compilerclass" to use a system property
              which will be specified on the command line.
              For example:
              java ... weblogic.jspc ... -compilerclass MyCompilerClass -Dmy.text="hello world"
              or something to that effect.
              Gary F.
              Fast Track Systems, Inc.
              

    -J only seems to work for -X-style arguments to the VM, i.e. you can say
              "-Jms64m".
              -compiler has been broken for a while (see my other post in this group on
              that).
              anders
              "Gary Fong" <[email protected]> wrote in message
              news:[email protected]..
              > Can anyone give me an example on how to use the
              > weblogic.jspc -J option? Specifically, I want
              > my "-compilerclass" to use a system property
              > which will be specified on the command line.
              >
              > For example:
              >
              > java ... weblogic.jspc ... -compilerclass
              MyCompilerClass -Dmy.text="hello world"
              >
              > or something to that effect.
              > --
              > Gary F.
              > Fast Track Systems, Inc.
              

  • 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]
              

  • BUG?! in jspc while precompiling jsp pages

    Hi everybody out there,
              Sorry for posting to two groups but I'n not sure which is the right one.
              I think I found a BUG in the JSP Compiler.
              Here is my situation:
              I want to precompile my jsp files in my web-app.
              For this I put a line to my makefile which looks like this:
              find webappdir -name "*.jsp" | xargs java weblogic.jspc -d
              webappdir/WEB-INF/_tmp_war_ShowCase/
              I have to use "find" because there are a lot of dirs which I don't want to
              write explicitly to the makefile.
              The usual behaviour should be a new dir: jsp_servlet And under this all the
              files in my web-app
              and the subdirs should begin with an underscore.
              The problem is, that the generated structure is jsp_servlet/__46_ and from
              there on the expected structure.
              So I tried without find because I suspected the error in the find/xargs
              construct.
              "find" prints out a list like ./dir/name.jsp
              I figured out that when I start jspc manually in the following two ways:
              java weblogic.jspc -d webappdir/WEB-INF/_tmp_war_ShowCase/ dir/name.jsp
              java weblogic.jspc -d webappdir/WEB-INF/_tmp_war_ShowCase/ ./dir/name.jsp
              what should be the very same.
              That the result is different.
              In the first case I get jsp_servlet/_dir/_name.class
              And in the latter jsp_servlet/__46_/_dir/_name.class
              Where does this __46_ come from? It's obviously an error in the jsp compiler
              because its manually reproducable.
              Thanks in advance
              Elmar
              

    BTW one workaround is to use cut from the GNU textutils with cut -c 3-
              This command would then be
              > find webappdir -name "*.jsp" | xargs java weblogic.jspc -d
              > webappdir/WEB-INF/_tmp_war_ShowCase/
              find webappdir -name "*.jsp" | cut -c 3- | xargs java weblogic.jspc -d
              webappdir/WEB-INF/_tmp_war_ShowCase/
              

  • Using precompiled JSPs on Sun ONE 6.1 SP5

    I"m using precompiled JSPs on Sun ONE 6.1 SP5. I have created a virtual server which has one web application deployed as the default web application located at <server-instance>/webapps/myapp. So in the server.xml it appears as :
    <webapp uri="/" path="<server-instnce/webapps/myapp"
    I have precompiled the JSPs using the jspc tool and created the directory containing the class files and have put them under WEB-INF/classes directory. I also generated the web.xml file with mappings for all jsps.
    My problem is that in my web.xml I have specified the <welcome-file> as index.jsp which used to reside under the <server-instance>/webapps/myapp directory. but now since i'm using precompiled versions i have physically removed that file. And now when i point my browser to the app's URL in the browser, i get the app's directory structure and only when i explicitly point my browser to https://<ip>:port/index.jsp then only the index.jsp page is invoked. I'm confused with this behavior. Do I need to change my docsroot directory to point to where the jsp class files are stored? I dont know what else can be going wrong...
    Any help appreciated :D
    Thanks

    Okkay i'll make my question easier.. if i'm using precompiled JSPs i.e. all compiled JSP files (.class files) including index.jsp is in the WEB-INF/classes directory then what is our docroot property supposed to be. Since if I give the document root as <server-instance>/webapps/myapp then it doesnt show the index.jsp that its supposed to when i point my browser to https://<host>:port. Only when I do https://<host>:port/index.jsp the index.jsp servlet is called and the index.jsp page is rendered.... I removed all the jsps physically from my apps folder but when I put only index.jsp there then it does work properly.... so any thoughts on this anyone...

Maybe you are looking for

  • Google Play and Google Services errors on Moto E

    Hello,  I have a Moto E phone which has recently stopped working properly. I keep getting error popups saying 'Unfortunately, the process com.google.process.gapps has stopped' , 'Google services has stopped working', 'Google play has stopped working'

  • Code won't compile!  (cannot resolve symbol)

    I'm having trouble compiling some code. Do any of you guys know why this won't work? * Simulation of one die (now modified for multiple with inheritance) * @author Kristian Hermansen * @version 3/14/2004 (Section 2 honors) public class Experiment1 ex

  • Getting a specified number of rows froma query

    How can I get the minimum 3 row from a query after a order by in the select Eg; SELECT ROWNUM,ROWID, connection_id, GROUP_ID FROM prov_pending_commands ORDER BY group_id 4     AAAZWTAAYAAANMiAAA     680932     32702947 3      AAAZWTAAYAAANMgAAB     6

  • Apple Mail displaying no pictures

    I sent out an email promo using MadMimi and a handful of pictures. It was fine during the editing process, but when I opened the email I'd sent to myself there were no pictures...only a small question mark in the center of the image border along with

  • SDCC_OSS missing

    Hi, I'm trying to configure solman7. By using the wizard, I have activated SDCCN in solman and set solman itself as the master system. In SDCCN, I notice there's 2 tasks: service preparation check and maintenance package. The maintenance package fail