This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 212198 - Allow EAR deployment on Tomcat (TomEE Plus)
Summary: Allow EAR deployment on Tomcat (TomEE Plus)
Status: NEW
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: -S1S-
Hardware: All All
: P3 normal with 15 votes (vote)
Assignee: Petr Hejl
URL: http://tomee.apache.org/
Keywords: TOMCAT
Depends on:
Blocks:
 
Reported: 2012-05-08 15:02 UTC by daedalus
Modified: 2014-01-08 15:07 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description daedalus 2012-05-08 15:02:57 UTC
Please support the deployment of EAR Applications on Tomcat (TomEE Plus) instances. 

TomEE Plus is a complete JEE 6 Application Server so it is possible to deploy EAR applications.

See http://openejb.apache.org/comparison.html


However Netbeans does not allow to set a TomEE instance as target server for an EAR application.
Comment 1 leandro.freitas.softdevelop 2013-03-21 01:28:12 UTC
notreally is not possible to upload the EAR format for NetBeans TomEE.

I am also waiting for this feature.
Comment 2 CodeMonkey007 2013-03-22 15:55:50 UTC
Additional comments related to this issue are in this forum post:
http://forums.netbeans.org/viewtopic.php?p=145126#145126
Comment 3 Valery-Sh 2013-05-28 18:40:54 UTC
Declare at least Tomcat plugin packages public.
Comment 4 Petr Jiricka 2013-08-20 14:59:45 UTC
FYI, a relevant blog post on this subject: http://www.adam-bien.com/roller/abien/entry/netbeans_7_tomee_1_5
Comment 5 kwrobel 2014-01-08 15:07:09 UTC
@Leandro: according to TomEE Deployment documentation, it IS possible to deploy an EAR. http://tomee.apache.org/deploying-in-tomee.html

Here's a quote from that page: "Or you could simply package your application as a war and "drop it in" tomee/webapps folder or as an ear and "drop it in" tomee/apps folder". Although, the default TomEE installation does not have an "apps" folder.

There is still merit in being able to create an EJB Project targeting TomEE. You could develop your EJB jar and then include it in your Web Application project for TomEE.

That said, I successfully tested the following scenario:

    1. Create a Web Application with TomEE (I created a symbolic link from openejb-http-*.jar as openejb-tomcat.*.jar inside the [TOMEE_HOME]/lib folder so that NetBeans can detect TomEE during the "Create Session Beans for Entity Classes wizard").
    2. Add your Entity Classes and Entity Facade classes (Session Beans) and persistence.xml and all the other functionality for your specific web site.
    3. Test your project.
    4. Create an EJB Project targeting GlassFish 3.1.2 (might also work with GlassFish 4, but not tested)
    5. Move your Entity & Facade classes into the EJB Project.
    6. Move your persistence.xml to the "src/conf" directory of your EJB Project (may have to switch to "Files" tab).
    7. Build your EJB Project. Make sure the "Generated Sources" appears as that is very important.
    8. Back in the Web Application, add right-click on Libraries node and then "Add Project..." and add the EJB Project's jar. This jar will be packaged inside the WAR file inside WEB-INF/lib, which is important for this to work with TomEE.
    9. Rebuild your Web Application and Deploy to TomEE.
    10. TEST! Watch for error messages in the server log. If everything goes well, you successfully made your "external" beans available inside your Web app. If you see error messages like "multiple persistence units found", then you probably didn't remove the persistence.xml from the web application.

This worked for me, tested with TomEE 1.6.0 Plus.