Discussions

EJB programming & troubleshooting: Compilation Problem in Deploying JSPs in Weblogic 5.1

  1. 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.

    Tried with the following web.xml.

    <!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
  2. hi

    Use this and see :
    instead of the line
    <%@ page errorPage="../error.jsp" %>

    just put the following ... and put this line on the top of the page

    <%@ page language="java" import="java.sql.*,java.util.*" errorPage="../error.jsp" %>

    Thanks
    Shiv
  3. Hi Shiv,

    Thanks for your suggession but still having the same problem.

    Srinivas.J