Running into this error durring a ModelDataService.write(). The error is java.lang.IllegalArgumentException: No such custom model: null which does not make sense because my model has no custom models defined in the SPT. It only exists in the MPT as a "Plan.model". Help?
Here are the objects just before the write call mds.write(plans, context);
Here is the debug from JBOSS
16:16:35,394 INFO (uler_0 zombie 3) [ SdkModuleImpl] Using class com.onenetwork.fdpe.model.ObjectFactory as ObjectFactory for FDPE
16:16:35,403 ERROR (uler_0 zombie 3) [ ModelAccessorBean] Model.executeWriteRequest failed
java.lang.IllegalArgumentException: No such custom model: null
at com.transcendsys.platform.base.sco.ModelAccessorHelper.changeNaturalKeysIfChanged(ModelAccessorHelper.java:411)
at com.transcendsys.platform.server.model.ModelAccessorBean.changeNaturalKey(ModelAccessorBean.java:1588)
at com.transcendsys.platform.server.model.ModelAccessorBean.executeWriteRequest(ModelAccessorBean.java:649)
at com.transcendsys.platform.server.model.ModelAccessorBean.write(ModelAccessorBean.java:535)
at com.transcendsys.platform.server.model.ModelAccessorBean.write(ModelAccessorBean.java:522)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy205.write(Unknown Source)
at com.transcendsys.platform.data.model.ModelDataServiceImpl.write(ModelDataServiceImpl.java:266)
at com.onenetwork.fdpe.pex.PexUtil.savePlan(PexUtil.java:75)
at com.onenetwork.fdpe.pex.PexFileReader.debugImportFilesPex(PexFileReader.java:90)
at com.onenetwork.fdpe.mpt.FDPE_Plan.wf.TestPexParser.execute(TestPexParser.java:19)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeIntrinsicWorkflow(WorkflowExecutorBean.java:240)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeCallbacksWithWorkflow(WorkflowExecutorBean.java:199)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeWorkflow(WorkflowExecutorBean.java:142)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeWorkflow(WorkflowExecutorBean.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy262.executeWorkflow(Unknown Source)
at com.transcendsys.platform.server.workflow.WorkflowManager.executeJWorkflow(WorkflowManager.java:86)
at com.transcendsys.platform.server.workflow.WorkflowManager.executeWorkflow(WorkflowManager.java:42)
at com.transcendsys.platform.server.workflow.WorkflowScheduleRunnable.run(WorkflowScheduleRunnable.java:127)
at com.transcendsys.platform.base.util.scheduler.grid.SchedulerTaskPerformer.performTask(SchedulerTaskPerformer.java:56)
at com.transcendsys.platform.base.grid.TaskProcessingThread.setContextAndPerformTask(TaskProcessingThread.java:199)
at com.transcendsys.platform.base.grid.TaskPerformingWrapperBean.performTaskCatchAll(TaskPerformingWrapperBean.java:137)
at com.transcendsys.platform.base.grid.TaskPerformingWrapperBean.performTask(TaskPerformingWrapperBean.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy208.performTask(Unknown Source)
at com.transcendsys.platform.base.grid.TaskProcessingThread.tryToPerformTask(TaskProcessingThread.java:160)
at com.transcendsys.platform.base.grid.TaskProcessingThread.performTask(TaskProcessingThread.java:122)
at com.transcendsys.platform.base.grid.TaskProcessingThread.access$000(TaskProcessingThread.java:38)
at com.transcendsys.platform.base.grid.TaskProcessingThread$1.run(TaskProcessingThread.java:392)
at java.lang.Thread.run(Thread.java:722)
16:16:35,482 WARN (uler_0 zombie 3) [ WrappedSessionContext] ROLLBACK WARNING - the transaction has been marked for rollback. Subsequent commit will fail. Set com.onenetwork.platform.tools.ejb.i
mpl.WrappedSessionContext to DEBUG for a full stack trace
16:16:35,492 INFO (uler_0 zombie 3) [ustomJavaWorkflowActivity] Exception thrown from com.onenetwork.fdpe.mpt.FDPE_Plan.wf.TestPexParser: com.transcendsys.platform.base.exception.ServiceRuntimeExcept
ion: Transaction Write Error
16:16:35,518 WARN (uler_0 zombie 3) [ WrappedSessionContext] ROLLBACK WARNING - the transaction has been marked for rollback. Subsequent commit will fail. Set com.onenetwork.platform.tools.ejb.i
mpl.WrappedSessionContext to DEBUG for a full stack trace
16:16:35,518 ERROR (uler_0 zombie 3) [ WorkflowScheduleRunnable] Error in workflow: FDPE.TestPexParser
com.transcendsys.platform.server.workflow.WorkflowBaseException: Transaction Write Error
at com.transcendsys.platform.server.workflow.activity.CustomJavaWorkflowActivity.handleWorkflowException(CustomJavaWorkflowActivity.java:149)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeCallbacksWithWorkflow(WorkflowExecutorBean.java:220)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeWorkflow(WorkflowExecutorBean.java:142)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeWorkflow(WorkflowExecutorBean.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy262.executeWorkflow(Unknown Source)
at com.transcendsys.platform.server.workflow.WorkflowManager.executeJWorkflow(WorkflowManager.java:86)
at com.transcendsys.platform.server.workflow.WorkflowManager.executeWorkflow(WorkflowManager.java:42)
at com.transcendsys.platform.server.workflow.WorkflowScheduleRunnable.run(WorkflowScheduleRunnable.java:127)
at com.transcendsys.platform.base.util.scheduler.grid.SchedulerTaskPerformer.performTask(SchedulerTaskPerformer.java:56)
at com.transcendsys.platform.base.grid.TaskProcessingThread.setContextAndPerformTask(TaskProcessingThread.java:199)
at com.transcendsys.platform.base.grid.TaskPerformingWrapperBean.performTaskCatchAll(TaskPerformingWrapperBean.java:137)
at com.transcendsys.platform.base.grid.TaskPerformingWrapperBean.performTask(TaskPerformingWrapperBean.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy208.performTask(Unknown Source)
at com.transcendsys.platform.base.grid.TaskProcessingThread.tryToPerformTask(TaskProcessingThread.java:160)
at com.transcendsys.platform.base.grid.TaskProcessingThread.performTask(TaskProcessingThread.java:122)
at com.transcendsys.platform.base.grid.TaskProcessingThread.access$000(TaskProcessingThread.java:38)
at com.transcendsys.platform.base.grid.TaskProcessingThread$1.run(TaskProcessingThread.java:392)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.transcendsys.platform.base.exception.ServiceRuntimeException: Unable to write the models to the database
at com.transcendsys.platform.data.model.ModelDataServiceImpl.write(ModelDataServiceImpl.java:273)
at com.onenetwork.fdpe.pex.PexUtil.savePlan(PexUtil.java:75)
at com.onenetwork.fdpe.pex.PexFileReader.debugImportFilesPex(PexFileReader.java:90)
at com.onenetwork.fdpe.mpt.FDPE_Plan.wf.TestPexParser.execute(TestPexParser.java:19)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeIntrinsicWorkflow(WorkflowExecutorBean.java:240)
at com.transcendsys.platform.server.workflow.WorkflowExecutorBean.executeCallbacksWithWorkflow(WorkflowExecutorBean.java:199)
... 54 more
Caused by: com.transcendsys.platform.server.trans.write.TransWriteException: Transaction Write Error
at com.transcendsys.platform.server.model.ModelAccessorBean.executeWriteRequest(ModelAccessorBean.java:703)
at com.transcendsys.platform.server.model.ModelAccessorBean.write(ModelAccessorBean.java:535)
at com.transcendsys.platform.server.model.ModelAccessorBean.write(ModelAccessorBean.java:522)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy205.write(Unknown Source)
at com.transcendsys.platform.data.model.ModelDataServiceImpl.write(ModelDataServiceImpl.java:266)
... 59 more
Caused by: java.lang.IllegalArgumentException: No such custom model: null
at com.transcendsys.platform.base.sco.ModelAccessorHelper.changeNaturalKeysIfChanged(ModelAccessorHelper.java:411)
at com.transcendsys.platform.server.model.ModelAccessorBean.changeNaturalKey(ModelAccessorBean.java:1588)
at com.transcendsys.platform.server.model.ModelAccessorBean.executeWriteRequest(ModelAccessorBean.java:649)
... 82 more
16:16:35,615 INFO (uler_0 zombie 3) [TaskPerformingWrapperBean] Did not complete Task 'DTBScheduler': TaskPerformer's transaction context setRollbackOnly, taskState=null, sysTaskId=61272, attemptCoun
t=1
16:16:35,637 WARN (uler_0 zombie 3) [ WrappedSessionContext] ROLLBACK WARNING - the transaction has been marked for rollback. Subsequent commit will fail. Set com.onenetwork.platform.tools.ejb.i
mpl.WrappedSessionContext to DEBUG for a full stack trace
Each and every model has a custom model name even though it's not shown in SPT explicitely it will be auto-generated during jboss startup (mpt/spt submit). Default custom model name has following pattern "Standard " + ModelType. In your case it should be Standard FDPE.Plan
Fixed by adding model type as suggested. Changed:
ModelList<plan> plans = new ModelList<plan>("PLT.Create", plan);
mds.write(plans, context);
to
ModelList<plan> plans = new ModelList<plan>("Standard FDPE.Plan", "PLT.Create", plan);
mds.write(plans, context);