简体   繁体   English

Jetty 8 + EJB 3.1 + JTA + CDI + JPA 2堆栈?

[英]Jetty 8 + EJB 3.1 + JTA + CDI + JPA 2 stack?

Can anyone tell me if it is currently possible to "glue together" a partial Java EE 6 Web Profile over Jetty? 任何人都可以告诉我,目前是否可以通过Jetty“粘合”部分Java EE 6 Web配置文件? I've found a lot of articles about integrating standalone EJB 3 containers, JTA providers, etc with older Jetty versions, so I wounder if I could make it all work together. 我发现了很多关于将独立EJB 3容器,JTA提供程序等与旧Jetty版本集成的文章,所以如果我可以将它们全部一起工作,我就会更加努力。 I would like to assemble a Servlet 3.0 + CDI + EJB 3.1 + JTA (if needed, all I really want is declarative transaction management) + JPA 2 environment over Jetty 8 (or Tomcat 7 if no Jetty alternatives are available). 我想组装一个Servlet 3.0 + CDI + EJB 3.1 + JTA(如果需要,我真正想要的是声明式事务管理)+ Jetty 8上的JPA 2环境(如果没有可用的Jetty替代品,则为Tomcat 7)。 My questions are: Can it be done? 我的问题是:可以做到吗? Has anyone managed to do that? 有人设法做到了吗? Any articles about getting OpenEJB, Atomikos, Weld, EclipseLink and Jetty (or any other similar stack) working together? 有关将OpenEJB,Atomikos,Weld,EclipseLink和Jetty(或任何其他类似的堆栈)协同工作的任何文章? Any magical "do it all" pom.xml files out there? 有没有神奇的“全部”pom.xml文件?

PS: Yeah, I know I could just use GlassFish (which I like very much). PS:是的,我知道我可以使用GlassFish(我非常喜欢)。 I'm just wondering about how hard would it be to get something similar working with a Servlet Container, and how the two environments would compare in terms of complexity, performance, size, deploying speed, hardware resource consumption, etc. 我只是想知道使用Servlet容器做类似工作有多难,以及两个环境在复杂性,性能,大小,部署速度,硬件资源消耗等方面的比较。

I'd describe this as still in the early stages, but here is what we have so far: 我将其描述为仍处于早期阶段,但这是迄今为止我们所拥有的:

http://svn.apache.org/repos/asf/openejb/trunk/openejb3/assembly/openejb-jetty/ http://svn.apache.org/repos/asf/openejb/trunk/openejb3/assembly/openejb-jetty/

Note, Apache TomEE lives at a similar path, ie 'assembly/openejb-tomcat'. 注意,Apache TomEE生活在类似的路径上,即'assembly / openejb-tomcat'。 Plan is to call the Jetty version Apache JetSet and have it be fully embeddable. 计划是调用Jetty版本Apache JetSet并使其完全嵌入。 Most people with commit are currently working on getting Apache TomEE to be officially Java EE 6 Web Profile certified. 大多数提交者目前正致力于使Apache TomEE正式通过Java EE 6 Web Profile认证。 I'd describe that work to be in the late stages. 我将这项工作描述为处于后期阶段。 We've a great setup in Amazon EC2 to run the web profile TCK against TomEE using a hundred EC2 t1.micro spot instances. 我们在Amazon EC2中进行了很好的设置,使用一百个EC2 t1.micro点实例运行针对TomEE的Web配置文件TCK。 It's pretty sweet. 这很甜蜜。 The TCK agreement with Apache and Oracle does not allow us to share access publicly. 与Apache和Oracle的TCK协议不允许我们公开共享访问权限。 However, any Apache committer can sign an NDA to get access. 但是,任何Apache提交者都可以签署NDA以获取访问权限。

Ok, so I mention all that about TomEE because the plan is once we're done with the Tomcat version, to do it all over again with Jetty (JetSet). 好的,所以我提到了关于TomEE的所有内容,因为计划是在我们完成Tomcat版本之后,用Jetty(JetSet)再次完成。 Many of us committers, myself and Jonathan Gallimore for example, actually prefer Jetty by a large margin. 我们许多提交者,例如我自己和Jonathan Gallimore,实际上更喜欢Jetty。 But as the Tomcat integration code was much further along and had more users, we decided to just finish that one first. 但是随着Tomcat集成代码的进一步发展以及拥有更多用户,我们决定先完成这一任务。 There is an incredible amount of work that isn't Tomcat specific that we will be able to leverage in the Jetty version; 有大量的工作不是Tomcat特定的,我们将能够在Jetty版本中使用; getting access to the TCK legally, the heaps of code to get it to run, the more heaps of code to get it automated, and numerous integration bits which are generic and not specific to Tomcat. 合法访问TCK,使其运行的代码堆,更多的代码使其自动化,以及许多通用且不特定于Tomcat的集成位。

All that said, there's no reason others have to wait to work on a Jetty version just because most of us are still finishing the Tomcat version. 所有这一切,没有理由让其他人不得不等待Jetty版本,因为我们大多数人仍在完成Tomcat版本。 Apache projects should be viewed as individuals working together, not companies like Oracle or Redhat or VMWare. Apache项目应该被视为个人合作,而不是Oracle,Redhat或VMWare等公司。 That can be both good and bad. 这可能既好又坏。 The good part is that if you or anyone else wants to hack on the Jetty version you can do that right now. 好的一面是,如果你或其他任何人想要破解Jetty版本,你现在可以做到这一点。 You'll have to submit patches for awhile till you earn commit, but having someone else do the actual commit command is not that bad. 你必须提交一段时间的补丁,直到你获得提交,但让其他人做实际的提交命令并不是那么糟糕。 If you start small and stay active and open, it's usually pretty easy to earn commit. 如果你从小开始并保持活跃和开放,通常很容易获得提交。 The key to getting patches in quickly is a steady stream of small to moderately sized patches. 快速获得补丁的关键是稳定的小到中等大小的补丁流。 Any step forward or sideways with no steps backward is a good patch in my opinion. 在我看来,任何向前或向侧面没有退步的步骤都是一个很好的补丁。 As long as people can see where you're going it's good enough. 只要人们能够看到你去哪里,它就足够了。 Certainly more Agile than the one-big-patch approach and allows for all the really fun and collaborative magic to happen along the way. 当然,比一大补丁方法更敏捷,并允许所有真正有趣和协作的魔术一路上发生。

Some threads which would be good places to say hello. 一些线程可能是打个招呼的好地方。 Step 1 is just to say hello. 第1步就是打招呼。 No need to have code in hand to talk on the dev list or be taken seriously: 无需手头有代码在开发列表上进行讨论或认真对待:

http://openejb.979440.n4.nabble.com/Jetty-Integration-td1457408.html http://openejb.979440.n4.nabble.com/Jetty-Integration-td2318962.html http://openejb.979440.n4.nabble.com/Jetty-Integration-td1457408.html http://openejb.979440.n4.nabble.com/Jetty-Integration-td2318962.html

Tomcat has that stack implemented in a server called TomEE(formerly TomTom). Tomcat在名为TomEE(以前称为TomTom)的服务器中实现了该堆栈。

These are the components it uses. 这些是它使用的组件。

Connector    Apache Geronimo Connector
CDI  Apache OpenWebBeans
EJB  Apache OpenEJB
Javamail     Apache Geronimo JavaMail
JPA  Apache OpenJPA
JSF  Apache MyFaces
JSP  Apache Tomcat
JSTL     Apache Tomcat
JTA  Apache Geronimo Transaction
Servlet  Apache Tomcat

As far as Jetty I'm not sure. 至于Jetty,我不确定。 OpenEJB is your only option for EJB outside of a JavaEE6 container(AFAIK) and I'm not sure Jetty is 100% tested with this. OpenEJB是JavaEE6容器(AFAIK)之外的唯一EJB选项,我不确定Jetty是否经过100%的测试。 For CDI you can always use something like Seam. 对于CDI,您可以随时使用Seam之类的东西。

In my opinion I believe the Spring framework would be your best option for the Jetty container(that's just my opinion though). 在我看来,我相信Spring框架将是Jetty容器的最佳选择(虽然这只是我的意见)。 In my experience after trying to get Tomcat working with Open EJB, Spring is a lot easier to set up. 根据我在尝试让Tomcat使用Open EJB之后的经验,Spring设置起来要容易得多。

You also have to remember Open EJB doesn't implement the entire EJB 3.1 stack at this point. 您还必须记住Open EJB此时并未实现整个EJB 3.1堆栈。

Also Open EJB is not tested on Tomcat 7 either. 此外,Open Tom也未在Tomcat 7上进行测试。 So you have to stay with Tomcat 6 if you go that route. 因此,如果你走这条路,你必须留在Tomcat 6。

OpenEjb has not released a version with JPA2 support, although their development version supports JPA2 fine AFAIK. OpenEjb尚未发布支持JPA2的版本,尽管它们的开发版本支持JPA2精细AFAIK。 I'm using embedded OpenEjb in Jetty6, because I could not get my app working in newer jetties yet. 我在Jetty6中使用嵌入式OpenEjb,因为我无法让我的应用程序在更新的码头工作。 I think there is work under way to get an OpenEJB tightly integrated with Jetty like TomEE, but that may be some way off.. 我认为正在开展工作以使OpenEJB与Jetty紧密集成,如TomEE,但这可能还有一段路要走。

Geronimo is a complete J2EE stack which runs on top of Jetty. Geronimo是一个完整的J2EE堆栈,它运行在Jetty之上。

There's a document on its setup on https://cwiki.apache.org/GMOxDOC30/configuring-virtual-host-in-jetty.html https://cwiki.apache.org/GMOxDOC30/configuring-virtual-host-in-jetty.html上有关于其设置的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM