Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configured class: com.foo.reportListener.handler.SpecYamlGetHandler has not been found #61

Closed
farrukhnajmi opened this issue Oct 26, 2018 · 4 comments

Comments

@farrukhnajmi
Copy link

Using latest master 9dc732f27a46692275ac79a539f3a80b4bbcb05d of lite-codegen I generated a project.

  1. I build it fine with mvn install
  2. I run it mvn exec:exec with no change I get the following exception:
19:25:32.562 [main] com.foo.report-listener-1.0.1  ERROR com.networknt.server.Server main - Server is not operational! Failed with exception
java.lang.RuntimeException: Configured class: com.foo.reportListener.handler.SpecYamlGetHandler has not been found
        at com.networknt.handler.Handler.splitClassAndName(Handler.java:445)
        at com.networknt.handler.Handler.initStringDefinedHandler(Handler.java:359)
        at com.networknt.handler.Handler.initHandlers(Handler.java:71)
        at com.networknt.handler.Handler.init(Handler.java:53)
        at com.networknt.server.Server.start(Server.java:151)
        at com.networknt.server.Server.main(Server.java:123)
@miklish
Copy link
Contributor

miklish commented Oct 27, 2018

Did you include com.foo.reportListener.handler.SpecYamlGetHandler in handler.yml? You need to specify all handler classes in handler.yml so the Dependency Injector can load it during startup.

@farrukhnajmi
Copy link
Author

farrukhnajmi commented Oct 27, 2018

Yes its in there, I am simply running the project as generated with no code changes by me.
Perhaps there is something wrong with the config.json or openapi.yaml I ran it with? Any hints I can chase down?

This is what I added to openapi.yaml:

paths:
  /spec.yaml:
    get:
      exec: spec

  /specui.html:
    get:
      exec: swaggerui

@stevehu
Copy link
Contributor

stevehu commented Oct 27, 2018

@farrukhnajmi I have tried to compile and start the latest https://github.com/networknt/light-example-4j/tree/master/rest/openapi/petstore without any issue. Also, is this class SpecYamlGetHandler your own? I cannot find any reference from our source code.

@farrukhnajmi
Copy link
Author

It seems that my adding the following in my openapi.yaml caused the problem:

paths:
  /spec.yaml:
    get:
      exec: spec

  /specui.html:
    get:
      exec: swaggerui

I did this based on the possibly incorrect or misleading docs at:

https://doc.networknt.com/style/light-rest-4j/openapi-display/#path-for-specification-display

When I take it out all is well. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants