This discussion is archived
2 Replies Latest reply: Oct 31, 2012 7:23 AM by gimbal2 RSS

perplexing compilation errors with latest org.restlet.jar

965904 Newbie
Currently Being Moderated
When compiling with the latest org.restlet.jar I am get some perplexing error messages. They just don't make sense according to definitions in the source code


ContactComponent.java:79: error: method setInternalRouter in class Component can
not be applied to given types;
setInternalRouter(router);
^
required: org.restlet.Router
found: org.restlet.routing.Router
reason: actual argument org.restlet.routing.Router cannot be converted to org.
restlet.Router by method invocation conversion

// Component includes reference to import org.restlet.routing.Router;


ContactComponent.java:82: error: no suitable method found for add(org.restlet.ro
uting.VirtualHost)
getHosts().add(host);
^
method List.add(int,org.restlet.VirtualHost) is not applicable
(actual and formal argument lists differ in length)
method List.add(org.restlet.VirtualHost) is not applicable
(actual argument org.restlet.routing.VirtualHost cannot be converted to or
g.restlet.VirtualHost by method invocation conversion)

// Component includes reference to import org.restlet.routing.VirtualHost;


ContactComponent.java:117: error: incompatible types
org.restlet.routing.Router router = getInternalRouter();
^
required: org.restlet.routing.Router
found: org.restlet.Router

// Component includes references to import org.restlet.routing.Router



ContactComponent.java:139: error: no suitable method found for handle(org.restle
t.Request,org.restlet.Response)
super.handle(request, response);
^
method Component.handle(org.restlet.data.Request,org.restlet.data.Response)
is not applicable
(actual argument org.restlet.Request cannot be converted to org.restlet.da
ta.Request by method invocation conversion)
method Uniform.handle(org.restlet.data.Request) is not applicable
(actual and formal argument lists differ in length)

// there is no such thing as org.restlet.data.Request


thank you for any insight
  • 1. Re: perplexing compilation errors with latest org.restlet.jar
    Kayaman Guru
    Currently Being Moderated
    gilbertoblue wrote:
    They just don't make sense according to definitions in the source code
    To me they seem to make a lot of sense. Assuming that backwards compatibility has been broken.
    ContactComponent.java:79: error: method setInternalRouter in class Component can
    not be applied to given types;
    setInternalRouter(router);
    ^
    required: org.restlet.Router
    found: org.restlet.routing.Router
    reason: actual argument org.restlet.routing.Router cannot be converted to org.
    restlet.Router by method invocation conversion
    You have two different classes there. I'm assuming that one of them is from the old version and one is from the new version. Make sure your imports are correct and that the classpath includes the right library.
    // there is no such thing as org.restlet.data.Request
    Are you sure? Check both versions of the library, I'm quite sure that the compiler knows what it's missing.
  • 2. Re: perplexing compilation errors with latest org.restlet.jar
    gimbal2 Guru
    Currently Being Moderated
    Kayaman wrote:
    ContactComponent.java:79: error: method setInternalRouter in class Component can
    not be applied to given types;
    setInternalRouter(router);
    ^
    required: org.restlet.Router
    found: org.restlet.routing.Router
    reason: actual argument org.restlet.routing.Router cannot be converted to org.
    restlet.Router by method invocation conversion
    You have two different classes there. I'm assuming that one of them is from the old version and one is from the new version. Make sure your imports are correct and that the classpath includes the right library.
    ... and only one of them. This error to me reads like both old and new version are on the classpath. The compiler is not complaining about classes not being found, its complaining about classes being incompatible.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points