简体   繁体   English

Java 7 SE是否支持EJB?

[英]Does Java 7 SE have support for EJB?

If I want EJB 3.0 support and want to run Java 7, do I need Java EE or can I stick with SE? 如果我想要EJB 3.0支持并希望运行Java 7,我是否需要Java EE或者我能坚持使用SE吗?

In the past (many JDK versions ago), one needed the "J2EE" version of the JDK to run EJB. 在过去(许多JDK版本之前),需要JDK的“J2EE”版本来运行EJB。 It would appear this is no longer true. 这似乎不再是真的。 Please advise. 请指教。

UPDATE: I should have mentioned that the application will be running inside Oracle WebLogic 10.3.6. 更新:我应该提到应用程序将在Oracle WebLogic 10.3.6中运行。

No, this is unchanged. 不,这没有改变。 EJBs are part of Java EE, not Java SE. EJB是Java EE的一部分,而不是Java SE。 This will probably never change as the infrastructure support for EJB is huge (and will not likely be included in Java SE). 这可能永远不会改变,因为EJB的基础架构支持很大(并且不太可能包含在Java SE中)。

EJB is part of Java EE. EJB是Java EE的一部分。 But if what you want is JPA, even though the API is included within Java EE ( here's the API documentation ) you don't need a Java EE application server for JPA anymore (unlike the situation with EJB entity beans). 但是,如果您想要的是JPA,即使API包含在Java EE中( 这里是API文档 ),您也不再需要JPA的Java EE应用程序服务器(与EJB实体bean的情况不同)。 JPA can be used with Java SE. JPA可以与Java SE一起使用。

If you're running this in Weblogic then you have access to Java EE, so I don't get the point of the question. 如果你在Weblogic中运行它,那么你可以访问Java EE,所以我不明白这个问题。

为了运行EJB,您需要一个EJB容器(例如Glassfish),它不包含在Java SE 7中。

I think you are wrong. 我认为你错了。 EJB is still part of Java EE specification only, not Java SE. EJB仍然只是Java EE规范的一部分,而不是Java SE。 If you look at Java SE API , there is no reference to EJB. 如果查看Java SE API ,则不会引用EJB。

You can use EJBs in non Java EE application server with EJB's 3.1 Lite container - http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html . 可以在EJB的3.1 Lite容器中使用非Java EE应用程序服务器中的EJB - http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html
All Java EE 6 compliant application servers must be able to run in embedded mode. 所有符合Java EE 6的应用程序服务器必须能够以嵌入模式运行。

This, however, is not a Java SE 7 feature (it worked fine in Java SE 6) but Java EE 6 API, so if you're stick with EJB 3.0 than you'd need to use application server or some implementor-specific features. 但是,这不是Java SE 7的功能(它在Java SE 6中运行良好),而是Java EE 6 API,因此如果您坚持使用EJB 3.0,那么您需要使用应用程序服务器或某些特定于实现程序的功能。

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

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