Introduction to Siwpas: Java EE Compatible Web Profile Server

DZone 's Guide to

Introduction to Siwpas: Java EE Compatible Web Profile Server

· Java Zone ·
Free Resource

Siwpas, Simple Web Profile Application Server provides runtime for "Java EE 6.0 Web Profile" platform.SIwpas is licensed under an ASL.

What is Java EE Web Profile?

According to the web profile specification, web profile container must support following technologies,

  • Servlet 3.0
  • JavaServer Pages (JSP) 2.2
  • Expression Language (EL) 2.2
  • Debugging Support for Other Languages (JSR-45) 1.0
  • Standard Tag Library for JavaServer Pages (JSTL) 1.2
  • JavaServer Faces (JSF) 2.0
  • Common Annotations for theJava Platform (JSR-250) 1.1
  • Enterprise JavaBeans (EJB) 3.1 Lite
  • Java Transaction API (JTA) 1.1
  • Java Persistence API (JPA) 2.0
  • Bean Validation 1.0
  • Managed Beans 1.0
  • Interceptors 1.1
  • Contexts and Dependency Injection for the Java EE Platform 1.0
  • Dependency Injection for Java 1.0 

Siwpas supports all of the above technologies to provide Java EE Web Profile compatible runtime. It is implemented based on "Apache Tomcat 7 Servlet & JSP container" and several Apache Software Foundation Java EE projects.

You could download and get more information from the JCP Page of the specification: JSR 316: JavaTM Platform, Enterprise Edition 6 (Java EE 6) Specification,

Siwpas Features

Using EJB 3.1 Features in WAR

Java EE Web Profile enables you to use "EJB 3.1" features embedded directly in your Java EE Web components. You can use following EJB 3.1 features directly
in your web application/s.

  • @Stateless, @Stateful and @Singleton EJB components,
  • @Local, @LocalBean (no interface) client views of EJB components,
  • Transaction, Interceptor, Security container services.

EJB components share same JNDI context with web application that they are deployed into. It means that  EJB components can lookup any references from web application jndi context. You can also use EJB portable global jndi names to inject EJB components into your web components. Global jndi names are portable. It means that you are not required to change jndi names of your context lookups in other Java EE containers.

For example, you can lookup EJB component's proxies from JNDI context like,

InitialContext context = new InitialContext();

//Looking up from global jndi context
context.lookup("java:global/module_name/bean_name!Interface Name")

//Looking up from application jndi context
context.lookup("java:app/module_name/bean_name!Interface Name")

//Looking up from module jndi context
context.lookup("java:module/bean_name!Interface Name")

Module name is your web application name. Bean name is EJB component name. Interface name is name of the interface that EJB component implements.

Web components  are able to inject EJB components using "CDI (Context and Dependency Injection)" technology or directly using "@EJB" annotation.

For example, you can use EJB components as "JSF managed beans" or inject them as business services into POJO based JSF managed beans.

Example: Using EJB component as managed beans

public class PaymentService{

public String pay(){



inject EJB into POJO based managed bean,

public class PaymentBean{

//Injection using CDI
@Inject PaymentService paymentService;

//Injection using @EJB
@EJB PaymentService paymentService;

public String pay(){

Using CDI Features in WAR

SIwpas fully supports JSR-299 specification via Apache OpenWebBeans project. Moreover, you can use JSR-299 based interceptors and decorators for EJB components.
You can inject EJB components into CDI Beans and vice-versa.

Moreover, SIwpas supports for injecting the following resources into your CDI Beans

  • @Resource annotation to inject : DataSource, UserTransaction, ValidatorFactory, Validator, TransactionManager, TransactionSynchronizationRegistry, ORB
  • @EJB annotation to inject EJB components,

You can also use JSR-299 based interceptors and decorators for your EJB components.


@Interceptor @PaymentLog
public PaymentInterceptor{

public Object beforePayment(InvocationContext ctx) throws Exception{
return ctx.proceed();

public class PaymentService implements IPaymentService{

public void pay(...){

 Here, @PaymentLog is an interceptor binding. It binds "PaymentInterceptor" to PaymentService pay() method.

You can also use Decorators for EJB components. It is enough to declare decorator class that also implements EJB component client interface.

public PaymentDecorator implements IPaymentService{
private @Inject @Delegate IPaymentService paymentService;

public void pay(...){
//Any business operation you want to do before actual paymentService

//Actual business method execution

You do not forget to add interceptor & decorator definitions into your "beans.xml" for enabling them.

SIwpas Other Features

Lots of cool and new features are provided with Java EE 6 platform. SIwpas supports all of them.

For example,

  • @DataSourceDefinitions and @DataSourceDefinition annotation support,
  • @Resource(lookup="lookup name") annotation support,
  • @ManagedBean annotation support for POJOs,
  • Servlet 3.0 features, like @WebServlet, @WebListener for defining servlets and listeners,
  • EL 2.2 features,
  • And more...

Future of Siwpas
We will provide a cool "SIwpas Console" to manage and introspect internals of SIwpas application server. Our aim is to implement SIwpas console using JSF 2. It will enable you to configure and manage every aspects of SIwpas, such as, EJB container configuration, listing jndi entries, deploy/undeploy applications, performance charts, protocol configuration and much more.

As you have already know that Oracle TCK's for  testing Java EE containers are not open source. Therefore, we do not know whether we will request certification from Oracle or not  for being compatible with Java EE Web Profile specification. If Oracle could provide us free TCK suite to test our application server, we could definitely use it :) I wish JCP and TCKs would be more open.

Siwpas Project Information

Project Web Page

Project Issue Page

Download Location



Gurkan Erdogdu

ASF Member,http://apache.org

PMC Chair, Apache OpenWebBeans

CTO, MechSoft Mechanical and Software Solutions, http://www.mechsoft.com.tr


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}