Closed quintesse closed 10 years ago
PS: the http server I used for this example was just something simple I was running from a module repository:
python -m SimpleHTTPServer
On a Linux system this should probably work out of the box.
With a default read-only Apache server I get:
../ceylon-dist/dist/bin/ceylon compile --out http://localhost --src test/src test/src/com/redhat/ceylon/compiler/java/test/issues/bug13xx/Bug1364.ceylon
error: Failed to write module to repository: com.redhat.ceylon.cmr.impl.CMRException: Unexpected response: Method Not Allowed 405
ceylon compile: There was 1 error
Which looks acceptable, if a bit unfriendly.
If I try with the python server, it crashes the python server by making it hang and unresponsive even to Ctrl-c
after it prints:
127.0.0.1 - - [21/Oct/2013 12:00:04] code 404, message File not found
127.0.0.1 - - [21/Oct/2013 12:00:04] "HEAD /com/redhat/ceylon/compiler/java/test/issues/1/com.redhat.ceylon.compiler.java.test.issues-1.car HTTP/1.1" 404 -
127.0.0.1 - - [21/Oct/2013 12:00:04] code 404, message File not found
127.0.0.1 - - [21/Oct/2013 12:00:04] "HEAD /com/redhat/ceylon/compiler/java/test/issues/1/com.redhat.ceylon.compiler.java.test.issues-1.jar HTTP/1.1" 404 -
127.0.0.1 - - [21/Oct/2013 12:00:05] code 404, message File not found
127.0.0.1 - - [21/Oct/2013 12:00:05] "HEAD /com/redhat/ceylon/compiler/java/test/issues/1/com.redhat.ceylon.compiler.java.test.issues-1.src HTTP/1.1" 404 -
127.0.0.1 - - [21/Oct/2013 12:00:05] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [21/Oct/2013 12:00:05] "OPTIONS ?version=2 HTTP/1.1" 501 -
It seems to also hang the compiler which is probably waiting for an answer, and waits for a timeout.
There's no timeout, which is an issue in itself.
We're stuck at:
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
at com.googlecode.sardine.impl.SardineImpl.execute(SardineImpl.java:691)
at com.googlecode.sardine.impl.SardineImpl.exists(SardineImpl.java:672)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:167)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.mkdirs(WebDAVContentStore.java:164)
at com.redhat.ceylon.cmr.webdav.WebDAVContentStore.putContent(WebDAVContentStore.java:126)
at com.redhat.ceylon.cmr.impl.DefaultNode.addNode(DefaultNode.java:127)
at com.redhat.ceylon.cmr.impl.DefaultNode.addContent(DefaultNode.java:105)
at com.redhat.ceylon.cmr.impl.AbstractNodeRepositoryManager.putArtifact(AbstractNodeRepositoryManager.java:131)
at com.redhat.ceylon.cmr.impl.CachingRepositoryManager.putArtifact(CachingRepositoryManager.java:104)
at com.redhat.ceylon.cmr.api.AbstractRepositoryManager.putArtifact(AbstractRepositoryManager.java:109)
at com.redhat.ceylon.cmr.util.JarUtils.finishUpdatingJar(JarUtils.java:58)
at com.redhat.ceylon.cmr.impl.SourceArchiveCreatorImpl.copySourceFiles(SourceArchiveCreatorImpl.java:69)
at com.redhat.ceylon.compiler.java.tools.JarOutputRepositoryManager$ProgressiveJar.close(JarOutputRepositoryManager.java:145)
at com.redhat.ceylon.compiler.java.tools.JarOutputRepositoryManager.flush(JarOutputRepositoryManager.java:81)
at com.redhat.ceylon.compiler.java.tools.CeyloncFileManager.flush(CeyloncFileManager.java:220)
at com.sun.tools.javac.main.JavaCompiler.close(JavaCompiler.java:1577)
at com.sun.tools.javac.main.JavaCompiler.close(JavaCompiler.java:1551)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:830)
at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:623)
at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:540)
at com.redhat.ceylon.compiler.java.launcher.Main.compile(Main.java:530)
at com.redhat.ceylon.compiler.CeylonCompileTool.run(CeylonCompileTool.java:373)
at com.redhat.ceylon.tools.CeylonTool.run(CeylonTool.java:323)
at com.redhat.ceylon.tools.CeylonTool.execute(CeylonTool.java:271)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:86)
at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:21)
Forever. We need to add a timeout, but this is a CMR issue.
Logged in ceylon/ceylon-module-resolver#80
So why do you get an exception and not me then?
Right now I can't reproduce it anymore either. Don't like that much, but hey it's one less issue.
If you do
ceylon compile --out http://localhost:8000 testmodule
you get the following error: