ModelResolutionException with vert.x

已查看 58 次
跳至第一个未读帖子

Lucien Garin

未读,
2016年5月21日 08:41:242016/5/21
收件人 ceylon-users
I've written a very simple verticle using vert.x 3.2.2 and celyon 1.2.2 and I get the following error at runtime:
com.redhat.ceylon.model.loader.ModelResolutionException: Failed to load declaration [ReflectionClass: class io.vertx.ceylon.web.RoutingContext]: Failed to load methods in io.vertx.ceylon.web.RoutingContext

In order to reproduce this issue, you can use the following code:

import io.vertx.ceylon.core { Verticle, vertxFactory = vertx }
import io.vertx.ceylon.web { routerFactory = router, RoutingContext }
import io.vertx.ceylon.web.handler { loggerHandler }
import ceylon.language.meta.declaration { Module }

shared class HttpServerVerticle() extends Verticle() {
   
    void requestHandler(RoutingContext routingContext) {
        value response = routingContext.response();
        response.putHeader("content-type", "text/plain");
        response.end("Hello World");
    }
   
    shared actual void start() {
        value router = routerFactory.router(vertx);
        router.get().handler(loggerHandler.create().handle);
        router.get("/").handler(requestHandler);
        value server = vertx.createHttpServer();
        server.requestHandler(router.accept).listen(8080);
    }
}

void runModuleVerticle(Module mod) {
    value container = vertxFactory.vertx();
    container.deployVerticle("ceylon:``mod.name``/``mod.version``", (String|Throwable ar) {
        if (is String ar) {
            print("Deployed ``mod.name``");
        } else {
            print("``mod.name`` deploy failure:");
            ar.printStackTrace();
        }
    });
}

shared void run() {
    runModuleVerticle(`module`);
}



In order to fix this issue, I must inline the request handler definition:
        ...
        router.get("/").handler {
            void requestHandler(RoutingContext routingContext) {
                value response = routingContext.response();
                response.putHeader("content-type", "text/plain");
                response.end("Hello World");
            }
        };
        ...

The issue 4558 looks very similar to this problem, but this issue has been closed. What am I doing wrong?

I really appreciate any help you can provide.

Lucien

Alex Aguinore

未读,
2016年8月22日 05:58:082016/8/22
收件人 ceylon-users
Hello!

I have the same issue when I run vertx project from Eclipse. There are two strange facts: first, the project runs from console without any problem, second, the project ran without problem about a month ago, when I last worked with it. There were little changes made by my cooleagues, but still I can't understand why Eclipse can't run it.

Stephane Epardaud

未读,
2016年8月22日 06:02:592016/8/22
收件人 ceylon...@googlegroups.com
That's weird because in theory Eclipse and the CLI use the same JBoss Modules runner. Can you report a bug in the Eclipse IDE with a test case we can use?

Thanks, cheers.

On 22 August 2016 at 11:58, Alex Aguinore <agui...@gmail.com> wrote:
Hello!

I have the same issue when I run vertx project from Eclipse. There are two strange facts: first, the project runs from console without any problem, second, the project ran without problem about a month ago, when I last worked with it. There were little changes made by my cooleagues, but still I can't understand why Eclipse can't run it.

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/074f6db9-fdec-4294-a59f-86cbee309272%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Stephane Epardaud

未读,
2016年8月22日 06:03:392016/8/22
收件人 ceylon...@googlegroups.com
Hi,

Sorry for the late answer, I must have missed that mail. Do you still have that issue?

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Alex Aguinore

未读,
2016年8月22日 07:29:122016/8/22
收件人 ceylon-users


On Monday, August 22, 2016 at 1:02:59 PM UTC+3, Stéphane Épardaud wrote:
That's weird because in theory Eclipse and the CLI use the same JBoss Modules runner. Can you report a bug in the Eclipse IDE with a test case we can use?

Thanks, cheers.

--
Stéphane Épardaud

Alex Aguinore

未读,
2016年8月22日 08:32:352016/8/22
收件人 ceylon-users
I made a mistake: vertx run ceylon:my.module/1.0.0 works from CLI, but ceylon run my.module/1.0.0 throws error described above.

Stephane Epardaud

未读,
2016年8月22日 08:40:032016/8/22
收件人 ceylon...@googlegroups.com
Thanks

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Stephane Epardaud

未读,
2016年8月22日 08:41:142016/8/22
收件人 ceylon...@googlegroups.com
Oh, then that is another story, can you close your issue and reopen it on https://github.com/ceylon/ceylon/issues/new please? Thanks!

On 22 August 2016 at 14:32, Alex Aguinore <agui...@gmail.com> wrote:
I made a mistake: vertx run ceylon:my.module/1.0.0 works from CLI, but ceylon run my.module/1.0.0 throws error described above.

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Alex Aguinore

未读,
2016年8月22日 09:09:502016/8/22
收件人 ceylon-users
sorry for misleading, new issue: https://github.com/ceylon/ceylon/issues/6442


On Monday, August 22, 2016 at 3:41:14 PM UTC+3, Stéphane Épardaud wrote:
Oh, then that is another story, can you close your issue and reopen it on https://github.com/ceylon/ceylon/issues/new please? Thanks!

--
Stéphane Épardaud

Stephane Epardaud

未读,
2016年8月22日 09:10:502016/8/22
收件人 ceylon...@googlegroups.com
NP, thanks.

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users+unsubscribe@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud
回复全部
回复作者
转发
0 个新帖子