glassfish
  1. glassfish
  2. GLASSFISH-20996

EJB CreateException when calling a method in a retrieved local interface

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      jdk7u51 64 bit , glassfish 4 up to glassfish-4.0.1-b04-02_26_2014, ubuntu

      Description

      This application works perfectly in 3.1.2.2 and there has been no changes to the way beans are loaded when migrating to glassfish 4.

      Application is building using jars under glassfish/modules directory, the same ones used for running.

      EJB's effected so far are all marked with @Stateless annotation. The example here is the first bean that is executed on application startup.

      EJB is being picked up and loaded into JNDI and when getting it from jndi it is an instance of the correct object. Just when you go to call a method in the bean it fails.

      [2014-02-28T10:35:04.247+0000] [glassfish 4.0] [INFO] [AS-EJB-00054] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583704247] [levelValue: 800] [[
      Portable JNDI names for EJB DAOStatisticBean: [java:global/merchant/webapp/DAOStatisticBean, java:global/merchant/webapp/DAOStatisticBean!com.merchant.ejb.DAOStatisticBean]]]

      but then...

      [2014-02-28T10:35:08.055+0000] [glassfish 4.0] [SEVERE] [] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583708055] [levelValue: 1000] [[
      ejb.stateless_ejbcreate_exception]]

      [2014-02-28T10:35:08.056+0000] [glassfish 4.0] [WARNING] [AS-EJB-00056] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583708056] [levelValue: 900] [[
      A system exception occurred during an invocation on EJB DAOStatisticBean, method: public com.merchant.dto.DAOStatisticDTO com.merchant.ejb.DAOStatisticBean.loadTodayStatistic() throws javax.ejb.EJBException]]

      Root Cause of CreateException

      Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
      at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
      at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:1185)
      at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:185)
      at org.glassfish.weld.services.JCDIServiceImpl._createJCDIInjectionContext(JCDIServiceImpl.java:198)
      at org.glassfish.weld.services.JCDIServiceImpl.createJCDIInjectionContext(JCDIServiceImpl.java:179)
      at com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(BaseContainer.java:1696)
      at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:456)
      at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:97)
      at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:698)
      at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:246)
      at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:430)
      at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2579)
      at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1971)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
      at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
      at com.sun.proxy.$Proxy338.loadTodayStatistic(Unknown Source)
      at com.merchant.ejb._EJB31_GeneratedDAOStatisticBeanIntf__Bean_.loadTodayStatistic(Unknown Source)
      at com.merchant.thread.DAOStatisticThread.<init>(DAOStatisticThread.java:84)
      at com.merchant.thread.DAOStatisticThread.startThread(DAOStatisticThread.java:195)
      at com.merchant.InitServlet.init(InitServlet.java:102)
      at javax.servlet.GenericServlet.init(GenericServlet.java:244)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5704)

        Activity

        Hide
        Hong Zhang added a comment -

        As stack trace is from CDI code, assign to cdi team for initial evaluation.

        Show
        Hong Zhang added a comment - As stack trace is from CDI code, assign to cdi team for initial evaluation.
        Hide
        jjsnyder83 added a comment -

        Can you please provide a source code example of:

        • The definition of the ejb
        • How it is injected into the servlet (I assume it is injected into a servlet based on the stack trace)
        • How it is accessed that causes the exception.
        Show
        jjsnyder83 added a comment - Can you please provide a source code example of: The definition of the ejb How it is injected into the servlet (I assume it is injected into a servlet based on the stack trace) How it is accessed that causes the exception.

          People

          • Assignee:
            jjsnyder83
            Reporter:
            sicruise
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: