I am using org.eclipse.jetty.server.Server
to start jetty and deploy war.
I have something like this:
class Runner {
private static void run(String[] arg) {
Server server = new Server();
...
server.setHandler(webApp);
server.start();
}
}
I got a problem with classpaths:
it seems that webApp's classpath contains (inherit) classpath of Runner class.
For example if I have spring service com.my.MyClass1
in classpath of Runner (NOT in webApp classpath) and inside wepApp
I run spring with scanning pacage "com.my" then spring will find and try to create bean MyClass1
.
Is it correct behavior for servlet container (jetty)? Is it possible to configurate jetty to not have such behavior?