Java – how do I add EJB functionality to an eclipse dynamic web project?

I am using EJB 3.0 to develop a simple application, using openejb for deployment and eclipse as ide development

I created a "dynamic web application" project in eclipse When I tried to create the first stateless session bean, I realized that the @ remote annotation could not be resolved

What is the correct way to solve this problem?

>Delete the project and create a new "enterprise application project" (this seems quite heavy, so I don't know where I want to go)? > Delete the project and create an EJB project (this seems incorrect because I believe such a project will only let me bundle the EJB part of the application)? > Add some libraries to my existing project (one library package is EJB 3. X)? > Add an aspect to my existing project (I try to see if I can add an aspect, but I can't see an EJB aspect in the context of this project)?

Thank you for your help

Update: I found the answer

Tomee is installed in a directory that contains all the jar files required to compile and run "apache-tomee-webprofile-1.0.0-beta-2 / webapps / openejb / lib" of EJB,

I created a user library in eclipse that contains all the jars in the above lib folder and added them to the build path

Now the EJB interface compiles correctly

Solution

>Create a new enterprise application project (EAP)

Now, you can create EJB in the EJB project and call them from the WEB project.

And you can deploy or debug EAP on an application server that supports enterprise application projects, such as JBoss EAP is deployed with A unique file with the ear extension

For example, if you use tomcat, you cannot deploy the headset package

Here is a page about creating ears using eclipse

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>