Struts 2 Jquery 插件需要互联网连接
我正在使用 struts2-jquery 插件。它需要互联网连接。只要我有互联网连接,它就可以完美地工作。每当我尝试在没有互联网连接的情况下运行我的项目时,就会发生以下错误
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_26\bin;F:\java\apache-ant-1.8.2\bin;F:\java\apache-cxf-2.4.2\bin;F:\eclipse-jee-indigo-win32\eclipse;;.
Jan 2, 2012 3:01:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-80"]
Jan 2, 2012 3:01:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 653 ms
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.19
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor airtel.xml from F:\java\eclipsework\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:airtel' did not find a matching property.
log4j:WARN No appenders could be found for logger (org.apache.tiles.context.AbstractTilesApplicationContextFactory).
log4j:WARN Please initialize the log4j system properly.
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4584)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5262)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5257)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: Unable to load jar:file:/F:/java/eclipsework/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/airtel/WEB-INF/lib/struts2-jquery-plugin-3.2.0.jar!/struts-plugin.xml - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:890)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:144)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:164)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 15 more
Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:885)
... 19 more
Caused by: java.net.UnknownHostException: struts.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
... 20 more
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/airtel] startup failed due to previous errors
Jan 2, 2012 3:01:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-80"]
Jan 2, 2012 3:01:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 2, 2012 3:01:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1221 ms
I am using struts2-jquery pluglin. it requires internet connection. It works perfectly whenever i have internet connection. Following errors occures whenever i am trying to run my project without internet connection
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_26\bin;F:\java\apache-ant-1.8.2\bin;F:\java\apache-cxf-2.4.2\bin;F:\eclipse-jee-indigo-win32\eclipse;;.
Jan 2, 2012 3:01:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-80"]
Jan 2, 2012 3:01:25 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 653 ms
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 2, 2012 3:01:25 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.19
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor airtel.xml from F:\java\eclipsework\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost
Jan 2, 2012 3:01:25 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:airtel' did not find a matching property.
log4j:WARN No appenders could be found for logger (org.apache.tiles.context.AbstractTilesApplicationContextFactory).
log4j:WARN Please initialize the log4j system properly.
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4584)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5262)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5257)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: Unable to load jar:file:/F:/java/eclipsework/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/airtel/WEB-INF/lib/struts2-jquery-plugin-3.2.0.jar!/struts-plugin.xml - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:890)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:144)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:164)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 15 more
Caused by: struts.apache.org - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 195 - java/net/PlainSocketImpl.java:195:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:885)
... 19 more
Caused by: java.net.UnknownHostException: struts.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1282)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1090)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
... 20 more
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Jan 2, 2012 3:01:26 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/airtel] startup failed due to previous errors
Jan 2, 2012 3:01:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-80"]
Jan 2, 2012 3:01:26 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 2, 2012 3:01:26 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1221 ms
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Commenters:我不明白你为什么不把这个作为答案。
通常 jQuery 插件不需要互联网连接,它应该可以在本地正常工作,除非您在
中设置了属性loadFromGoogle="true"
HTML 代码所在的 JSP 标记。如果您这样做,
会被转换为 HTML 代码,并带有指向 Google 服务器上文件的,这仅在以下情况下才有效:您有互联网连接。
如果这不是问题,我只能想象另外两个。
1)我从来没有见过这一行,而且我也在Eclipse中的Tomcat 7中进行开发(尽管到目前为止我没有使用Tomcat的更新19):
警告:[SetContextPropertiesRule] {Context}设置属性' source' 到 'org.eclipse.jst.j2ee.server:airtel' 没有找到匹配的属性。
但我不认为这是问题所在。2) 您在 servlet 中拥有尝试连接到互联网资源的业务逻辑,这可能不起作用;因为异常是在万无一失的 JRE 类中抛出的,所以它不应该失败。
@Commenters: I don't understand why you don't put this in as an answer.
Usually the jQuery plugin doesn't need internet connection, it should work locally without problems unless you have set the attribute
loadFromGoogle="true"
in the<sj:head>
tag of the JSP in which your HTML code resides. If you did so, the<sj:head>
gets translated to HTML code with a<link>
to a file on a Google server, which will only work if you have an internet connection.If this isn't the problem, I can only imagine two more.
1) I've never seen this line, and I also develop in a Tomcat 7 in Eclipse (even though I didn't use update 19 of Tomcat so far):
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:airtel' did not find a matching property.
But I don't think this is the problem.2) You have business logic in a servlet that tries to connect to an internet resource, this might just not work; as the exception gets thrown in a foolproof JRE class it shouldn't fail.