Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common problems of EJB

Shulou Source: shulou.com Published: 2022-06-02 03:21:58 09月29日 Update

What are the common problems of EJB, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Here are a few common questions about EJB.

I. what's the difference between EJB and J2EE

A: both J2EE and EJB are server specifications. But EJB is actually a subset of J2EE. In other words, the J2EE server must include an EJB container. Each J2EE server must contain an EJB container, in addition to a web container that can run servlet and jsp. A very vivid analogy, EJB is to J2EE what Mickey Mouse is to Disney.

two。 Can you use EJB components without an EJB-compatible application server

A: absolutely not. EJB components cannot "survive" outside the EJB container. The EJB component does not have a main method, and even if you deliberately add such a main method to your bean class, the bean is of little use in itself. Most of the methods in the enterprise bean are called by the container itself, and these methods do not make any sense without the server. Keep in mind that the most important thing about EJB server is that it can provide you with all the important services (transactions, security, etc.). Without a server, you will have nothing but your basic logic. Moreover, if your business logic depends on the container, even if it is only your business logic, it will fail without a server.

three。 What is the difference between regular Javabean and enterprise Javabean

A: the word javabean means reusable components. A regular non-enterprise javabean is a reusable component that follows a naming convention, and these regular javabean are available to development tools. Enterprise javabean is also a reusable component, but what it has in common with regular javabean is limited to this. The term "bean" in regular javabean mainly means that it can be reused at development time, so that it can be simplified or accelerated when establishing the association between the events of one bean and the methods of another bean, or it can be more convenient to set the property value. Regular javabean runs in JVM, just like all normal java classes. In contrast, "bean" in enterprise bean means that it can be reused at run time, and the enterprise bean must run under the control of the EJB container.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Service server container general component enterprise method run logic FAQ FAQ problem importance business that is help development different no clear Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux vpn OPPO Reno Shulou Technology