Lab: Accelerate Your Web App Development!

Learn how to quickly deploy applications in Liberty using WebSphere Application Server Developer Tools for Eclipse!

Based on a lab presented at Impact 2013, this lab guides you through developing an application from scratch using various programming models that are part of the Liberty profile.

The lab takes around 2 hours to complete, and guides you through each step. At the end of the lab, you will have an application designed to build lists of users, perform searches, and mark them as attended. The lab touches on many programming models in Liberty, including EJB, JAX-RS, JPA, and CDI.

Lab instructions:
https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/labs/Lab-AppDevelopment.pdf

Lab materials:
https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/labs/Lab-AppDevelopment.zip

  • Jeff Li

    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