MyJavaCode.com

Tutorial and How to Guide on Java Programming. Topics covered include Java Programming Language - Core Java, Spring, Webservices, REST, Hibernate, Maven and Microservices.

  • Core Java
  • REST API’s
  • Spring boot
  • Hibernate
  • Interview Questions
  • Contact Us
  • Projects
  • Offerings

How to Use JPA 2.1 in JBoss EAP 6.x

January 18, 2025 By Prasanna Manjunatha

JBoss EAP 6.x is based on JEE 6. But as JPA 2.1 is part of the JEE 7 Spec, it will not be possible to directly deploy applications built using JPA 2.1 in JBoss EAP 6.x.
However, with the following workaround we can make this possible. You need to include a ‘jboss-deployment-structure.xml’ with the following content inside the WEB-INF folder of your war file,

<?xml version="1.0" encoding="UTF-8"?>

<jboss-deployment-structure>

<deployment>

<exclude-subsystems>

<subsystem name="jpa" />

</exclude-subsystems>

<exclusions>

<module name="javaee.api" />

<module name="javax.persistence.api" />

<module name="org.hibernate" />

</exclusions>

<dependencies>

<module name="javax.activation.api" export="true"/>

<module name="javax.annotation.api" export="true"/>

<module name="javax.ejb.api" export="true"/>

<module name="javax.el.api" export="true"/>

<module name="javax.enterprise.api" export="true"/>

<module name="javax.enterprise.deploy.api" export="true"/>

<module name="javax.inject.api" export="true"/>

<module name="javax.interceptor.api" export="true"/>

<module name="javax.jms.api" export="true"/>

<module name="javax.jws.api" export="true"/>

<module name="javax.mail.api" export="true"/>

<module name="javax.management.j2ee.api" export="true"/>

<module name="javax.resource.api" export="true"/>

<module name="javax.rmi.api" export="true"/>

<module name="javax.security.auth.message.api" export="true"/>

<module name="javax.security.jacc.api" export="true"/>

<module name="javax.servlet.api" export="true"/>

<module name="javax.servlet.jsp.api" export="true"/>

<module name="javax.transaction.api" export="true"/>

<module name="javax.validation.api" export="true"/>

<module name="javax.ws.rs.api" export="true" services="export"/>

<module name="javax.xml.bind.api" export="true"/>

<module name="javax.xml.registry.api" export="true"/>

<module name="javax.xml.soap.api" export="true"/>

<module name="javax.xml.ws.api" export="true"/>


<module name="javax.api" export="true"/>

</dependencies>

</deployment>

</jboss-deployment-structure>

 

email
print

About Prasanna Manjunatha

Prasanna is a Toronto based Java Consultant with more than 15 years of Software Development experience. His areas of expertise include Core Java, Spring boot, REST, Microservices, Hibernate, NoSQL, Docker, Kubernetes and AWS.

Currently Trending

  • How to configure JaCoCo for Code Coverage in Spring boot Applications
  • How to Solve Maven invalid CEN header error
  • Getting Started with Spring Boot: A Spring Boot Setup Tutorial
  • MySQL Scheduler Overview with Examples
  • How to iterate Java HashMap
  • How to Create Cron Expression for Quartz Scheduler
  • Automate Audit Fields in Spring Boot with MyBatis: A Generic Solution for CRUD Operations
  • Wildcard SSL Certificate Configuration in JBoss
  • How to Generate MD5 Hash in Java
  • Java Null Check Using Optional: Enhancing Code Reliability and Readability

Connect with us

  • Facebook
  • GitHub
  • LinkedIn
  • Twitter

TAG CLOUD

Axis2 Code Coverage CodeCoverage cron expression Data Structure Frameworks Hashing HashMap Hibernate IntelliJ java Java Mail jboss jpa 2.1 Maven MyBatis MySQL PDF Quartz REST REST API SOAP Springboot Spring boot SQL Tools Tutorial web service

All time Popular Posts

  • How to Solve Maven invalid CEN header error
  • How to Extract Private Key from Java Keystore (.JKS) or .P12 File
  • MySQL Scheduler Overview with Examples
  • How to Generate MD5 Hash in Java
  • How to check whether a Collection is Null or Empty in Java
  • How to Password Protect a PDF File using Java
  • Automate Audit Fields in Spring Boot with MyBatis: A Generic Solution for CRUD Operations
  • How to Create Cron Expression for Quartz Scheduler
  • How to Solve error parsing lifecycle processing instructions
  • How to Update MySQL Collation for all tables in the schema

Copyright © 2026 MyJavaCode.com