Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329683

Summary: [AntlrGeneratorFragment] Allow configuration of proxy
Product: [Modeling] TMF Reporter: Stephan Herrmann <stephan.herrmann>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: baerrach, btickets, jan, jason.schlachter, moritz.eysholdt, sbouchet, sven.efftinge
Version: 1.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Stephan Herrmann CLA 2010-11-08 11:03:06 EST
XText kindly asks me if it may download antlr-generator-3.0.1.jar
but after I answered 'y' it (repeatedly) failed with this stack trace:

*ATTENTION*
It is recommended to use the ANTLR 3 parser generator (BSD licence - http://www.antlr.org/license.html).
Do you agree to download it (size 1MB) from 'http://download.itemis.com/antlr-generator-3.0.1.jar'? (type 'y' or 'n' and hit enter)y
12577 [main] INFO  erator.parser.antlr.AntlrToolFacade  - downloading file from 'http://download.itemis.com/antlr-generator-3.0.1.jar' ...
33670 [main] ERROR erator.parser.antlr.AntlrToolFacade  - Connection timed out: connect
java.net.ConnectException: Connection timed out: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	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:860)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
	at java.net.URL.openStream(URL.java:1010)
	at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.download(AntlrToolFacade.java:92)
	at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.getToolClass(AntlrToolFacade.java:51)
	at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.isWorkable(AntlrToolFacade.java:134)
	at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.checkConfiguration(AbstractAntlrGeneratorFragment.java:42)
	at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.checkConfiguration(XtextAntlrGeneratorFragment.java:52)
	at org.eclipse.xtext.generator.CompositeGeneratorFragment.checkConfiguration(CompositeGeneratorFragment.java:211)
	at org.eclipse.xtext.generator.LanguageConfig.checkConfiguration(LanguageConfig.java:74)
	at org.eclipse.xtext.generator.Generator.checkConfigurationInternal(Generator.java:83)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2.checkConfiguration(AbstractWorkflowComponent2.java:21)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.preInvoke(Mwe2Bridge.java:65)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.preInvoke(AbstractWorkflowComponent.java:197)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:25)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:18)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:80)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)

Downloading the file from the browser works and also a p2 install from
http://download.itemis.com/updates works. My wild guess is that the above
chall chain might not use the configured proxy for http:
Comment 1 Stephan Herrmann CLA 2011-08-08 11:15:00 EDT
Still happena using the Indigo release.
Any ideas?
Comment 2 Sven Efftinge CLA 2011-08-08 13:19:54 EDT
You might want to use the update site from itemis (http://download.itemis.com/updates/), which contains the needed bundle.
IF it's there the workflow doesn't try to download it.
Comment 3 Stephan Herrmann CLA 2011-08-08 16:56:49 EDT
(In reply to comment #2)
> You might want to use the update site from itemis
> (http://download.itemis.com/updates/), which contains the needed bundle.
> IF it's there the workflow doesn't try to download it.

Thanks, yes that works:

(In reply to comment #0)
> Downloading the file from the browser works and also a p2 install from
> http://download.itemis.com/updates works. My wild guess is that the above
> call chain might not use the configured proxy for http:

But wouldn't it be nice if the advertized way by simply saying 'y' would
work even behind a firewall? :)
Comment 4 Barrie Treloar CLA 2012-11-05 22:36:45 EST
http://www.eclipse.org/Xtext/download.html says you can also install the "Xtext Antlr-2.0.0" plugin from http://download.itemis.de/updates/ but the only ones there are named "Xtext Antlr Runtime Feature 2.0.0v201108011202" and "Xtext Antlr SDK Feature 2.0.0v201108011202"

I'm not sure which one solved my problem, I just installed both.

==================
Other failed options described below:

I think XText is a stand alone application org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher it is not picking up either the Proxy settings in Eclipse Properties, or the eclipse.ini values for 

-vmargs
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors= org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttp.proxyHost=*myproxyhost*
-Dhttp.proxyPort=*myproxyport*
-Dhttp.proxyUser=*proxy username*
-Dhttp.proxyPassword=*proxy password*
-Dhttp.nonProxyHosts=localhost|127.0.0.1

I can't find the documentation on the website http://www.eclipse.org/Xtext/ or in the PDF that describes what the manual procedure would be for installing http://download.itemis.com/antlr-generator-3.2.0.jar (which looks like a plain jar and not an eclipse plugin)

The best I can find is http://sourceforge.net/p/hastee/git/ci/c6973b70150da9eafb58a5c2f71c3f9bbc231155/tree/

Which looks suspiciously like notes I wrote, yay google!

Or http://quidecco.com/cgi-bin/cgi_ref_by_path/referer/http_3a_2f_2fwww.eclipse.org_2fforums_2f/url/http_3a_2f_2fwww.eclipse.org_2fforums_2findex.php_2fm_2f896199_2f/ which says to copy the jar into your project root but named .antlr-generator-3.2.0.jar  (not the . as a prefix)
Comment 5 Sven Efftinge CLA 2012-11-19 08:39:27 EST
We should update the information on the website accordingly and also give the user a hint when the automatic download fails.
Comment 6 Jan Koehnlein CLA 2012-12-05 03:00:02 EST
Yes, MWE workflows are run in separate JVMs. 

Eclipse stores the proxy settings in the System.getProperties(). Copying the proxy settings to the launch config does not seem to be a viable solution: 
- it is hard to make a durable decision which are the important ones, e.g. 
the 'excludeContributors' stuff from ECF looks more like a workround
- we generate some persisted launch configs for each language, which would not be updated automatically on changes in the settings
- we'd have to parse existing vmargs in launch configs in order not to override settings.

I've improved the error messages. Website changes are still to be done.
Comment 7 Bouchet Stéphane CLA 2014-04-09 04:14:50 EDT
(In reply to Jan Koehnlein from comment #6)

hi, i've been stuck on the same problem today with this error.


> Yes, MWE workflows are run in separate JVMs. 
> 
> - we'd have to parse existing vmargs in launch configs in order not to
> override settings.
> 

What i did to resolve this is to modify mannually the launch config created by Xtext, adding manually the prxy settings to the VM arguments tab. 
I think your message should point to this possible solution. I know i am behind a firewall and i can make the adjustments myself.
Comment 8 Sven Efftinge CLA 2014-04-09 08:12:59 EDT
We should enhance the generator fragment to accept proxy settings
Comment 9 jason schlachter CLA 2016-04-22 16:49:17 EDT
I'm encountering a similar issue where XText fails due to proxy issues in Eclipse 4.5.2 on a Mac w/ Yosemite. Is this issue related? 

!ENTRY org.eclipse.core.net 1 0 2016-04-22 16:47:26.574
!MESSAGE System property https.proxyPort has been set to 3128 by an external source. This value will be overwritten using the values from the preferences
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://547.fwk2022316086:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://547.fwk2022316086:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

!ENTRY org.eclipse.epp.logging.aeri.ide 2 16 2016-04-22 16:47:31.973
!MESSAGE Server ‘org.eclipse.epp.logging.aeri.ide.server’ failed with exception: Connect to dev.eclipse.org:443 [dev.eclipse.org/198.41.30.200] failed: connect timed out. ; version: 1.100.0.v20160217-0435
!STACK 0
org.apache.http.conn.ConnectTimeoutException: Connect to dev.eclipse.org:443 [dev.eclipse.org/198.41.30.200] failed: connect timed out
	at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:134)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
Comment 10 Sven Efftinge CLA 2016-04-22 18:19:17 EDT
No that is unrelated. The missing stackframes might tell you which component tries to call home.