在本地计算机上运行的 Web 应用程序

发布于 2024-10-14 18:34:48 字数 5268 浏览 3 评论 0原文

开发 Web 应用程序:

Ide:Eclipse helios。 使用的jdk:1.6 struts框架工作:1.2 服务器:jboss 4.0

项目在本地主机端口号8080中运行。

即,url是: http://localhost:8080/mfirst

在有互联网连接的情况下它可以正常工作。如果我拔掉互联网连接,它会抛出错误“无法找到操作映射和操作表单类”。

我的所有 tld 和 jar 文件仅引用本地位置。

请任何机构提供帮助。

在 JSP 页面中:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:21

**LINE 21 IS:**



21: html:form  name="loginForm" type="com.product.form.loginform" action="/Login.do" onsubmit="return Validatelogin(this);"

在控制台显示

...........
16:28:09,031 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
16:28:09,109 ERROR [ActionServlet] Parsing error processing resource path 
java.net.UnknownHostException: struts.apache.org
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source).
at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1572)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
    at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.apache.catalina.core.StandardContext.init(StandardContext.java:5116)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
.
.
.
.
16:28:19,046 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
16:28:19,046 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
16:28:19,046 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:181)

developing web application :

Ide : Eclipse helios.
jdk used: 1.6
struts frame work: 1.2
server : jboss 4.0

project runs in localhost port number 8080.

i.e, url is: http://localhost:8080/mfirst

it works fine in presense of internet connection. If i unplug internet connection it throws error canot find action mapping and action form class.

all my tld's and jar files are refering the local location only..

any body help please..

IN JSP PAGE:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:21

**LINE 21 IS:**



21: html:form  name="loginForm" type="com.product.form.loginform" action="/Login.do" onsubmit="return Validatelogin(this);"

IN CONSOLE IT SHOWS

...........
16:28:09,031 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
16:28:09,109 ERROR [ActionServlet] Parsing error processing resource path 
java.net.UnknownHostException: struts.apache.org
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source).
at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1572)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
    at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
    at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    at org.apache.catalina.core.StandardContext.init(StandardContext.java:5116)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
.
.
.
.
16:28:19,046 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
16:28:19,046 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
16:28:19,046 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:181)

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

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

发布评论

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

评论(4

迷鸟归林 2024-10-21 18:34:48

您正在使用的某些 xml 配置文件可能包含对 DTD 的过时引用,这些 DTD 不再分发在您正在使用的 jar 中。因此 xml 解析器尝试通过网络解析这些内容。

最近在 hibernate 中也发生了,我发现是因为应用程序需要额外 5 秒才能启动。

There is a possibility that some of the xml configuration files you are using contain out of date references to DTDs which are no longer distributed in the jars you are using. Therefore the xml parser is trying to resolve those over the network.

This has recently happened in hibernate as well and I found out becase the application required an extra 5 seconds to start up.

街道布景 2024-10-21 18:34:48

您的堆栈跟踪讲述了整个故事:

解析错误处理资源路径
java.net.UnknownHostException:
struts.apache.org 位于
java.net.PlainSocketImpl.connect(未知
来源)位于
java.net.SocksSocketImpl.connect(未知
来源)位于
java.net.Socket.connect(未知
来源)位于
java.net.Socket.connect(未知
来源)。在
sun.net.NetworkClient.doConnect(未知
来源)位于
sun.net.www.http.HttpClient.openServer(未知
来源)位于
sun.net.www.http.HttpClient.openServer(未知
来源)位于
sun.net.www.http.HttpClient。(未知
来源)位于
sun.net.www.http.HttpClient.New(未知
来源)位于
sun.net.www.http.HttpClient.New(未知
来源)位于
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(未知
来源)位于
sun.net.www.protocol.http.HttpURLConnection.plainConnect(未知
来源)位于
sun.net.www.protocol.http.HttpURLConnection.connect(未知
来源)位于
sun.net.www.protocol.http.HttpURLConnection.getInputStream(未知
来源)位于
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(未知
来源)位于
org.apache.xerces.impl.XMLEntityManager.startEntity(未知
来源)位于
org.apache.xerces.impl.XMLEntityManager.startDTDEntity(未知
来源)位于
org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(未知
来源)位于
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(未知
来源)位于
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(未知
来源)位于

您的应用程序正在尝试连接到 struts.apache.org,因为 XMLEntityManager 正在尝试使用 HttpURLConnection 连接到此站点。

解决方案:下载您缺少的 DTD,并将其添加到应用程序的路径中,以便可以在本地找到它。

Your stack trace tells the entire story:

Parsing error processing resource path
java.net.UnknownHostException:
struts.apache.org at
java.net.PlainSocketImpl.connect(Unknown
Source) at
java.net.SocksSocketImpl.connect(Unknown
Source) at
java.net.Socket.connect(Unknown
Source) at
java.net.Socket.connect(Unknown
Source). at
sun.net.NetworkClient.doConnect(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source) at
org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source) at
org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source) at
org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source) at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source) at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source) at

Your application is trying to connect to struts.apache.org since the XMLEntityManager is trying to connect to this site using HttpURLConnection.

Solution: download the DTD you're missing and add it to your application's path so it can be locally found.

女皇必胜 2024-10-21 18:34:48

即使我也有同样的问题。经过彻底分析,我发现我的 WEB-INF/lib 文件夹中有多个版本的 struts jar。删除我不需要的版本后,问题就解决了。

Even I had the same problem. After thorough analysis I found that I have multiple versions of the struts jar in my WEB-INF/lib folder. After removing the version I didn't require, it solved the problem.

我家小可爱 2024-10-21 18:34:48

在 struts 配置文件中搜索“struts.apache.org”的引用,如果发现任何内容,请在从 struts 下载 xsd 后将其替换为本地位置

Search for reference of "struts.apache.org" in your struts configuration files, if you find any replace it with your local location after downloading the xsd's from struts

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