cancel
Showing results for 
Search instead for 
Did you mean: 

failed to create or init instance of model in scope TASK_SCOPE

Former Member
0 Kudos

Hi All,

When I execute an adaptive RFC Model using WD Java application I receive the following error -

failed to create or init instance of model 'com.sap.tc.webdynpro.progmodel.model.core.Model' in scope TASK_SCOPE with instanceId 'null'

What can be the problem?

Any help is highly appreciated.

Thanks,

Divya

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Divya,

I feel the error is in 1st line itself. It seems the factory class is not able to create a model instance of scope type TASK_SCOPE.

Try to create an instance with the default APPLICATION_SCOPE. (You can refer ppt slide 39 for different possible model instance scope https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/705f2b2e-e77d-2b10-de8a-95f37f4c...

Or alternatively create model instance directly - Model model = new Model();

Kind Regards,

Nitin

Former Member
0 Kudos

Thank you all. I had to restart the J2EE server and also have the cache refreshed to have this resolved.

Former Member
0 Kudos

Hi Divya,

We are also facing the same problem in Production environment.we restarted the J2EE engine, but the prob still remains. Can you plz tell which cache needs to be cleared. I mean can you tell the process of clearing the cache.

Thanks.

Sonali.

Former Member
0 Kudos

Hii,

I think you should debug the application by setting a break-point at the ABAP code.Then only you will be able to trace where the flow is exactly going wrong.Sit with your ABAPer and debug....

Former Member
0 Kudos

Hii,

Did u create a instane of the model in wdDoInit() method of custom controller like :

wdContext.nodeZsm_Calc_Csi_Report_Input().bind(new Zsm_Calc_Csi_Report_Input());

Please check with that.

Former Member
0 Kudos

Yes I did This is what I have

Model model = (Model)WDModelFactory.getModelInstance(Model.class,WDModelScopeType.TASK_SCOPE);

Zmhcr_Bapi_Contexto_Webdynpro_Input modelObject = (Zmhcr_Bapi_Contexto_Webdynpro_Input)model.createModelObject(Zmhcr_Bapi_Contexto_Webdynpro_Input.class);

wdContext.nodeZmhcr_Bapi_Contexto_Webdynpro_Input().bind(modelObject);

modelObject.setTP(bpContext.getBp());

modelObject.setTT(tType);

modelObject.setI_Claveobc(coType);

wdContext.currentZmhcr_Bapi_Contexto_Webdynpro_InputElement().modelObject().execute();

What can be wrong? This working fine. But, I am having all weird errors after the input parameters in the backend BAPI changed and I reimported the model.

Any help is highly appreciated.

Thanks,

Divya

former_member197348
Active Contributor
0 Kudos

Hi Divya,

Try like this:


Model model = (Model)WDModelFactory.getModelInstance(Model.class,WDModelScopeType.TASK_SCOPE);
Zmhcr_Bapi_Contexto_Webdynpro_Input modelObject = new Zmhcr_Bapi_Contexto_Webdynpro_Input();
wdContext.nodeZmhcr_Bapi_Contexto_Webdynpro_Input().bind(modelObject);
modelObject.setTP(bpContext.getBp());
modelObject.setTT(tType);
modelObject.setI_Claveobc(coType); 
wdContext.currentZmhcr_Bapi_Contexto_Webdynpro_InputElement().modelObject().execute();

Please mention where exactly you are getting error (line ), if it doesn't solve your issue.

Regards,

Siva