Search code examples
activewebjavalite

An activeweb-bootstrap can not find controller


I dowloaded the ActiveWeb Bootstrap project from gtihub and have troubles with it.

First, it was imposssible to import it into Eclipse so I executed mvn eclipse:eclipse and then imported the project into eclipse and converted it to maven.

Then I started jetty server from Eclipse and I got an error with path http://localhost:8080/activeweb-bootstrap/

URI Full Path: /activeweb-bootstrap/
URI Path: /activeweb-bootstrap/
Method: GET

org.javalite.activeweb.ClassLoadException: java.lang.ClassNotFoundException: app.controllers.ActivewebBootstrapController
    at org.javalite.activeweb.DynamicClassFactory.getCompiledClass(DynamicClassFactory.java:62)
    at org.javalite.activeweb.DynamicClassFactory.createInstance(DynamicClassFactory.java:23)
    at org.javalite.activeweb.ControllerFactory.createControllerInstance(ControllerFactory.java:27)
    at org.javalite.activeweb.Router.recognize(Router.java:80)
    at org.javal

I was able to run this project properly only when export it as war file. Why I get this error if start the project with Jetty from Eclipse?

updated:

62406 [qtp31348584-11] WARN org.javalite.activeweb.RequestDispatcher - ActiveWeb 404 WARNING: 
Request URL: http://localhost:8080/activeweb-bootstrap/
ContextPath: 
Query String: null
URI Full Path: /activeweb-bootstrap/
URI Path: /activeweb-bootstrap/
Method: GET
org.javalite.activeweb.ClassLoadException: java.lang.ClassNotFoundException: app.controllers.ActivewebBootstrapController
62406 [qtp31348584-11] WARN org.javalite.activeweb.ParamCopy - found 'session' value set by controller. It is reserved by ActiveWeb and will be overwritten.
62438 [qtp31348584-11] INFO org.javalite.activeweb.freemarker.FreeMarkerTemplateManager - Rendered template: '/system/404' with layout: '/layouts/default_layout'

Solution

  • Apparently this example had an old version of a dependency. Please, clone and try again. It is fixed already.

    ANSWER UPDATE:

    The link on the README.md file was incorrect. The project is mapped to root, so instead of accessing http://localhost:8080/activeweb-bootstrap/, you need to access:

    http://localhost:8080/.

    The README.md file was updated accordingly: https://github.com/javalite/activeweb-bootstrap

    The message you are getting:

    org.javalite.activeweb.ClassLoadException: java.lang.ClassNotFoundException: app.controllers.ActivewebBootstrapController

    is perfectly valid, since the framework is trying to interpret your URI: "activeweb-bootstrap" as a route to controller app.controllers.ActivewebBootstrapController.

    Such controller does not exist, so you get a 404.