2 Replies Latest reply on Sep 22, 2011 4:50 AM by Norman Klingspor

    JBoss AS 6.1.0.Final, GWT and EJB

    Norman Klingspor Newbie

      Hi,

       

      I'm trying to develop a  gwt-application that uses my own ejb-classes, exported from my last shop-project.

       

      The @EJB-call to my class works well, however the entityManager may not be initialized. I tryed both annotations:

      @PersistenceUnit(unitName = "sung.app.kylintv.ejb")
      protected EntityManagerFactory entityManagerFactory;

       

      protected EntityManager entityManager = entityManagerFactory.createEntityManager();

       

      as well, as:

      @PersistenceContext(unitName="sung.app.kylintv.ejb")
      protected EntityManager entityManager;

       

      the error remains the same:

       

      2011-09-21 14:55:48,926 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/kylintv.gwt]] (http-0.0.0.0-8080-1) Exception while dispatching incoming RPC call: com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract boolean sung.app.kylintv.gwt.client.DatabaseBuilderService.createDefaultDatabaseEntries()' threw an unexpected exception: javax.ejb.EJBException: java.lang.NullPointerException

          at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385) [:]

          at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588) [:]

          at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) [:]

          at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) [:]

          at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) [:]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [:1.0.0.Final]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]

          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.1.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.1.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]

          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]

          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]

          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]

      Caused by: javax.ejb.EJBException: java.lang.NullPointerException

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183) [:0.0.2]

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251) [:0.0.2]

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349) [:0.0.2]

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209) [:0.0.2]

          at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52) [:0.0.2]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) [:1.0.0.GA]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.4]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:333) [:1.7.21]

          at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:390) [:1.7.21]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]

          at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalContainerInvocation.invokeTarget(SessionLocalProxyInvocationHandler.java:184) [:1.0.11]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalInvokableContextHandler.invoke(SessionLocalProxyInvocationHandler.java:159) [:1.0.11]

          at $Proxy211.invoke(Unknown Source)    at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]

          at $Proxy210.createTestEntry(Unknown Source)    at sung.app.kylintv.gwt.server.DatabaseBuilderServiceImpl.createDefaultDatabaseEntries(DatabaseBuilderServiceImpl.java:27) [:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_25]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_25]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_25]

          at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) [:]

          ... 27 more

      Caused by: java.lang.NullPointerException

          at sung.app.kylintv.HomeBase.<init>(HomeBase.java:28) [:]

          at sung.app.kylintv.product.ProductHome.<init>(ProductHome.java:35) [:]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_25]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_25]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_25]

          at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_25]

          at org.jboss.weld.introspector.jlr.WeldConstructorImpl.newInstance(WeldConstructorImpl.java:239) [:6.1.0.Final]

          at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:134) [:6.1.0.Final]

          at org.jboss.weld.bean.SessionBean.createInstance(SessionBean.java:238) [:6.1.0.Final]

          at org.jboss.weld.bean.SessionBean$1.produce(SessionBean.java:222) [:6.1.0.Final]

          at org.jboss.weld.integration.instantiator.Jsr299BeanInstantiator.create(Jsr299BeanInstantiator.java:79) [:6.1.0.Final]

          at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:1048) [:1.7.21]

          at org.jboss.ejb3.stateless.StatelessContainer.createBeanContext(StatelessContainer.java:123) [:1.7.21]

          at org.jboss.ejb3.pool.AbstractPool.createBeanContext(AbstractPool.java:94) [:1.7.21]

          at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:81) [:1.7.21]

          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62) [:1.7.21]

          at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57) [:1.7.21]

          at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54) [:1.7.21]

          at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86) [:1.7.21]

          at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58) [:1.7.21]

          at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]

          at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95) [:1.7.21]

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.2]

          ... 67 more

       

      running jBoss 6.1.0.Final, GWT 2.4 calling my ejb-function.

      those are seperate projects.

       

      Does anybody know about this problem or even better: a solution to it? THX for any help or answer!