Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-708

CMP has no naming:cmp-connection-factory results in java.lang.NullPointerException at runtime

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-M4
    • Fix Version/s: 1.0-M4
    • Component/s: OpenEJB
    • Labels:
      None

      Description

      The first (sub)issue is that the following geronimo dd is accepted:

      <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar" xmlns:naming="http://geronimo.apache.org/xml/ns/naming" configId="catalog-ejb">
      <enterprise-beans>
      <entity>
      <ejb-name>UserEJB</ejb-name>
      <table-name>USERS</table-name>
      <cmp-field-mapping>
      <cmp-field-name>password</cmp-field-name>
      <table-column>password</table-column>
      </cmp-field-mapping>
      <cmp-field-mapping>
      <cmp-field-name>userName</cmp-field-name>
      <table-column>userName</table-column>
      </cmp-field-mapping>
      </entity>
      </enterprise-beans>
      </openejb-jar>

      but it contains no naming:cmp-connection-factory so at runtime Geronimo throws the following exception, which is the second (sub)issue:

      15:51:32,007 WARN [SystemExceptionInterceptor] UserEJB
      java.lang.NullPointerException
      at org.tranql.sql.DataSourceDelegate.getConnection(DataSourceDelegate.java:36)
      at org.tranql.sql.jdbc.JDBCQueryCommand.execute(JDBCQueryCommand.java:61)
      at org.openejb.entity.cmp.SingleValuedFinder.execute(SingleValuedFinder.java:90)
      at org.openejb.dispatch.DispatchInterceptor.invoke(DispatchInterceptor.java:72)
      at org.apache.geronimo.naming.java.ComponentContextInterceptor.invoke(ComponentContextInterceptor.java:56)
      at org.openejb.ConnectionTrackingInterceptor.invoke(ConnectionTrackingInterceptor.java:81)
      at org.openejb.entity.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:136)
      at org.openejb.entity.cmp.InTxCacheInterceptor.invoke(InTxCacheInterceptor.java:82)
      at org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPolicy.java:140)
      at org.openejb.transaction.TransactionContextInterceptor.invoke(TransactionContextInterceptor.java:80)
      at org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionInterceptor.java:82)
      at org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java:234)
      at org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.java:129)
      at org.openejb.proxy.EntityEJBLocalHome$$EnhancerByCGLIB$$23e705be.findByPrimaryKey(<generated>)
      at org.apache.jsp.moj_005ftest_jsp._jspService(org.apache.jsp.moj_005ftest_jsp:51)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
      at org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:92)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:832)
      at com.sun.j2ee.blueprints.signon.web.SignOnFilter.doFilter(SignOnFilter.java:154)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
      at com.sun.j2ee.blueprints.encodingfilter.web.EncodingFilter.doFilter(EncodingFilter.java:77)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
      at org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
      at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:823)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:623)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
      at org.mortbay.http.HttpServer.service(HttpServer.java:954)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

      which goes away when naming:cmp-connection-factory is added:

      <naming:cmp-connection-factory>
      <naming:resource-link>DerbyDatasource</naming:resource-link>
      </naming:cmp-connection-factory>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jlaskowski Jacek Laskowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: