ninja
ninja copied to clipboard
standalone Jety seems to be ignoring parameter "ninja.idle.timeout"
@raphaelbauer It worked in netbeans and the tests ran but after trying it with release version 5.1.2 in prod mode, jetty still returns 404 after 30 sec. I cannot figure it out, do you have an idea?
I checked source code but could not find why. Are you starting with java -jar or mvn ninja:run ? The later may not work, I'm afraid, as the parameter is not passed to the jetty server. I'm also interested on this one.
Both variants do not work.
I will have a deeper look if I have some time
I have edited the test class and placed
assertEquals(60000, nj.server.getConnectors()[0].getIdleTimeout());
after
assertTrue(nj.server.isStarted());
to get the active parameter of the running jetty instance and it passes. I have no idea....
I lately found that all -D must be specified before the -jar when starting command. This may be obvious to people used to work a lot with java, which is not my case. Can it be the reason ?
Can you try this : java -Dninja.idle.timeout=60000 -jar file.jar
In my case it is provided before -jar. I have also inspected the NinjaJetty class during runtime with javosize an it has the conmand line parameter set as idleTimeout. Dont know if jetty is ignoring it or what the problem is.
I attached the debugger to the running app and inspected jetty classes, I found that SelectChannelEndpoint, which is instanciated with every request handled, extends IdleTimeout class. Instance of this class holds _idleTimeout private variable (exposed by getter which is called by extending classes') with value 60000 during runtime. I think I should file a bug with the Jetty server? What do you think? Anny further ideas?
Have you tried with à jetty.xml file instead ? Does it allow this customisation ? I'll soon do the same as you, and if I'm planning to avoid tomcat installation !
I have discussed XML topic with @raphaelbauer on the mailing list and he said it would require a full blown Jetty config file which is not an option for me. Avoiding tomcat is my goal too. I want to have scaleable and flexible runtime which deploys anywhere in minimal time. I have filed a bug at eclipse bugtracker for jetty 9.2.10 which is current dependency for ninja.
Accidently closed the issue sorry. Reopened.
I have resolved this! More detail and maybe PR tomorrow...