简体   繁体   中英

Deploying an EJB .jar to jBoss/WildFly from Eclipse

I am new to Java EE. I use Eclipse, jBoss/WildFly and Maven. I have a multi module Maven project:

  • parent Maven project ( pom )
    • web application ( war )
    • EJB project ( jar )

Currently, the EJB jar project is packaged inside the web application and the entire solution is deployed as one war file.

I want to change it: I need to deploy the war and the jar projects to the application server independently (as two independent applications). Then the web project could access the EJBs via their remote interfaces.

The problem:

I can deploy the war project in Eclipse with the Run As > Run On Server context menu, however when I attempt to deploy the jar project in the same way, I get an error message saying that the project cannot be deployed.

How can I deploy my projects independently from Eclipse?

Should I wrap the jar project into an ear project? If so, can I convert my jar project into an ear project, or do I have to keep my jar project and create one more project to wrap it into an ear ? (I would no like to introduce one more project).

Look at your packaging for your EJB project. You should have

<packaging>ejb</packaging>

This will allow you to run the EJB project on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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