Railo
  1. Railo
  2. RAILO-968

orm error - java.lang.NullPointerException creating a collection mapping

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 3.1.2.020
    • Fix Version/s: 3.2.0.000
    • Labels:
    • Environment:
      mysql
    • Similar Issues:
      Show 10 results 

      Description

      Getting a java.lang.NullPointerException error creating a simple collection mapping. Works in ACF

      // content.cfc
      component persistent="true"

      { property name="id" fieldtype="id" ormtype="integer" generator="native"; property name="name"; property name="content" ormtype="text"; property name="tags" type="array" fieldtype="collection" fkcolumn="contentId" elementtype="string" elementcolumn="tag" table="content_tags"; }

      StackTrace:

      Tue Sep 21 12:07:21 EDT 2010-512 Call:/orm2/index.cfm (1)
      java.lang.NullPointerException
      at railo.runtime.orm.hibernate.HBMCreator.createXMLMappingCollection(HBMCreator.java:877):877
      at railo.runtime.orm.hibernate.HBMCreator.addCollection(HBMCreator.java:181):181
      at railo.runtime.orm.hibernate.HBMCreator.createXMLMapping(HBMCreator.java:120):120
      at railo.runtime.orm.hibernate.HibernateORMEngine.createMapping(HibernateORMEngine.java:273):273
      at railo.runtime.orm.hibernate.HibernateORMEngine.getSessionFactory(HibernateORMEngine.java:175):175
      at railo.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:91):91
      at railo.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2954):2954
      at railo.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2942):2942
      at railo.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:45):45
      at railo.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:502):502
      at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114):114
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23):23
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1900):1900
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):280
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243):243
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201):201
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163):163
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108):108
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556):556
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401):401
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281):281
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579):579
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1568):1568
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886):886
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908):908
      at java.lang.Thread.run(Thread.java:619):619
      at railo.runtime.op.Caster.toPageException(Caster.java:2967):2967
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1903):1903
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):280
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243):243
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201):201
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163):163
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108):108
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556):556
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401):401
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281):281
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579):579
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1568):1568
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886):886
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908):908
      at java.lang.Thread.run(Thread.java:619):619
      java.lang.NullPointerException
      at railo.runtime.orm.hibernate.HBMCreator.createXMLMappingCollection(HBMCreator.java:877):877
      at railo.runtime.orm.hibernate.HBMCreator.addCollection(HBMCreator.java:181):181
      at railo.runtime.orm.hibernate.HBMCreator.createXMLMapping(HBMCreator.java:120):120
      at railo.runtime.orm.hibernate.HibernateORMEngine.createMapping(HibernateORMEngine.java:273):273
      at railo.runtime.orm.hibernate.HibernateORMEngine.getSessionFactory(HibernateORMEngine.java:175):175
      at railo.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:91):91
      at railo.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2954):2954
      at railo.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2942):2942
      at railo.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:45):45
      at railo.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:502):502
      at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114):114
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23):23
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1900):1900
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):280
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243):243
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201):201
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163):163
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108):108
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556):556
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401):401
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281):281
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579):579
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1568):1568
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886):886
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908):908
      at java.lang.Thread.run(Thread.java:619):619
      at railo.runtime.op.Caster.toPageException(Caster.java:2967):2967
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1903):1903
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280):280
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243):243
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201):201
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163):163
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108):108
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:556):556
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401):401
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281):281
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579):579
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1568):1568
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886):886
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908):908
      at java.lang.Thread.run(Thread.java:619):619
      Tue Sep 21 12:07:21 EDT 2010-584 Release: (1)

        Activity

        Hide
        Michael Offner
        added a comment -

        please try with version 021 and if it works close ticket

        Show
        Michael Offner
        added a comment - please try with version 021 and if it works close ticket
        Hide
        Brett S
        added a comment -

        Hi Michael -

        The error no longer exists but the db schema that is created does not include the elementcolumn column, and no collection values are persisted. I tested both array and structure collection types and both types had the same issue.

        Here is my entity cfc (tested working in ACF)

        component persistent="true"

        { property name="id" fieldtype="id" ormtype="integer" generator="native"; property name="name"; property name="content" ormtype="text"; property name="tags" type="array" fieldtype="collection" fkcolumn="contentId" elementcolumn="tag" elementtype="string" table="content_tags"; property name="groups" type="struct" fieldtype="collection" fkcolumn="contentId" structKeyColumn="groupedBy" structKeyType="string" elementcolumn="sortorder" elementtype="integer" table="content_groups"; }
        Show
        Brett S
        added a comment - Hi Michael - The error no longer exists but the db schema that is created does not include the elementcolumn column, and no collection values are persisted. I tested both array and structure collection types and both types had the same issue. Here is my entity cfc (tested working in ACF) component persistent="true" { property name="id" fieldtype="id" ormtype="integer" generator="native"; property name="name"; property name="content" ormtype="text"; property name="tags" type="array" fieldtype="collection" fkcolumn="contentId" elementcolumn="tag" elementtype="string" table="content_tags"; property name="groups" type="struct" fieldtype="collection" fkcolumn="contentId" structKeyColumn="groupedBy" structKeyType="string" elementcolumn="sortorder" elementtype="integer" table="content_groups"; }
        Hide
        Michael Offner
        added a comment -

        tnx for input

        Show
        Michael Offner
        added a comment - tnx for input

          People

          • Assignee:
            Michael Offner
            Reporter:
            Brett S
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: