2 Replies Latest reply on Apr 20, 2007 9:47 AM by jaikiran pai

    Unable to Run an EAR or WAR File

    Jeffrey Himmel Newbie

      I noticed that if I deploy a EAR file or WAR file into the "deploy" folder of JBoss, I am unable to run that application. Normally, I develop and run JSF applications on JBuilder, which runs JBoss. But if I start JBoss directly and type the url of the application in the browser as follows:

      http://localhost:8080/ApplicationName/

      A directory listing is shown. If I click on the JSP file that starts the application, I get an HTTP Status 500 error.

      This happens even when I try to deploy other applications that work via JBuilder. What went wrong? How do I isolate the cause of the problem?

        • 1. Re: Unable to Run an EAR or WAR File
          Jeffrey Himmel Newbie

          Here are more details about the problem.

          If I deploy HelloJSF.war into the "deploy" folder and go to the http://localhost:8080/HelloJSF/ URL, I get the following:

          Directory Listing For /

          --------------------------------------------------------------------------------
          Filename Size Last Modified
          greeting.jsp 0.4 kb Tue, 13 Mar 2007 22:04:54 GMT
          hello.jsp 0.6 kb Tue, 13 Mar 2007 22:03:00 GMT
          --------------------------------------------------------------------------------

          Apache Tomcat/5.5.20

          If I click on hello.jsp, I get the following exception report:

          HTTP Status 500 -

          --------------------------------------------------------------------------------

          type Exception report

          message

          description The server encountered an internal error () that prevented it from fulfilling this request.

          exception

          org.apache.jasper.JasperException
          org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


          root cause

          java.lang.NullPointerException
          javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
          javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
          org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:70)
          org.apache.jsp.hello_jsp._jspx_meth_f_view_0(hello_jsp.java:99)
          org.apache.jsp.hello_jsp._jspService(hello_jsp.java:74)
          org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


          note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.


          --------------------------------------------------------------------------------

          Apache Tomcat/5.5.20

          If anyone has experience with this type of problem, please help. Also, where might I learn how to understand the exception report? Thanks.

          - jhimmel

          • 2. Re: Unable to Run an EAR or WAR File
            jaikiran pai Master

            The reason why you are seeing a directory listing when you specify http://localhost:8080/HelloJSF/ is because you dont have a welcome file in your application. By default the server searches for index.jsp or index.html in the application. If it does not find this then it wil display the directory listing. If you want to disable this, you have 2 options:

            1) There's a xml file where you can disable the directory listing

            or 2) You can specify your welcome file in the web.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
             <servlet>
             ...
            
             </servlet>
             <servlet-mapping>
             ...
             </servlet-mapping>
             <welcome-file-list>
             <welcome-file>hello.jsp</welcome-file>
             </welcome-file-list>
            </web-app>


            The other error that you are seeing (NullPointerException) when you access the hello.jsp is related to the code in your jsp. You will have to debug from the logs in server.log to figure out why thats occuring