-
Bug
-
Resolution: Done
-
Minor
-
1.2.3.Final
-
None
-
Workaround Exists
-
-
Low
Proxy settings not used for maven web project
When loading a maven project of "war" type the following exception occurs:
Error during Startup event org.jboss.shrinkwrap.descriptor.api.DescriptorImportException: Could not import XML from stream at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDomNodeImporterImpl.importAsNode(XmlDomNodeImporterImpl.java:76) at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDomNodeImporter.importAsNode(XmlDomNodeImporter.java:46) at org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptorImporterBase.from(NodeDescriptorImporterBase.java:72) at org.jboss.shrinkwrap.descriptor.spi.DescriptorImporterBase.from(DescriptorImporterBase.java:142) at org.jboss.forge.spec.javaee.servlet.ServletFacetImpl.getConfig(ServletFacetImpl.java:95) at org.jboss.forge.spec.javaee.jsf.FacesFacetImpl.isInstalled(FacesFacetImpl.java:71) at org.jboss.forge.project.BaseProject.registerFacet(BaseProject.java:153) at org.jboss.forge.project.services.ProjectFactory.registerSingleFacet(ProjectFactory.java:208) at org.jboss.forge.project.services.ProjectFactory.registerSingleFacet(ProjectFactory.java:186) at org.jboss.forge.project.services.ProjectFactory.registerFacets(ProjectFactory.java:178) at org.jboss.forge.project.services.ProjectFactory.findProjectRecursively(ProjectFactory.java:117) at org.jboss.forge.shell.project.ProjectInitializer.doInit(ProjectInitializer.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188) at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234) at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635) at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:628) at org.jboss.weld.event.EventImpl.fire(EventImpl.java:75) at org.jboss.forge.shell.project.CurrentProject.setCurrentResource(CurrentProject.java:79) at org.jboss.forge.shell.ShellImpl.init(ShellImpl.java:376) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.init(ShellImpl$Proxy$_$$_WeldClientProxy.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188) at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234) at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635) at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622) at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616) at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:167) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) 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:395) at sun.net.www.http.HttpClient.openServer(HttpClient.java:530) at sun.net.www.http.HttpClient.<init>(HttpClient.java:234) at sun.net.www.http.HttpClient.New(HttpClient.java:307) at sun.net.www.http.HttpClient.New(HttpClient.java:324) 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.DOMParser.parse(DOMParser.java:235) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDomNodeImporterImpl.importAsNode(XmlDomNodeImporterImpl.java:67) ... 56 more
It is because the parser try to connect to http://java.sun.com:80 to parse the web.xml file but the proxy settings in forge config.xml is not used:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <configuration> <proxy> <host>my.proxy.com</host> <port>80</port> </proxy> <forge> <analytics> <enabled>false</enabled> </analytics> </forge> </configuration>
A workaround is to set the FORGE_OPTS to use sun default proxy: -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=80
But it would be better to set the proxy as it is done in https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/plugins/builtin/ForgePlugin.java#L527