I’m having a bad day today. I'm creating a new project from scratch just for some experiment. After I deployed it to the JBoss server, launch the web in web browser and realize that it takes more than a minute to load the page. The page was rendered correctly at last but the weird thing is I got
Connection time out error in the server:
12:02:51,967 SEVERE [org.primefaces.config.ConfigContainer] (http-localhost/127.0.0.1:8080-1) Could not load or parse web.xml: java.net.ConnectException: Connection timed out: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) [rt.jar:1.7.0_79]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) [rt.jar:1.7.0_79]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) [rt.jar:1.7.0_79]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_79]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) [rt.jar:1.7.0_79]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_79]
at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_79]
at java.net.Socket.connect(Socket.java:528) [rt.jar:1.7.0_79]
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) [rt.jar:1.7.0_79]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) [rt.jar:1.7.0_79]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) [rt.jar:1.7.0_79]
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) [rt.jar:1.7.0_79]
at sun.net.www.http.HttpClient.New(HttpClient.java:308) [rt.jar:1.7.0_79]
at sun.net.www.http.HttpClient.New(HttpClient.java:326) [rt.jar:1.7.0_79]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997) [rt.jar:1.7.0_79]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933) [rt.jar:1.7.0_79]
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851) [rt.jar:1.7.0_79]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301) [rt.jar:1.7.0_79]
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:986)
at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:897)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:864)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:241)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1001)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:845)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:768)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:285)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) [rt.jar:1.7.0_79]
at org.primefaces.config.ConfigContainer.initConfigFromWebXml(ConfigContainer.java:258) [primefaces-5.0.jar:5.0]
at org.primefaces.config.ConfigContainer.<init>(ConfigContainer.java:84) [primefaces-5.0.jar:5.0]
at org.primefaces.context.DefaultApplicationContext.<init>(DefaultApplicationContext.java:35) [primefaces-5.0.jar:5.0]
at org.primefaces.context.DefaultRequestContext.getApplicationContext(DefaultRequestContext.java:227) [primefaces-5.0.jar:5.0]
at org.primefaces.metadata.ComponentMetadataTransformerListener.processEvent(ComponentMetadataTransformerListener.java:40) [primefaces-5.0.jar:5.0]
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2166) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2139) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:303) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2203) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1885) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:405) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:2943) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIComponentBase$FacetsMap.put(UIComponentBase.java:2903) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIViewRoot.getComponentResources(UIViewRoot.java:1749) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:517) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at com.sun.faces.application.annotation.ResourceDependencyHandler.pushResourceToRoot(ResourceDependencyHandler.java:126) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.annotation.ResourceDependencyHandler.apply(ResourceDependencyHandler.java:107) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.annotation.AnnotationManager.applyAnnotations(AnnotationManager.java:343) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.annotation.AnnotationManager.applyComponentAnnotations(AnnotationManager.java:245) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.applyAnnotations(ApplicationImpl.java:1969) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1919) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:1163) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.createComponent(ComponentTagHandlerDelegateImpl.java:501) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:169) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:187) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:87) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:164) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:914) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.28.redhat-7.jar:2.1.28.redhat-7]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
I thought this was cause by the JBoss server, then later I found out it was actually cause by the DTD in
web.xml. This is what the piece looks like:
<!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>
...
</web-app>
This seems not right as I'm using servlet 3.0, but why does it shows 2.3? When I remove it and restart the server, everything were just fine. Somehow it is not recommended to leave it empty. As I reference to
this article, it would be best to put the piece below for Servlet 3.
<web-app id="WebApp_ID" version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
...
</web-app>
No comments:
Post a Comment