Application Server provides support for three J2EE web profile based specifications, which are namely Java Server Faces (JSF), Java Persistence API (JPA) and Java Transaction API (JTA).
JTA comes as an out-of-the box feature by inheriting the transaction management capabilities of the Carbon platform; while, JSF and JPA come as an additional feature that can be installed from the online Carbon p2 repository.
If this feature is not bundled with the WSO2 product by default, you can install it using the instructions provided in the Feature Management section. Once installed, the necessary menus will appear in the Management Console.
J2EE class loading environments
Installation of the J2EE feature will create a directory named
j2ee containing the required libraries for JSF and JPA at the
<PRODUCT_HOME>/lib/runtimes/library and update the
<PRODUCT_HOME>/repository/conf/tomcat/webapp-classloading-environments.xml file by adding the new J2EE classloading environment.
Before proceeding any further with this documentation, we highly recommend that you go through the Webapp ClassLoading section, to learn more on the Web App class loading environments.
Java Server Faces support
WSO2 Application Server uses Apache MyFaces as the JSF reference implementation. JSF based web applications can run on the libraries provided by the J2EE class loading environment, by adding the following entries to the
webapp-classloading.xml file of the JSF based web application.
Java Persistence API support
WSO2 Application Server uses Apache OpenJPA as the persistence provider. Web applications can use the OpenJPA libraries provided by the J2EE class loading environment, by adding the following entries to the
webapp-classloading.xml file of the web application.
For more information Apache OpenJPA, go to http://openjpa.apache.org/builds/2.2.2/apache-openjpa/docs/main.html
Java Transaction API support
As mentioned earlier, JTA support for web applications is inherited from the Carbon platform; therefore, there is no need of installing the J2EE feature in this case.
Web applications that run on the Carbon class loading environment can have JTA facilities provided by the Carbon platform.
By default, the Carbon class loading environment is available for all web applications. However, if you put a
webapp-classloading.xml file inside the META-INF folder, you will override the default settings and only the
classloading environments defined in that XML file are exposed to the web application. As a result, make sure to put the Carbon
classloading environment along with the other
classloading environments inside the
For an example, if you want to use JTA with a CXF web application:
WSO2 Carbon platform provides the
javax.transaction.UserTransaction and the
javax.transaction.TransactionManager object references as JNDI resources.
Web Applications can access them as mentioned below: