cancel
Showing results for 
Search instead for 
Did you mean: 

Strange internal server error

Former Member
0 Kudos

Hi,

Every now and then we receive the java stack trace when trying to initalise a custom Web Dynpro application - i.e. navigating to it in our portal.

Anyone have any ideas what is causing it?

[code]com.sap.mw.jco.JCO$Exception: (132) JCO_ERROR_CONCURRENT_CALL: Concurrent call. Connection currently used in another thread.

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: failed to create or init instance of model 'com.atosorigin.jsg.shape.model.PurchaseModel' in scope APPLICATION_SCOPE with instanceId 'null'

at com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getOrCreateModelInstanceFromScopeMaintainer(WDModelFactory.java:340)

at com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getModelInstance(WDModelFactory.java:154)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass._associatedModel(DynamicRFCModelClass.java:204)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.associatedModelClassInfo(DynamicRFCModelClass.java:218)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.elementIndexForFrontendName(DynamicRFCModelClass.java:1362)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.setAttributeValueAsBoolean(DynamicRFCModelClass.java:532)

at com.atosorigin.jsg.shape.model.Z_Ep_My_Buildings_Input.setDebug_On(Z_Ep_My_Buildings_Input.java:222)

at com.atosorigin.jsg.shape.TripSelCustom.wdDoInit(TripSelCustom.java:283)

at com.atosorigin.jsg.shape.wdp.InternalTripSelCustom.wdDoInit(InternalTripSelCustom.java:310)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingCustomController.doInit(DelegatingCustomController.java:73)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

at com.sap.tc.webdynpro.progmodel.controller.Component.getCustomControllerInternal(Component.java:436)

at com.sap.tc.webdynpro.progmodel.controller.Component.getMappableContext(Component.java:374)

at com.sap.tc.webdynpro.progmodel.controller.Component.getMappableContext(Component.java:403)

at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.initAttributeMapping(MappedAttributeInfo.java:308)

at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.init(MappedAttributeInfo.java:267)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.initAttributes(NodeInfo.java:672)

at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:233)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:657)

at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:199)

at com.sap.tc.webdynpro.progmodel.controller.Component.getCustomControllerInternal(Component.java:436)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createComponentInternal(ComponentUsage.java:161)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createComponent(ComponentUsage.java:110)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createInstanceIfDemanded(ComponentUsage.java:699)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.getInterfaceControllerInternal(ComponentUsage.java:340)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.getControllerInternal(ComponentUsage.java:381)

at com.sap.tc.webdynpro.progmodel.controller.Component.getMappableContext(Component.java:408)

at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.initAttributeMapping(MappedAttributeInfo.java:308)

at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.init(MappedAttributeInfo.java:267)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.initAttributes(NodeInfo.java:672)

at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:233)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:657)

at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:199)

at com.sap.tc.webdynpro.progmodel.controller.Component.getCustomControllerInternal(Component.java:436)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createComponentInternal(ComponentUsage.java:161)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createComponent(ComponentUsage.java:110)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.createInstanceIfDemanded(ComponentUsage.java:699)

at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.getImplementingInterfaceViewInfo(ComponentUsage.java:397)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.getViewManagerFor(ClientComponent.java:295)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.createUninitializedView(ViewManager.java:457)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:523)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.bind(ViewManager.java:397)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:554)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:421)

at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:130)

at com.sap.tc.webdynpro.progmodel.view.InterfaceView.initController(InterfaceView.java:41)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.displayToplevelComponent(ClientComponent.java:135)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:404)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:618)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged1(Native Method)

at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java(Compiled Code))

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java(Compiled Code))

Caused by: com.sap.tc.webdynpro.progmodel.model.api.WDModelException: failed to create instance of model 'com.atosorigin.jsg.shape.model.PurchaseModel'

at com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getNewModelInstance(WDModelFactory.java:391)

at com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getOrCreateModelInstanceFromScopeMaintainer(WDModelFactory.java:328)

... 74 more

Caused by: com.sap.mw.jco.JCO$Exception: (132) JCO_ERROR_CONCURRENT_CALL: Concurrent call. Connection currently used in another thread.

at com.sap.mw.jco.JCO$Client.execute(JCO.java(Compiled Code))

at com.sap.mw.jco.JCO$Client.execute(JCO.java:3320)

at com.sap.mw.jco.JCO$Repository.execute(JCO.java:19904)

at com.sap.mw.jco.JCO$Repository.queryFunctionInterface(JCO.java:20263)

at com.sap.mw.jco.JCO$Repository.queryFunctionInterface(JCO.java:19939)

at com.sap.mw.jco.JCO$Repository.getFunctionInterface(JCO.java:20053)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.RFCMetadataRepository.getJcoMetadataForFunction(RFCMetadataRepository.java:64)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.metadata.DRFCModelInfo.getOrCreateClassInfo(DRFCModelInfo.java:204)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.metadata.DRFCModelInfo.<init>(DRFCModelInfo.java:164)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.metadata.DRFCModelInfo$Cache.getModelInfo(DRFCModelInfo.java:103)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModel.<init>(DynamicRFCModel.java:111)

at com.atosorigin.jsg.shape.model.PurchaseModel.<init>(PurchaseModel.java:515)

at com.atosorigin.jsg.shape.model.PurchaseModel.<init>(PurchaseModel.java:490)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java(Compiled Code))

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))

at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))

at java.lang.Class.newInstance3(Class.java(Compiled Code))

at java.lang.Class.newInstance(Class.java(Compiled Code))

at com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getNewModelInstance(WDModelFactory.java:385)

... 75 more

[/code]

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi,

Thanks for the link, I'd not seen it before. Unfortunately it doesn't really help much... I don't understand how this can happen with a Web Dynpro application?!

Gareth.

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Kill the connection after use.

try {

NewModel model = (NewModel)WDModelFactory.getModelInstance(NewModel.class);

model.disconnectIfAlive();

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("Exception "+e,true);

}

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

> Hi,

> Kill the connection after use.

>

> try {

>

> NewModel model =

> (NewModel)WDModelFactory.getModelInstance(NewModel.cla

> ss);

>

> model.disconnectIfAlive();

>

> }

>

> catch(Exception e)

>

> {

>

> wdComponentAPI.getMessageManager().reportException("Ex

> ception "+e,true);

>

> }

>

> Regards,

> Vijayakhanna Raman

But this should't effect the application when it is first run from the portal which is when we see the error. We never see it whilst using the application - only when it is first initalised.

Gareth.

vijayakhanna_raman
Active Contributor
0 Kudos

hi,

In case the exception was thrown on the ABAP side, check the function module or BAPI in se37 or se80

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

> hi,

> In case the exception was thrown on the ABAP side,

> , check the function module or BAPI in se37 or se80

>

> Regards,

> Vijayakhanna Raman

Hi,

The exception being raised is related to concurrent JCo connections being used in multiple threads. I don't see what this has to do with ABAP?! As I've said, the applications work correctly most of the time, just every now and then one of them will raise the above exception when first started.

Gareth.

Former Member
0 Kudos

Hi,

Can you increase Maximum connection and Maximum pool size in portal while Jco creation?.

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S

Answers (2)

Answers (2)

former_member85655
Active Participant
0 Kudos

Hi Gareth,

This is not your fault. Its a bug in the Webdynpro runtime, which has since been fixed by SAP. Please move to the late SP and you will not have this problem.

This happens when more than one instances of your application are trying to access the same JCO destinations and running into concurrent access problems. The fix has put a synchronization block around this.

REgards,

Arun

Former Member
0 Kudos

Hi Arun,

Thanks very much for your answer. Do you know what SP it was fixed in as we are currently on SP16?

Thanks,

Gareth.

Former Member
0 Kudos

Arun,

1. Is this problem related to data connection or metadata connection?

2. At what object it is necessary to synchronize? ModelClass.class or something else?

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

> Arun,

>

> 1. Is this problem related to data connection or

> metadata connection?

> 2. At what object it is necessary to synchronize?

> ModelClass.class or something else?

>

> Valery Silaev

> EPAM Systems

> http://www.NetWeaverTeam.com

Hi Valery,

1. I think it is the model data connection as it seems to fail when trying to first call the backend system as we have some applications that need to call the backend system to get data for their initial screens. So in the wdDoInit of our controller we set up our contexts correctly and then call the backend to populate some drop-downs. 1 in every 1000 times we get the exception.

2. Don't know!

Gareth.

former_member85655
Active Participant
0 Kudos

Hi Valery/ Gareth,

This is due to insufficient synchronization when using the JCO destination for loading Adaptive RFC model metadata. As the problem depends on multiple reads

accessing the same resource (like WD application thread 2 tries to access JCO metadata destination which is currently used by WD app thread 1) the occurrence of the problem depends on thread scheduling .

The application doesnt have to worry about the synchronization. This is handled by the framework. But I guess this is available from SP16. Check SAP note #913297

Regards,

Arun

Former Member
0 Kudos

Hi,

Please test the Jco connection using 'testconnection' button on portal. Otherwise remove and create Jco connection.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi,

The JCo connection works fine 99.99% of the time (and has done for about 4 months) - just every now and then it raises the exception above. We don't understand why!

Gareth.