(Based on an original lab (2013-07-13) by Ross Pavitt and presented at IMPACT 2013.)

Learn how to quickly deploy applications on [WebSphere Liberty](/wasdev/websphere-liberty/) using WebSphere Application Server Developer Tools for Eclipse!

This lab guides you through developing an application from scratch using various programming models that are part of WebSphere Liberty.
The lab takes around 1 hour to complete, and guides you through each step. At the end of the lab, you will have a simple registration application that registers a name to a database and displays the list. The lab touches on many programming models in Liberty, including JAX-RS, JPA, and CDI.

Lab instructions (PDF)

Lab materials (ZIP)

1 Comment on "1hr Lab: Accelerate your web app development on Liberty!"

  1. The step-by-step lab instruction is good, but not sure what step that I have missed and how to debug and fix the following issue. Here is the error message after going through many steps of setup and code copy/paste and finally getting to the point to test something meaningful.

    [ERROR ] CWWJP0029E: The server cannot find the RegistrationAppWeb persistence unit in the RegistrationWebApp.war module and the RegistrationWebApp application.
    [ERROR ] CWNEN0035E: The com.ibm.websphere.sample.registration.ejb.RegistrationBean/em reference of type javax.persistence.EntityManager for the null component in the RegistrationWebApp.war module of the RegistrationWebApp application cannot be resolved.
    [ERROR ] CNTR0019E: EJB threw an unexpected (non-declared) exception during invocation of method “register”. Exception data: javax.ejb.EJBException: The com.ibm.websphere.sample.registration.ejb.RegistrationBean/em reference of type javax.persistence.EntityManager for the null component in the RegistrationWebApp.war module of the RegistrationWebApp application cannot be resolved.
    at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1154)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.EJSLocalNSLRegistrationBean_58e284e5.register(EJSLocalNSLRegistrationBean_58e284e5.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.webbeans.ejb.common.proxy.EjbBeanProxyHandler.invoke(EjbBeanProxyHandler.java:233)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.RegistrationBean_$$_javassist_0.register(RegistrationBean_$$_javassist_0.java)
    at com.ibm.websphere.sample.registration.servlets.AddAttendee.doPost(AddAttendee.java:52)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
    at [internal classes]

    [ERROR ] SRVE0777E: Exception thrown by application class ‘com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject:1,154’
    javax.ejb.EJBException: The com.ibm.websphere.sample.registration.ejb.RegistrationBean/em reference of type javax.persistence.EntityManager for the null component in the RegistrationWebApp.war module of the RegistrationWebApp application cannot be resolved.
    at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1154)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.EJSLocalNSLRegistrationBean_58e284e5.register(EJSLocalNSLRegistrationBean_58e284e5.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.webbeans.ejb.common.proxy.EjbBeanProxyHandler.invoke(EjbBeanProxyHandler.java:233)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.RegistrationBean_$$_javassist_0.register(RegistrationBean_$$_javassist_0.java)
    at com.ibm.websphere.sample.registration.servlets.AddAttendee.doPost(AddAttendee.java:52)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
    at [internal classes]

    [ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.ejb.EJBException: The com.ibm.websphere.sample.registration.ejb.RegistrationBean/em reference of type javax.persistence.EntityManager for the null component in the RegistrationWebApp.war module of the RegistrationWebApp application cannot be resolved.
    at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1154)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.EJSLocalNSLRegistrationBean_58e284e5.register(EJSLocalNSLRegistrationBean_58e284e5.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.webbeans.ejb.common.proxy.EjbBeanProxyHandler.invoke(EjbBeanProxyHandler.java:233)
    at [internal classes]
    at com.ibm.websphere.sample.registration.ejb.RegistrationBean_$$_javassist_0.register(RegistrationBean_$$_javassist_0.java)
    at com.ibm.websphere.sample.registration.servlets.AddAttendee.doPost(AddAttendee.java:52)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1240)
    at [internal classes]
    Caused by: javax.ejb.EJBException: The com.ibm.websphere.sample.registration.ejb.RegistrationBean/em reference of type javax.persistence.EntityManager for the null component in the RegistrationWebApp.war module of the RegistrationWebApp application cannot be resolved.
    … 16 more

Join The Discussion

Your email address will not be published. Required fields are marked *