DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • How to Automatically Detect Multiple Cybersecurity Threats from an Input Text String in Java
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Build an AI Chatroom With ChatGPT and ZK by Asking It How!
  • Getting Started With JMS-ActiveMQ: Explained in a Simple Way

Trending

  • Implementing Stronger RBAC and Multitenancy in Kubernetes Using Istio
  • Chronicle Services: Low Latency Java Microservices Without Pain
  • Cognitive AI: The Road To AI That Thinks Like a Human Being
  • Performance Optimization Strategies in Highly Scalable Systems
  1. DZone
  2. Coding
  3. Java
  4. Developing Java EE 6 Applications With TomEE and NetBeans

Developing Java EE 6 Applications With TomEE and NetBeans

David Salter user avatar by
David Salter
·
Apr. 17, 13 · Interview
Like (0)
Save
Tweet
Share
7.01K Views

Join the DZone community and get the full member experience.

Join For Free

I’ve found that one of the most productive ways of developing Java EE applications is by using NetBeans and the TomEE application server.  For those of you that haven’t used TomEE before, it’s a Java EE 6 Web Profile certified stack that sits on top of Apache Tomcat.

As TomEE is Java EE 6 web profile certified, it supports the following technologies (all via Apache products) out of the box:

  • CDI
  • EJB
  • JPA
  • JSF
  • JSP
  • JSTL
  • JTA
  • Servlet
  • Javamail
  • Bean Validation

If you want / need to use JMS or JAX-RS/WS, then there’s an additional distribution called TomEE+ that provides support for these features.

I prefer to use Maven for project management / builds / testing etc which integrates well with NetBeans.

Using NetBeans, you can easily create a TomEE compatible Maven project by creating a new Maven Project from Archetype within the NetBeans New Project wizard.

Maven

The “tomee-webapp-archetype” will create a basic Web Application that’s defined and ready to deploy against TomEE.

Within the generated pom.xml file, we can see the important TomEE specific aspects are the use of OpenEJB for the EE api’s

<dependency>
      <groupId>org.apache.openejb</groupId>
      <artifactId>javaee-api</artifactId>
      <version>6.0-4</version>
      <scope>provided</scope>
</dependency>

and the use of the TomEE Maven plugin

<plugin>
        <groupId>org.apache.openejb.maven</groupId>
        <artifactId>tomee-maven-plugin</artifactId>
        <version>1.0.1</version>
</plugin>

Using the TomEE Maven plugin allows the project to be built and deployed to TomEE (without having to download TomEE!). This is useful for building and compiling from the command line. To get Maven to download TomEE, deploy your project to it and then start TomEE up, use the command

mvn tomee:run

Having said that, I prefer to use NetBeans to control running my projects as this provides more advanced features such as hot deployment of JSP/JSF, controlled execution of tests etc.

To run the project from within NetBeans, simply open up the pom.xml from the File | Open Project wizard in NetBeans. NetBeans is clever enough to open Maven projects which then function just like a standard NetBeans project. Select the “Run” option and NetBeans will ask which application server to run the application on. The is no direct support for TomEE, (i.e. you don’t see an Application Server of type TomEE in the NetBeans server configuration page) but since TomEE is based on Tomcat, to define a TomEE server, you just need to create a “Apache Tomcat” server and specify the server location to that of a previously downloaded TomEE instance.

That’s pretty much all that is involved in getting up and running with TomEE and NetBeans. TomEE offers a fast Java EE 6 certified stack that provides for rapid development and deployment of applications, whereas NetBeans 7.3 provides excellent tooling to support TomEE and Java EE development.





 

Java EE NetBeans Web application Java (programming language)

Published at DZone with permission of David Salter, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Automatically Detect Multiple Cybersecurity Threats from an Input Text String in Java
  • Java EE 6 Pet Catalog with GlassFish and MySQL
  • Build an AI Chatroom With ChatGPT and ZK by Asking It How!
  • Getting Started With JMS-ActiveMQ: Explained in a Simple Way

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: