Deploying JSPs in Weblogic 5.1

Discussions

Web tier: servlets, JSP, Web frameworks: Deploying JSPs in Weblogic 5.1

  1. Deploying JSPs in Weblogic 5.1 (8 messages)

    Hi All,

    I am trying to deploy a JSP by creating .war file(not copying the jsp to doc-root). The deployment went throught fine but when I call the JSP through a form, the browser shows "ERROR 500" and the weblogic console is showing the following error at the time of compiling the generated .java file.

    Tue Feb 27 14:20:04 EST 2001:<I> <ServletContext-loginx> Generated java file: C:
    \users\Srini\login-j2ee\login\_tmp_war\jsp_servlet\_loginchk.java
    Tue Feb 27 14:20:04 EST 2001:<E> <ServletContext-loginx> Compilation of C:\users
    \Srini\login-j2ee\login\_tmp_war\jsp_servlet\_loginchk.java failed: java.io.IOEx
    ception: CreateProcess: javac -classpath C:\weblogic\myserver\serverclasses;C:\w
    eblogic\jre1_2\jre\lib\rt.jar;C:\weblogic\jre1_2\jre\lib\i18n.jar;C:\weblogic\cl
    asses\boot;C:\weblogic\eval\cloudscape\lib\cloudscape.jar;C:\weblogic\license;C:
    \weblogic\classes;C:\weblogic\myserver\serverclasses;C:\weblogic\lib\weblogicaux
    .jar;C:\users\Srini\login-j2ee\login\WEB-INF\classes;C:\users\Srini\login-j2ee\l
    ogin\_tmp_war -d C:\users\Srini\login-j2ee\login\_tmp_war C:\users\Srini\login-j
    2ee\login\_tmp_war\jsp_servlet\_loginchk.java error=2
            at java.lang.Win32Process.create(Native Method)
            at java.lang.Win32Process.<init>(Win32Process.java:64)
            at java.lang.Runtime.execInternal(Native Method)
            at java.lang.Runtime.exec(Runtime.java:272)
            at java.lang.Runtime.exec(Runtime.java:219)
            at weblogic.utils.Executable.exec(Executable.java, Compiled Code)
            at weblogic.utils.Executable.exec(Executable.java:88)
            at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvo
    ker.java, Compiled Code)
            at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:
    202)
            at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled Code)

            at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:174)
            at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:164)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:99)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:123)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:742)
            at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
    textImpl.java:686)
            at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
    ContextManager.java:247)
            at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
    a:361)
            at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)

            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)


    The JSP code is

    <html>
    <head>
    <title>
    Login Check
    </title>
    </head>
    <body>
    <%@ page errorPage="../error.jsp" %>
    userid <%= request.getParameter("userId") %> <br>
    password <%= request.getParameter("password") %> <br>
    <jsp:useBean id="sessionuser" class="Srini.User" scope="session" />
    <% if(request.getParameter("userId")==null || request.getParameter("password")==null || ((String) request.getParameter("userId")).equals("") || ((String) request.getParameter("password")).equals(""))
    {%>
    <jsp:getProperty name="sessionuser" property="userId" />
    <%}
    else
    {%>
    <jsp:setProperty name="sessionuser" property="dSName" param="MSAccess" />
    <jsp:setProperty name="sessionuser" property="userId" param="userId" />
    <jsp:setProperty name="sessionuser" property="password" param="password" />

    Login successfull
    <%}%>
    </body>
    </html>


    FYI : the sample cookie web application is working fine by deploying and the above shown jsp works fine without deploying.

    Thanks,
    Srinivas.J

    Threaded Messages (8)

  2. I don't think you have properly specified your JSP compiler.
    See weblogic.jsp.compileCommand in http://www.weblogic.com/docs51/classdocs/webappguide.html for the exact syntax.

    Evan.

  3. Evan,

    I have given it correctly. The properties file itself has a sample commented line for this property.

    Tried again and is giving the same error.

    Thanks,
    Srinivas.J
  4. Please see the URL I posted. If I read it correctly it is not sufficient to specify the JSP compiler in weblogic.properties. It must be in web.xml for .war files.

    This seems like a huge deployment issue but it's apparently the way it is supposed to be.

    Evan.
  5. Evan,

    Tried with the following web.xml. Still having the same problem.


    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

    <web-app>
    <context-param>
    <param-name>weblogic.jsp.precompile</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>weblogic.jsp.compileCommand</param-name>
    <param-value>c:java\jdk1.2.2\bin\javac.exe</param-value>
    </context-param>
    <context-param>
    <param-name>weblogic.jsp.verbose</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>weblogic.jsp.pageCheckSeconds</param-name>
    <param-value>5</param-value>
    </context-param>
    <servlet>
    <servlet-name>loginChk1.jsp</servlet-name>
    <jsp-file>loginChk1.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>loginChk2.jsp</servlet-name>
    <jsp-file>loginChk2.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>error.jsp</servlet-name>
    <jsp-file>error.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>Login.jsp</servlet-name>
    <jsp-file>Login.jsp</jsp-file>
    </servlet>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
        <error-page>
            <error-code>404</error-code>
            <location>/error.jsp</location>
        </error-page>
    <resource-ref>
    <res-ref-name>jdbc/MSAccess</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>SERVLET</res-auth>
    </resource-ref>

    </web-app>


    Thanks,
    Srinivas.J
  6. Your slashes are messed up:

    <param-value>c:java\jdk1.2.2\bin\javac.exe</param-value>

    First, I assume you need a slash after "c:" Except .cmd files you should always use forward slashes when you specify file paths in weblogic. Try using:

    <param-value>c:/java/jdk1.2.2/bin/javac.exe</param-value>

    Evan.
  7. Evan,

    Still having the same problem.

    I refered weblogic news group. I found some guy posting the same problem and no one has given a solution for that.

    Thanks,
    Srinivas.J
  8. What newsgroup? I did not see it in weblogic.developer.interest.jsp.
     
    Are you able to deploy the webapp example? Try opening error.jsp.

    It works fine for me but it seems to use %JAVA_HOME%/bin/javac as its compiler. It uses different settings from weblogic.properties and web.xml does not contain any jsp stuff. Is it possible you are using a "jre" instead of a "java" to launch? If so try launching with a directory containing "bin/javac" as %JAVA_HOME%.

    Evan.
  9. Evan,

    I went to the posting through the url http://www.bea.com/support/index.jsp and gave "Compilation problem in deploying JSPs in 5.1" in the question and pressed go. In the list the second in the news group listing with subject "Subject: Compilation failure when using WAR: call to ServletContextImpl.isResourceStale in generated .java doesn't match call in WL class file".

    That person has told he got a compilation error while compiling manually but I am not getting that. It compiles fine while doing manually.

    Even the webapp is not working for me.

    Srinivas.J