Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jboss中的JSP部署问题_Java_Apache_Jsp_Jboss_Mod Jk - Fatal编程技术网

Java jboss中的JSP部署问题

Java jboss中的JSP部署问题,java,apache,jsp,jboss,mod-jk,Java,Apache,Jsp,Jboss,Mod Jk,我在Linux中安装了JBoss4.0.4GA。在我毫无问题地启动jboss后,我尝试在浏览器中访问JSP页面,出现错误: 然后单击“刷新”按钮,或 请稍后再试 名称以无效字符开头。处理资源“”时出错。林 -^ 我发现转换后的servlets类文件不在[jboss home]/work/jboss.web/localhost/\ux/org中。。。目录Jboss日志文件中没有错误 有人能帮我解决这个问题吗?我已经花了很多时间来解决这个问题,但是运气不好 这是我的web.xml: <?x

我在Linux中安装了JBoss4.0.4GA。在我毫无问题地启动jboss后,我尝试在浏览器中访问JSP页面,出现错误:

然后单击“刷新”按钮,或 请稍后再试


名称以无效字符开头。处理资源“”时出错。林

-^

我发现转换后的servlets类文件不在[jboss home]/work/jboss.web/localhost/\ux/org中。。。目录Jboss日志文件中没有错误

有人能帮我解决这个问题吗?我已经花了很多时间来解决这个问题,但是运气不好

这是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <filter>
    <filter-name>AuthenticationFilter</filter-name>
    <filter-class>com.marvell.macroip.web.util.AuthenticationFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>AuthenticationFilter</filter-name>
    <url-pattern>/extract/*</url-pattern>    
  </filter-mapping>
  <filter-mapping>
    <filter-name>AuthenticationFilter</filter-name>    
    <url-pattern>/admin/*</url-pattern>
  </filter-mapping>
  <listener>
    <listener-class>com.marvell.macroip.web.util.PublicSessionListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>application</param-name>
      <param-value>com.marvell.macroip.web.ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>validate</param-name>
      <param-value>true</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>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  <error-page>
    <error-code>400</error-code>
    <location>/error/index.jsp?code=400</location>
  </error-page>
  <error-page>
    <error-code>401</error-code>
    <location>/error/index.jsp?code=401</location>
  </error-page>
  <error-page>
    <error-code>403</error-code>
    <location>/error/index.jsp?code=403</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/error/index.jsp?code=404</location>
  </error-page>
  <error-page>
    <error-code>405</error-code>
    <location>/error/index.jsp?code=405</location>
  </error-page>
  <error-page>
    <error-code>408</error-code>
    <location>/error/index.jsp?code=408</location>
  </error-page>
  <error-page>
    <error-code>410</error-code>
    <location>/error/index.jsp?code=410</location>
  </error-page>
  <error-page>
    <error-code>411</error-code>
    <location>/error/index.jsp?code=411</location>
  </error-page>
  <error-page>
    <error-code>412</error-code>
    <location>/error/index.jsp?code=412</location>
  </error-page>
  <error-page>
    <error-code>413</error-code>
    <location>/error/index.jsp?code=413</location>
  </error-page>
  <error-page>
    <error-code>414</error-code>
    <location>/error/index.jsp?code=414</location>
  </error-page>
  <error-page>
    <error-code>415</error-code>
    <location>/error/index.jsp?code=415</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/error/index.jsp?code=500</location>
  </error-page>
  <error-page>
    <error-code>501</error-code>
    <location>/error/index.jsp?code=501</location>
  </error-page>
  <error-page>
    <error-code>502</error-code>
    <location>/error/index.jsp?code=502</location>
  </error-page>
  <error-page>
    <error-code>503</error-code>
    <location>/error/index.jsp?code=503</location>
  </error-page>
  <error-page>
    <error-code>506</error-code>
    <location>/error/index.jsp?code=506</location>
  </error-page>
  <taglib>
    <taglib-uri>/WEB-INF/for-loop.tld</taglib-uri>
    <taglib-location>/WEB-INF/for-loop.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/root.tld</taglib-uri>
    <taglib-location>/WEB-INF/root.tld</taglib-location>
  </taglib>
  <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-nested.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
  </taglib>
  <security-constraint>
    <display-name>MacroIP Login</display-name>
    <web-resource-collection>
      <web-resource-name>MacroIP Login</web-resource-name>
      <url-pattern>/login/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>
  <security-constraint>
    <display-name>Extract</display-name>
    <web-resource-collection>
      <web-resource-name>Extract</web-resource-name>
      <url-pattern>/extract/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>
  <security-constraint>
    <display-name>Admin</display-name>
    <web-resource-collection>
      <web-resource-name>Admin</web-resource-name>
      <url-pattern>/admin/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>
</web-app>

身份验证过滤器
com.marvell.macroip.web.util.AuthenticationFilter
身份验证过滤器
/摘录/*
身份验证过滤器
/管理员/*
com.marvell.macroip.web.util.PublicSessionListener
行动
org.apache.struts.action.ActionServlet
调试
2.
配置
/WEB-INF/struts-config.xml
应用
com.marvell.macroip.web.ApplicationResources
细节
2.
验证
真的
2.
行动
*.做
index.jsp
index.html
400
/错误/index.jsp?代码=400
401
/错误/index.jsp?代码=401
403
/错误/index.jsp?代码=403
404
/错误/index.jsp?代码=404
405
/错误/index.jsp?代码=405
408
/错误/index.jsp?代码=408
410
/错误/index.jsp?代码=410
411
/错误/index.jsp?代码=411
412
/错误/index.jsp?代码=412
413
/错误/index.jsp?代码=413
414
/错误/index.jsp?代码=414
415
/错误/index.jsp?代码=415
500
/错误/index.jsp?代码=500
501
/错误/index.jsp?代码=501
502
/错误/index.jsp?代码=502
503
/错误/index.jsp?代码=503
506
/错误/index.jsp?代码=506
/WEB-INF/for-loop.tld
/WEB-INF/for-loop.tld
/WEB-INF/root.tld
/WEB-INF/root.tld
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
/WEB-INF/struts-nested.tld
/WEB-INF/struts-nested.tld
MacroIP登录
MacroIP登录
/登录/*
保密的
摘录
摘录
/提取/*
保密的
管理
管理
/管理员/*
保密的
jsp页面:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="com.marvell.macroip.util.Constants" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/logic-ext.tld" prefix="logic-ext" %>
<bean:parameter id="logout" name="logout" value="false"/>

<html>
<head>
<title>Tracking System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/JavaScript" src="/includes/imgChange.js"></script>
<script language="JavaScript" type="text/JavaScript" src="/includes/css_bCheck.js"></script>
<script language="javascript" type="text/javascript" src="/includes/sifr.js">// flash insert code</script>
</head>

<body bgcolor="#eeeeee" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
              <table width="470" border="0" cellspacing="0" cellpadding="0">
                   <tr valign="middle">
<td align="right" bgcolor="#ebebeb" class="smallgrey"><span class="red">*</span>User Name &nbsp;</td>
                   <td>
<html:text property="userName" styleClass="formElement" size="29" disabled="false" style="width:290px"/>
                  </td>
                </tr>

                <tr valign="middle">
                  <td align="right" bgcolor="#ebebeb" class="smallgrey"><span class="red">*</span>Password&nbsp;</td>
                  <td>
                  <html:password property="password" maxlength="35" redisplay="false" styleClass="formElement" size="29" disabled="false" style="width:290px"/>
                  </td>
                </tr>
              </table>

              <table width="440" border="0" cellspacing="0" cellpadding="0">

                <tr>
                  <td align="right">
                    <input type="image" alt="Submit" border="0" />
                  </td>                        
                </tr>
              </table>

跟踪系统
//闪存插入代码
*用户名
*密码

如果我尝试此jsp页面,它将是空白页面或在浏览器中显示原始jsp代码

   <html><head><title>JSP Test</title> 
   <%! 
   String message = "Hello, World."; 
   %> 
   </head> 
   <body> 
   <h2><%= message%></h2> 
   <%= new java.util.Date() %> 
   </body></html>
JSP测试

这里的问题是JSP没有按照预期编译或执行

负责这一点的是
JspServlet
,它在servlet容器的
web.xml
中配置。对于JBoss AS,这就是Tomcat,它的
web.xml
默认位于Tomcat安装的
/conf
文件夹中。它必须包含
org.apache.jasper.servlet.JspServlet
的活动(即未被评论)定义
,以及同一
servlet名称上的
以及
*.jsp
url模式。核实是否有任何事情是正确的


另一个原因可能是webapplication本身的
web.xml
(在
/web-INF
文件夹中的那一个)在与
JspServlet
完全相同的
url模式上有另一个
过滤器或
Servlet
(因此覆盖了它),但在判断了您发布的
web.xml
之后,情况就不是这样了。

我确实找到了解决方案。从jsight所说的“是的,我认为它是内部的……我只是想知道apache->jboss进程(或其他什么)是否真的没有达到您认为的页面。例如,如果apache为页面本身提供服务,您会看到这样的问题(配置错误的apache)而不是重定向到jboss。或者如果您点击的不是.jsp(url的其他排列)。–jsight“


我发现应该是apache+ssl尝试自行解析jsp,而不是将jsp请求传递给jboss。然后我和我的同事发现mod_jk在apache中没有正确加载。因此,在httpd.conf文件中加载的mod-jk.conf之后添加“JkMountCopy ALL”。重启Apache,瞧。。。。成功了

您确定安装了jdk以便JBoss可以编译JSP吗?(不确定这是什么原因)Tomcat+JBoss不再使用javac来编译JSP了,他们在内部这么做了——是的,没错,JBoss捆绑了Tomcat 5.5。我错误地认为它是Tomcat 5.0。感谢您指出这一点。我确实将JDK1.5安装为java_home。不知道为什么jboss不能编译JSPsJboss正在按原样将JSP直接提供给浏览器。浏览器试图将其解释为XML(出于其自身的原因),但您在某些地方配置了JBoss,使其不将此文件视为JSP。您可以发布您的
web.xml
,以及JSP页面源代码吗?谢谢!我确实发现了一个地方jbossweb-tomcat55.sar/conf/xml说“取消注释以使用jdk1.5”,I uncomment it since Iam使用JDK1.5.0
   <html><head><title>JSP Test</title> 
   <%! 
   String message = "Hello, World."; 
   %> 
   </head> 
   <body> 
   <h2><%= message%></h2> 
   <%= new java.util.Date() %> 
   </body></html>