7 Replies Latest reply on Mar 9, 2010 10:59 AM by ponzy

    JSP Compilation Error when using OC4J out of the box

    govWorker
      Hello.
      After installing Java jdk 1.5.0_05, setting ORACLE_HOME, setting JAVA_HOME, rebooting, and installing OC4J standalone straight out of the box, I have deployed a simple web project that consists of just one JSP. I receive the following error message:
      NOTIFICATION J2EE JSP-0008 Unable to dispatch jsp Page: oracle.jsp.provider.JspCompilationException: Errors compiling: C:\LocalApps\OC4J\j2ee\home\application-deployments\oc4j_jsp\persistence\_pages\\_Test.java<pre></pre>

      I have deployed a number of Flex2 applications without incident. What am I missing here? Another odd thing is that my organization has OAS running and it can render JSPs fine.

      Any help is appreciated thanks,
      Mike
      P.S. I have gone back and set the JSP debug switches, but they do not yeild much more info. Here is the stacktrace:

      NOTIFICATION J2EE JSP-0008 Unable to dispatch JSP Page : oracle.jsp.provider.JspCompileException: <H3>Errors compiling:C:\LocalApps\OC4J\j2ee\home\application-deployments\oc4j_jsp\oc4j_jsp\persistence\_pages\\_Test.java</H3><pre></pre>
           at oracle.jsp.app.JspJavacCompiler.compile(JspJavacCompiler.java:304)
           at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:731)
           at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:456)
           at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:413)
           at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:705)
           at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:694)
           at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:414)
           at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
           at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
           at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
           at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
           at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
           at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
           at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
           at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
           at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
           at java.lang.Thread.run(Unknown Source)
        • 1. Re: JSP Compilation Error when using OC4J out of the box
          codealchemist
          Mike,
          That's a java compile error. Does your code compile in the IDE before you deploy?
          -Mike
          • 2. Re: JSP Compilation Error when using OC4J out of the box
            govWorker
            Hello.
            Thanks for replying to my question.

            Yes, the jsp compiles no problem. It is just a simple Hello World type jsp. It runs fine in both Tomcat and OAS, but for some reason I cannot get it to work in any OC4J standalone instance that I set up. Ugh! This problem is killing me!

            Here is the JSP:

            <HTML>
            <HEAD><TITLE>My Test JSP</TITLE></HEAD>
            <BODY>
            <H3>WELCOME TO MY TEST JSP PAGE</H3>
            <P>Current Time: <%=new java.util.Date() %> </P>
            </BODY>
            </HTML>

            Thanks,
            Mike
            • 3. Re: JSP Compilation Error when using OC4J out of the box
              govWorker
              Update: I have discovered that it is a problem with MyEclipse starting up the standalone instance of OC4J!

              If I start OC4J using just the command prompt: oc4j -start. The JSP renders fine, but when MyEclipse starts OC4J then something breaks. I have also tested the problem using the latest version of Eclipse. Eclipse now has the server configuration tool that I liked in MyEclipse and when the launch is fired from Eclipse everything works fine.

              So it seems to be a problem with MyEclipse or at least the method that I am using with their IDE.

              I have a service request into MyEclipse and they are now looking at my problem.
              • 4. Re: JSP Compilation Error when using OC4J out of the box
                govWorker
                Yes!
                I answered my own question.
                The problem was that the Java version used for oc4j was not the one specified in the oc4j.cmd! Evidently the version shipped with MyEclipse does not work well with OC4J and JSPs. When MyEclipse starts up the oc4j server instance it uses the jre supplied by the MyEclipse install! I incorrectly thought that MyEclipse used the oc4j.cmd to start it up. It does not. Once I discovered this I just changed the Java version used by MyEclipse to launch the OC4J instance to point to the same version specified in the oc4j.cmd which is just the JAVA_HOME environment variable.
                • 5. Re: JSP Compilation Error when using OC4J out of the box
                  540340
                  Thank you, thank you, thank you!
                  I was having exactly the same problem recently after it all worked fine deploying to oc4j 10.1.3 from eclipse for ages - at some point I must have pointed the oc4j launch configuration in eclipse at a different java version to the one specified in the JAVA_HOME environment variable and whilst the server would start I could not get even the simplest JSP to compile let alone any of my projects - very frustrating!
                  Changed the java version specified in the eclipse-oc4j launch config to match that in JAVA_HOME, restarted and now it's all working again.

                  Cheers.
                  • 6. Re: JSP Compilation Error when using OC4J out of the box
                    689455
                    Ahh, sweet relief. It took 10 hours of suffering before I found this solution. Thanks.
                    • 7. Re: JSP Compilation Error when using OC4J out of the box
                      ponzy
                      I had the very same Problem, and I spent a lot of time on it.
                      When installing Oc4j as a service using Javaservice opnesource, I had no problem, even using J.D.K 1.6:

                      %JSEXE% -install %JSNAME% %JVMDIR%\jvm.dll -XX:PermSize=128m -XX:MaxPermSize=256m -Xmx1024M -Xms1024M -Djava.class.path=%OC4J_HOME%\oc4j.jar -start oracle.oc4j.loader.boot.BootStrap -params -config %OC4J_HOME%\config\server.xml -out %OC4J_HOME%\log\OC4J_service_stdout.log -err %OC4J_HOME%\log\OC4J_service_stderr.log -current %JSBINDIR% -auto -description OC4JService

                      Then I wanted to install it using "ServiceMill" or "Javaservice Wrapper", becuase it has a better control on the process and I had that awfull compilation error.
                      I guess it is because ServiceMills uses java.exe and javaservice the .dll to launch the oc4j, no idea.
                      Anyway, thank you very much!!!!!

                      Antonio