1

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.

MAlex
  • 1,234
  • 2
  • 16
  • 29

2 Answers2

2

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

MAlex
  • 1,234
  • 2
  • 16
  • 29
1

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.

Community
  • 1
  • 1
developer
  • 9,116
  • 29
  • 91
  • 150
  • @Damodar: In my app, all the tag libs have been copied under WEB-INF, and hence the path. Wouldnt your way make the application connect to the website instead. Wouldnt want to do that in the code. Do u suggest a way out. Do you think the tld's that I am using might be the problem? I am clueless. – MAlex Mar 24 '11 at 05:59
  • problem with tld only , otherwise download struts 1.2.X jars and have a trail by placing in WEB-INF. – developer Mar 24 '11 at 06:03
  • hmmm...let me try this out...wl revert – MAlex Mar 24 '11 at 06:20
  • @Damodar: Tried the above. No luck. one more thing, I chked the struts.jar version and it says 1.2. In Struts 1.2 ForwardConfig.getContextRelative is deprecated as you said. In this case what can be done since this method is not present in Struts 1.2. – MAlex Mar 25 '11 at 06:50
  • hey give few mins, lunch time it is – developer Mar 25 '11 at 06:54
  • do you know javaranche , please post this issue there. we can get response. Mean while i will try if time permits – developer Mar 28 '11 at 07:43
  • @Damodar: Thanks Damodar for the help. Finally got through. I did have to correct the uri and also rectify the jars in the application. Have posted the entire change below. Thanks again. – MAlex Mar 30 '11 at 08:36