Running GWT Speedtracer without Jetty

▼魔方 西西 提交于 2019-11-29 15:47:44

问题


We are trying to run the GWT (2.1) Speedtracer, but have trouble with it, since Jetty doesn't accept our JDBC resources (they work fine in Tomcat) - probably because the JAR containing the drivers is not found by it.

Is there a way to make the GWT speedtracer run without the Jetty Server?

Or how do I make the web.xml/context.xml compatible with both Tomcat and Jetty?

I would prefer to run it in Jetty - as long as this won't cause problems with tomcat.


回答1:


If you want to use Tomcat:

The GWT documentation mentions, that you can use Speed Tracer on the server-side with the SpringSource tc Server (which is a Tomcat server).

If you want to use Jetty:

Using DataSources with the embedded GWT Jetty server is possible, but not easy. It's explained in this Google Group post for GWT 1.6. I have tried this with GWT 2.1, and it basically remains the same procedure. Here's a quick outline:

  • enable JNDI for the embedded Jetty:
    • add jetty-naming-*.jar, jetty-plus-*.jar
    • modify the JettyLauncher,
    • add the VM arg -Djava.naming.factory.initial=org.mortbay.naming.InitialContextFactory (or use jndi.properties)
  • create a jetty-env.xml (similar to Tomcat's context.xml)
  • define a resource-ref in the web.xml


来源:https://stackoverflow.com/questions/5078273/running-gwt-speedtracer-without-jetty

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!