My project compiles fine in IntelliJ, it is a simple spring-mvc written in scala.
I get this error when I run it using tomcat:
java.lang.NoClassDefFoundError: org/example/houses/SomeClassNameHere
The above isn't the exact name of my library.
My controller looks like:
package com.example.scalacms.web.controllers
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.{ResponseBody, RequestMapping}
import org.example.house
@Controller
class HomeController {
var houses: Houses = _
@RequestMapping(Array("/"))
@ResponseBody
def index: String = {
"hello, world!"
}
}
I'm confused because it compiles fine in IntelliJ, it picks up all my classes in intellisense etc.
Could it be that tomcat doesn't have the library in my classpath? I am using an exploded artifact.
I can't see the classpath anywhere in the output windows so I cannot confirm.
Update
So I looked in the /out/artifacts/myapp_web_war_exploded/WEB-INF/lib
and I don't see the jar file there. Why is the jar not being included in the deployment? What should I do to have it included in intellij?