How to call a constructor expecting an interface? #1382
andrewkincaid
started this conversation in
General
Replies: 2 comments
-
Don't know the answer, but I'd provide a running example/testcase that someone can easily run and debug. If you provide that here, I can convert this discussion into an issue, cause it sounds to me something like this ought to work |
Beta Was this translation helpful? Give feedback.
0 replies
-
Examples would be great. My best guess is this is a ClassLoader issue. Perhaps the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a class
MyClass
with a constructor ofMyClass(HttpServletRequest fRequest, HttpServletResponse fResponse)
.If I pass in a
org.apache.catalina.connector.Request
object, which implementsHttpServletRequest
, forfRequest
, and I pass in aorg.apache.catalina.connector.Response
object, which implementsHttpServletResponse
, forfResponse
, I get an error:Javascript compiler exception: Java constructor for "MyClass" with arguments "org.apache.catalina.connector.Request,org.apache.catalina.connector.Response" not found.
How can I call this constructor expecting an interface with objects that implement that interface?
Beta Was this translation helpful? Give feedback.
All reactions