运行没有Jetty的GWT Speedtracer [英] Running GWT Speedtracer without Jetty

查看:90
本文介绍了运行没有Jetty的GWT Speedtracer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们试图运行GWT(2.1)Speedtracer,但遇到麻烦,因为Jetty不接受我们的JDBC资源(它们在Tomcat中工作正常) - 可能是因为包含驱动程序的JAR未找到它。

有没有办法让GWT speedtracer在没有Jetty Server的情况下运行?



或者如何让web.xml / context.xml与Tomcat和Jetty兼容?



我希望在Jetty中运行它 - 只要这不会导致tomcat出现问题。

你想使用Tomcat:



GWT文档提及,您可以在服务器端使用Speed Tracer和SpringSource tc服务器(它是一个Tomcat服务器)。



如果您想使用Jetty: b
$ b

可以将DataSources与嵌入式GWT Jetty服务器配合使用,但并不容易。在 Google小组帖子中为GWT 1.6进行了解释。我已经用GWT 2.1试过了,它基本上仍然是相同的程序。这里有一个简要提示:
$ b $ ul

  • 为嵌入式Jetty启用JNDI:

    • add jetty-naming - *。jar jetty-plus - *。jar

    • 修改JettyLauncher,
    • 添加VM arg -Djava.naming.factory.initial = org.mortbay.naming.InitialContextFactory (或使用jndi.properties)

    • 创建一个jetty-env.xml(与Tomcat的context.xml类似)

    • 在web.xml中定义资源引用


    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.

    解决方案

    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

    这篇关于运行没有Jetty的GWT Speedtracer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆