PDA

View Full Version : directjngine not run in context /



youngjiandong
25 Nov 2009, 12:40 AM
I use directjngine1.1,when i start jetty web app in context '/',
private static void startJettyServer() {
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8090);
server.setConnectors(new Connector[]{connector});
WebAppContext appContext = new WebAppContext();
appContext.setServer(server);
appContext.setContextPath("/");
appContext.setWar("WebContent/");

server.addHandler(appContext);
try {
server.start();
while (System.in.available() == 0) {
Thread.sleep(5000);
}
server.stop();
server.join();
} catch (Exception e) {
System.exit(100);
}
}
access url:http://localhost:8090/extjs/examples/direct/direct.jsp,show
Successful call to TestAction.doEcho with response:
nullCall to TestAction.multiply failed with message:
Unable to connect to the server.

when i change to appContext.setContextPath("/s"),and access url http://localhost:8090/s/extjs/examples/direct/direct.jsp,it ok.

pagullo
27 Nov 2009, 8:26 AM
I use directjngine1.1,when i start jetty web app in context '/',
private static void startJettyServer() {
Server server = new Server();
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8090);
server.setConnectors(new Connector[]{connector});
WebAppContext appContext = new WebAppContext();
appContext.setServer(server);
appContext.setContextPath("/");
appContext.setWar("WebContent/");

server.addHandler(appContext);
try {
server.start();
while (System.in.available() == 0) {
Thread.sleep(5000);
}
server.stop();
server.join();
} catch (Exception e) {
System.exit(100);
}
}
access url:http://localhost:8090/extjs/examples/direct/direct.jsp,show
Successful call to TestAction.doEcho with response:
nullCall to TestAction.multiply failed with message:
Unable to connect to the server.

when i change to appContext.setContextPath("/s"),and access url http://localhost:8090/s/extjs/examples/direct/direct.jsp,it ok.




Thanks for reporting this.

Yes, this is a bug, and I already fixed it: the new version of DJN I publish will include the fix.

The problem appears only when you set the servlet context name to "" or "/". The only workaround is not to use "" or "/" as the servlet context name.

I think you will probably be able to live with the workaround -for the time being.

Best regards,

pagullo
27 Nov 2009, 8:29 AM
BTW: could you please post new DirectJNgine related entries in the "Ext Direct Java based implementation" (https://www.extjs.com/forum/showthread.php?t=73027)thread?

I would like DJN-related things to be grouped in the same thread, if only to make easier to others to find the information.

Thanks

youngjiandong
27 Nov 2009, 6:43 PM
ok.