Question

If I deploy an ear file on my local weblogic 8.1 server, it is working perfectly fine. But when I deploy it on Weblogic 11g, it gives an error.

Here is the scenario –

The first page of the application asks you to select the user. On user selection it will execute the RolesAction and take you to the roles page wherein the roles that are assiociated with the user will come as a drop down.

Once I deploy Argus application and select user on test login page, entire RolesAction class is getting executed but instead of getting page with roles associated to that user in the dropdown, I am getting “Error 404—Not Found” error page and in log file getting below mentioned error.

<Mar 20, 2011 8:20:42 PM GMT> <Error> <HTTP> <BEA-101017> <[ServletContext@406125315[app:ArgusDEV module:ArgusWeb path:/ArgusWeb spec-version:null]] Root cause of ServletException.

java.lang.NoSuchMethodError: org/apache/struts/config/ForwardConfig.getContextRelative()Z

            at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:298)

            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)

            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

Any inputs??

My Roles.jsp has the tld declaration as below:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Do you see any issue wrt the tld declaration?

Thoughts?

Thanks!

EDIT:

The first page that comes up in the application wherein you select the user is the Login.jsp. In this jsp, the tlds are declared as below: This page is displyed. However, the roles.jsp page is the one that gives the error.

Login.jsp tld declaration:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Both the jsp's have the same tld declaration, and 1 gets displayed whereas the other one gives an error.

Ideas?

EDIT:

Roles.jsp

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="css/arg.css" />


</head>
<form name="rolesForm" method="post">

<logic:present name="VIEW_BEAN" scope="request">
<logic:notEmpty name="VIEW_BEAN" property="userId" scope="request">
    <input type="hidden" name="Id" value="<bean:write name="VIEW_BEAN"     property="userId"/>">
</logic:notEmpty>
</logic:present>
<table border="0" cellpadding="1" cellspacing="0" width="95%" bgcolor="#FFFFFF">
 <tr>
<td height="19">&nbsp;</td>
 </tr>
<tr>
<td width="100%" align="center" class="epi-dataTableLiteNew">
 <font size="2"><b>Select a Role:</b>&nbsp;</font>
 <select size="1" name="roleType" class="textbox" ">
            <option value="">Select ---</option>
            <logic:notEmpty name="VIEW_BEAN" property="roleList" scope="request">
                <logic:iterate id="record" name="VIEW_BEAN"     property="roleList" scope="request">
                <option value="<bean:write name="record"     property="roleID"/>"><bean:write name="record" property="roleName"/></b></option>
                </logic:iterate>                
            </logic:notEmpty>
        </select>
<input type="submit" value="Submit" onClick="return selectRole()" style="border:1px     ridge #000000; height:22px; font-weight:bold cellpadding="0" cellspacing="0" 100%>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</td>

</tr>
</table>
</form>     
</body>
</html>

Login.jsp

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
</head>
<%@ page 
language="java"
%>
<meta http-equiv="Content-Type" content="text/html" />
<link rel="stylesheet" type="text/css" href="css/arg.css" />

<title>Home</title>


 <%
  String userid=request.getHeader("user");
  String isLoginPage=request.getParameter("isUser");

%>
<!-- Please select the user from the list and press continue: &nbsp; -->
 <form name="homePageForm" action="RolesAction.do" method="post">

 </form>
</body>
</html>

EDIT:

struts-config.xml

<action
  path="/roles"
  name="HomePageForm"
  type="org.springframework.web.struts.DelegatingActionProxy"
  scope="request">
  <forward name="success" path=".rolespage"/>
</action>

The action to be called for the url pattern is in the spring.xml file.

Was it helpful?

Solution

Checked the application lib folder to find struts-core-1.3.8.jar as well as struts.jar. It is because of this that the exception was thrown.

struts.jar has the forwardConfig class and getContextRelative() method.

struts-core-1.3.8.jar has the forwardConfig class , but not the getContextRelative() method.

This was causing the issue.

Therefore remove struts.jar so that 1.3.8 version is used.

-- Additionally add struts-extras-1.3.8.jar to the application lib

-- In the jsp, correct the tag lib uri to:

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> 

<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> 

This solves the problem

OTHER TIPS

Struts 1.1 <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>

Struts 1.2.x <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

Please use above tag lib uri . Hope will solve your issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top