My Oracle Support Banner

NullPointerException when injecting EJB3.0 inside the taglib of web application. (Doc ID 1325475.1)

Last updated on DECEMBER 03, 2017

Applies to:

Oracle WebLogic Server - Version 10.3.3 and later
Information in this document applies to any platform.


When injecting remote EJB into the taglibs and on using the taglibs inside the JSP page you will notice a NullpointerException.

public class MessageTag extends BodyTagSupport {
private static final long serialVersionUID = 1L;
ITestEjb testEjb;

public int doEndTag() throws JspException {
JspWriter out = pageContext.getOut();
try {
String message = testEjb.sayHello();
} catch (IOException e) {
return EVAL_PAGE;

The class MessageTag is located in the EJB module. Below Exception is thrown when invoking the EJB.

<Error> <HTTP> <BEA-101020><[ServletContext@5049220[app:taglib module:taglibWeb path:/taglibWeb spec-version:2.5]] Servlet
failed with Exception
at com.bea.tags.MessageTag.doEndTag(
at jsp_servlet.__helloworld._jsp__tag0(
at jsp_servlet.__helloworld._jspService(
at weblogic.servlet.jsp.JspBase.service(
at weblogic.servlet.internal.StubSecurityHelper$ (
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav a:300)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
at weblogic.servlet.internal.ServletStubImpl.execute(
at weblogic.servlet.internal.ServletStubImpl.execute(
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.securedExecute(
at weblogic.servlet.internal.WebAppServletContext.execute(

This was working fine until WLS 10.3.2 and failing in the above version.
If move the taglib class(MessageTag ) from EJB module to Webapp module you will notice it works fine.


@The problem was introduced


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.