将在 weblogic 8.1 上运行的 Struts 应用程序部署到 weblogic 11g 时出现问题

发布于 2024-10-26 18:42:46 字数 5007 浏览 1 评论 0原文

如果我在本地 weblogic 8.1 服务器上部署一个ear文件,它工作得很好。但是当我将其部署到Weblogic 11g上时,它给出了错误。

以下是场景 -

应用程序的第一页要求您选择用户。选择用户后,它将执行 RolesAction 并将您带到角色页面,其中与用户关联的角色将以下拉列表形式出现。

一旦我部署 Argus 应用程序并在测试登录页面上选择用户,整个 RolesAction 类就会被执行,但我没有在下拉列表中获取包含与该用户关联的角色的页面,而是在日志文件中收到“错误 404 - 未找到”错误页面出现下面提到的错误。

<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)

有什么输入吗??

我的 Roles.jsp 的 tld 声明如下:

<%@ 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" %>

您发现 tld 声明有任何问题吗?

想法?

谢谢!

编辑:

应用程序中出现的第一个页面(您在其中选择用户)是 Login.jsp。在此 jsp 中,tld 声明如下: 显示此页面。然而,roles.jsp 页面是给出错误的页面。

Login.jsp tld 声明:

<%@ 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" %>

两个jsp 都具有相同的tld 声明,并且1 显示,而另一个给出错误。

有想法吗?

编辑:

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>

编辑:

struts-config.xml

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

为 url 模式调用的操作位于 spring.xml 文件中。

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"> </td>
 </tr>
<tr>
<td width="100%" align="center" class="epi-dataTableLiteNew">
 <font size="2"><b>Select a Role:</b> </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> </p>
<p> </p>
<p> </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:   -->
 <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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

☆獨立☆ 2024-11-02 18:42:47

检查应用程序 lib 文件夹以找到 struts-core-1.3.8.jar 以及 struts.jar。正是因为如此,才引发了异常。

struts.jar有forwardConfig类和getContextRelative()方法。

struts-core-1.3.8.jar具有forwardConfig类,但没有getContextRelative()方法。

这是导致问题的原因。

因此删除struts.jar以便使用1.3.8版本。

-- 另外将 struts-extras-1.3.8.jar 添加到应用程序库

-- 在 jsp 中,将标记库 uri 更正为:

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

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

这解决了问题

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

违心° 2024-11-02 18:42:47

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" %>

请使用上面的标签 lib uri 。希望能解决您的问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文