6 Replies Latest reply: Mar 2, 2012 9:19 AM by 919013 RSS

    Blank Page Displayed on Struts Action Call

    919013
      I am new to JDeveloper and Struts, and I am currently haveing an issue with my Java EE Web Application. The application is in JDeveloper 11g with a web component, an EJB component, uses Struts 1.1., and is deployed to a stand-alone Weblogic Server.

      When I deploy the application to WebLogic using an EAR made up of the application JAR with miscellaneous libraries and files, and the exploded Web directory, I can logon to the application just fine using the URL http://localhost:7001/login.do?username=<userid>

      If I deploy the EAR with just the application JAR, and create & deploy the WAR separately, it also works fine.

      When I bundle the WAR in the EAR along with the JAR, then deploy it to WebLogic the same URL displays a blank page. There are no errors during deployment, no errors logged trying to go to the URL or anything. It looks like the Struts action login.do just doesn't exist. I have the Struts runtime included in my libraries. I have the following files in the W:\application\WebApp\public_html\WEB-INF (displayed as WebApp\Web Content\WEB-INF inside JDeveloper)
      app.tld
      struts-bean.tld
      struts-config.xml
      struts-config.xsl
      struts-html.tld
      struts-logic.tld
      struts-nested.tld
      struts-template.tld
      struts-tiles.tld
      struts.tld
      web.xml
      weblogic.xml

      The WebLogic.xml contains the following:
      <?xml version = '1.0' encoding = 'windows-1252'?>
      <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.1/weblogic-web-app.xsd"
      xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
      <session-descriptor>
      <timeout-secs>3600</timeout-secs>
      <invalidation-interval-secs>60</invalidation-interval-secs>
      <id-length>52</id-length>
      <tracking-enabled>true</tracking-enabled>
      <cookies-enabled>true</cookies-enabled>
      <cookie-name>JSESSIONID</cookie-name>
      <cookie-comment>WebLogic Server Session Tracking Cookie</cookie-comment>
      <cookie-max-age-secs>-1</cookie-max-age-secs>
      <persistent-store-type>memory</persistent-store-type>
      <url-rewriting-enabled>true</url-rewriting-enabled>
      </session-descriptor>
      <jsp-descriptor>
      <keepgenerated>false</keepgenerated>
      <package-prefix>jsp_servlet</package-prefix>
      <page-check-seconds>1</page-check-seconds>
      <precompile>false</precompile>
      <verbose>true</verbose>
      <working-dir>c:\jspTempDir</working-dir>
      </jsp-descriptor>
      <context-root>/</context-root>
      </weblogic-web-app>


      The web.xml contains the following:
      <?xml version = '1.0' encoding = 'windows-1252'?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      version="2.5">
      <context-param>
      <param-name>ipermsPath</param-name>
      <param-value>/export/home/intrfces/iperms/spl</param-value>
      </context-param>
      <servlet>
      <servlet-name>action</servlet-name>
      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
      <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <session-config>
      <session-timeout>15</session-timeout>
      </session-config>
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <error-page>
      <error-code>500</error-code>
      <location>/jsp/common/error.jsp</location>
      </error-page>
      <jsp-config>
      <taglib>
      <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
      <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
      <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
      <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
      </taglib>
      <taglib>
      <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
      </taglib>
      <taglib>
      <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
      <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
      </jsp-config>
      </web-app>


      The struts.config contains the following:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
      <struts-config>
      <form-beans>
      .
      .
      <form-bean name="beanName" type="beanType" />
      .
      .
      </form-beans>
      <action-mappings type="CommonActionMapping">
      .
      .
      <action path="/login" scope="request" type="package.LoginAction" validate="false">
      <set-property property="requiredRight" value="none" />
      </action>
      .
      .
      </action-mappings>
      <message-resources null="false" parameter="ApplicationResources" />
      </struts-config>

      CommonActionMapping.java:
      package package.common;

      import org.apache.struts.action.ActionMapping;

      public class CommonActionMapping extends ActionMapping
      {
      private String requiredRight;

      /**
      * Constructor for the CommonActionMapping object
      */
      public CommonActionMapping ()
      {
      super();
      }

      /**
      * Gets the requiredRight attribute of the CommonActionMapping object
      *
      *@return The requiredRight value
      */
      public String getRequiredRight()
      {
      return requiredRight;
      }

      /**
      * Sets the requiredRight attribute of the CommonActionMapping object
      *
      *@param requiredRight The new requiredRight value
      */
      public void setRequiredRight(String requiredRight)
      {
      this.requiredRight = requiredRight;
      }
      }


      I have been trying to figure this out for a few days now, with no luck. Any help will be appreciated.

      Thanks.

      Edited by: 916010 on Feb 28, 2012 1:41 PM
        • 1. Re: Blank Page Displayed on Struts Action Call
          Andreas Koop
          Are you really bound to Struts? IF not try ADF Faces Rich Client as the View side....;)
          • 2. Re: Blank Page Displayed on Struts Action Call
            919013
            Unfortunately, at this time we are bound to Struts.
            • 3. Re: Blank Page Displayed on Struts Action Call
              Timo Hahn
              User,
              I have some working struts application under jdev 11.1.1.4.0 to jdev 11.1.1.6.0 which use struts 1.2.9 provided by jdev.
              If you like I can make an test work space available to you which is based on the HR schema and uses the old bc4j jbo-tags. This test case is working under 11.1.1.6.0 and can be deployed on an stand alone WLS too and runs OK.
              You can then look at this sample and might find your problem, which I'm suspect are your descriptors.
              If you are interested in this test case, drop me a note in this thread and I set it up for you on my blog.

              Timo
              • 4. Re: Blank Page Displayed on Struts Action Call
                919013
                If you have a sample that is working, I would definitely like to looks at it. Although I am using Struts 1.1, it might give me some insight.
                • 5. Re: Blank Page Displayed on Struts Action Call
                  Timo Hahn
                  You can download the sample code from here: http://tompeez.files.wordpress.com/2012/02/test2_11-zip.doc
                  after download you need to rename the file to test2_11.zip (as the blog donÄt allow zip files). Unzip the file. The project uses the HR schema, one thing to note is a library STRUTS_APP_LIB.library which holds all needed adf libs needed to run the application. The definition (which real jars are needed) you find root of the work space.

                  Timo

                  Edited by: Timo Hahn on 29.02.2012 21:14
                  Originally the app was developed with struts 1.1
                  • 6. Re: Blank Page Displayed on Struts Action Call
                    919013
                    Thanks for all of the help, and I have found the solution to my issue.

                    The short answer was to make sure that we used an old version of the Struts Library.

                    The long answer:
                    We upgraded from WebLogic 8.1/JBuilderX to JDeveloper/WebLogic 11G, but due to time constraints, had to keep our application at Struts 1.1. We used the Struts Runtime Library provided with JDeveloper/WebLogic 11G in the EJB project, but still had the old Struts JARS in the WEB_INF\classes\lib directory of the Web project.

                    When the WAR was deployed separately, or the active directory deployed, everything worked, but when the WAR was packaged in the EAR the blank page was displayed.

                    After many Web searches, we thought that it might a classLoader issue, even though there were no errors in the log.

                    I went through the application, making sure we had the latest libraries in the EJB and Web projects, and when I changed the Web project to use the latest Struts libraries the issue of the blank page appeared for all scenarios of deployment. Once I changed the EJB and Web projects to use the older version of the Struts JARS, all deployment scenarios worked.