3 Replies Latest reply on Aug 20, 2003 2:59 PM by Raja

    Setting CMR fields in ejbPostCreate throws Exception

    santhosh Newbie

      hi all,
      i get the following eror when Setting CMR fields in ejbPostCreate. the two tables in the my sql server 2000 database have proper primary key-foreign key relationship with the foreign keys being 'NOT NULL'. i am setting the foreign key fields using the set methods for the CMR fields in the ejbPost create. this code works perfectly in weblogic for the same database. what could be the problem in JBoss???
      ---------------------------------------------------------------
      14:43:07,264 ERROR [STDERR] javax.ejb.CreateException: Could not create entity:j
      ava.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cann
      ot insert the value NULL into column 'ModifiedBy', table 'vrm.dbo.tCommodity'; c
      olumn does not allow nulls. INSERT fails.

      14:43:07,264 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEnti
      tyCommand.insertEntity(JDBCCreateEntityCommand.java:327)
      14:43:07,264 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEnti
      tyCommand.execute(JDBCCreateEntityCommand.java:209)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManag
      er.createEntity(JDBCStoreManager.java:569)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.c
      reateEntity(CMPPersistenceManager.java:225)
      14:43:07,279 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.EntityContainer.createLocalHome
      (EntityContainer.java:571)
      14:43:07,279 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(
      Native Method)
      14:43:07,279 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(N
      ativeMethodAccessorImpl.java:39)
      14:43:07,279 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
      ke(DelegatingMethodAccessorImpl.java:25)
      14:43:07,279 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
      24)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterc
      eptor.invokeHome(EntityContainer.java:998)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.inv
      okeHome(AbstractInterceptor.java:88)
      14:43:07,279 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationIn
      terceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
      14:43:07,295 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.inv
      okeHome(AbstractInterceptor.java:88)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceIntercept
      or.invokeHome(EntityInstanceInterceptor.java:91)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.i
      nvokeHome(EntityLockInterceptor.java:61)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationIntercept
      or.invokeHome(EntityCreationInterceptor.java:28)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:88)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:243)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      Home(TxInterceptorCMT.java:74)
      14:43:07,295 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      okeHome(SecurityInterceptor.java:92)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
      me(LogInterceptor.java:120)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
      ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeH
      ome(EntityContainer.java:477)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
      :694)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFac
      tory.invokeHome(BaseLocalProxyFactory.java:272)
      14:43:07,311 ERROR [STDERR] at org.jboss.ejb.plugins.local.LocalHomeProxy.in
      voke(LocalHomeProxy.java:110)
      14:43:07,311 ERROR [STDERR] at $Proxy70.create(Unknown Source)
      14:43:07,311 ERROR [STDERR] at com.cranes.vrm.commodity.facade.ejb.Commodity
      FacadeBean.createCommodity(CommodityFacadeBean.java:126)
      14:43:07,311 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(
      Native Method)
      14:43:07,326 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(N
      ativeMethodAccessorImpl.java:39)
      14:43:07,326 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
      ke(DelegatingMethodAccessorImpl.java:25)
      14:43:07,326 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
      24)
      14:43:07,326 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$Conta
      inerInterceptor.invoke(StatelessSessionContainer.java:629)
      14:43:07,326 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
      nnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      14:43:07,326 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanc
      eInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      14:43:07,326 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
      nvokeNext(AbstractTxInterceptor.java:84)
      14:43:07,326 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
      hTransactions(TxInterceptorCMT.java:243)
      14:43:07,326 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
      (TxInterceptorCMT.java:104)
      14:43:07,342 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
      oke(SecurityInterceptor.java:117)
      14:43:07,342 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(L
      ogInterceptor.java:191)
      14:43:07,342 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
      ceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      14:43:07,342 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.inter
      nalInvoke(StatelessSessionContainer.java:322)
      14:43:07,342 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
      :674)
      14:43:07,342 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor127.invoke
      (Unknown Source)
      14:43:07,342 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invo
      ke(DelegatingMethodAccessorImpl.java:25)
      14:43:07,342 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:3
      24)
      14:43:07,342 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatc
      her.invoke(ReflectedMBeanDispatcher.java:284)
      14:43:07,342 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MB
      eanServerImpl.java:549)
      14:43:07,357 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invok
      e(LocalInvoker.java:101)
      14:43:07,357 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invok
      e(InvokerInterceptor.java:83)
      14:43:07,357 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke
      (TransactionInterceptor.java:46)
      14:43:07,357 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(Se
      curityInterceptor.java:45)
      14:43:07,357 ERROR [STDERR] at org.jboss.proxy.ejb.StatelessSessionIntercept
      or.invoke(StatelessSessionInterceptor.java:100)
      14:43:07,357 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(Client
      Container.java:85)
      14:43:07,357 ERROR [STDERR] at $Proxy87.createCommodity(Unknown Source)
      14:43:07,357 ERROR [STDERR] at com.cranes.vrm.commodity.delegate.CommodityDe
      legate.createCommodity(CommodityDelegate.java:56)
      14:43:07,357 ERROR [STDERR] at com.cranes.vrm.commodity.actions.CommodityAct
      ion.execute(CommodityAction.java:113)
      14:43:07,357 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro
      cessActionPerform(RequestProcessor.java:465)
      14:43:07,357 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro
      cess(RequestProcessor.java:274)
      14:43:07,357 ERROR [STDERR] at org.apache.struts.action.ActionServlet.proces
      s(ActionServlet.java:1422)
      14:43:07,357 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost
      (ActionServlet.java:523)
      14:43:07,357 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:760)
      14:43:07,357 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:853)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.internalDoFilter(ApplicationFilterChain.java:247)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.doFilter(ApplicationFilterChain.java:193)
      14:43:07,373 ERROR [STDERR] at com.cranes.vrm.signon.web.SignOnFilter.doFilt
      er(SignOnFilter.java:146)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.internalDoFilter(ApplicationFilterChain.java:213)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
      in.doFilter(ApplicationFilterChain.java:193)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve
      .invoke(StandardWrapperValve.java:256)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve
      .invoke(StandardContextValve.java:191)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.valves.CertificatesValve.
      invoke(CertificatesValve.java:246)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      14:43:07,373 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardContext.invo
      ke(StandardContext.java:2415)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.in
      voke(StandardHostValve.java:180)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.valves.ErrorDispatcherVal
      ve.invoke(ErrorDispatcherValve.java:171)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.i
      nvoke(ErrorReportValve.java:172)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.inv
      oke(AccessLogValve.java:509)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.
      invoke(StandardEngineValve.java:174)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$Sta
      ndardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      14:43:07,389 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.inv
      oke(StandardPipeline.java:480)
      14:43:07,404 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke
      (ContainerBase.java:995)
      14:43:07,404 ERROR [STDERR] at org.apache.coyote.tomcat4.CoyoteAdapter.servi
      ce(CoyoteAdapter.java:223)
      14:43:07,404 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.proc
      ess(Http11Processor.java:594)
      14:43:07,404 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http1
      1ConnectionHandler.processConnection(Http11Protocol.java:392)
      14:43:07,404 ERROR [STDERR] at org.apache.tomcat.util.net.TcpWorkerThread.ru
      nIt(PoolTcpEndpoint.java:565)
      14:43:07,404 ERROR [STDERR] at org.apache.tomcat.util.threads.ThreadPool$Con
      trolRunnable.run(ThreadPool.java:619)
      14:43:07,404 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
      14:43:07,420 ERROR [LogInterceptor] RuntimeException:
      java.lang.NullPointerException
      at com.cranes.vrm.commodity.facade.ejb.CommodityFacadeBean.createCommodi
      ty(CommodityFacadeBean.java:136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
      tatelessSessionContainer.java:629)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
      ke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
      elessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      04)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:117)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
      ryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessi
      onContainer.java:322)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)

      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
      a:83)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
      java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
      5)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessi
      onInterceptor.java:100)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy87.createCommodity(Unknown Source)
      at com.cranes.vrm.commodity.delegate.CommodityDelegate.createCommodity(C
      ommodityDelegate.java:56)
      at com.cranes.vrm.commodity.actions.CommodityAction.execute(CommodityAct
      ion.java:113)
      at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
      tProcessor.java:465)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
      va:274)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:142
      2)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:193)
      at com.cranes.vrm.signon.web.SignOnFilter.doFilter(SignOnFilter.java:146
      )
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:213)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
      .java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
      2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
      rValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
      509)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
      t.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
      a:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:22
      3)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :594)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:392)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
      :565)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
      ool.java:619)
      at java.lang.Thread.run(Thread.java:536)

        • 1. Re: Setting CMR fields in ejbPostCreate throws Exception
          Jan Radl Newbie

          Hi,

          I have the same problem. If you put some log message into the ejbPostCreate method you'll see nothing in the server.log. And this is the problem. JBoss don't wait with insert statement until ejbPostCreate is beeing precceded. I try to solve this problem for couple of days with no result. I need to migrate project from BES (which is work OK with ejb.cashCreate property) to JBoss and I'm really in trouble.

          Any help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

          Jan

          • 2. Re: Setting CMR fields in ejbPostCreate throws Exception
            jhbjava Newbie

            This is out of the CMP documentation:

            The current implementation of JBossCMP inserts a row into the database for a new entity between ejbCreate and ejbPostCreate. Since the
            EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null. There is a similar
            problem with removal. This limitation will be removed in a future release.

            • 3. Re: Setting CMR fields in ejbPostCreate throws Exception
              Raja Master

              Can you make it a DEFERRED check? I think you can do this with Oracle where the NOT NULL constraint check happens only at commit.
              This way even though the insert happens at ejbCreate, it wont be checked for constraints till commit time(which is after postCreate).

              -Raj