Hi
We have used $AJAX_URL in our component. It is forming the dynamic link with a self generated id. However sometimes we are receiving '500 Internal Server Error'.
Please advice asap.
Thanks & Regards
Akanksha
Have you checked the server logs?
Thanks, checked server logs and found below error :
Caused by: java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated.Make sure to release the connection before allocating another one.
Akanksha Singh
I don't know why you'd be using that class, but that's WAY not enough context. If you're sure that this is the actual error pertaining to the $AJAX_URL not working and that it's not some red herring related to another issue, then post the full stack trace and any relevant information leading up to it.
It is using that class because our system is giving a call to web services. Please find the logs stack trace below :
08:14:58,177 ERROR [RuntimeRenderingManager] Unhandled exception thrown during renderingcom.interwoven.livesite.runtime.rendering.RenderingException: Unable to write Ajax output at com.interwoven.livesite.runtime.rendering.RenderingManager.doOutputAjax(RenderingManager.java:1305) at com.interwoven.livesite.runtime.rendering.RenderingManager.renderAjaxGoal(RenderingManager.java:398) at com.interwoven.livesite.runtime.rendering.RenderingManager.render(RenderingManager.java:251) at com.interwoven.livesite.runtime.filter.LiveSiteFilter.doFilter(LiveSiteFilter.java:136) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)Caused by: java.lang.RuntimeException: Failed to execute rules and externals at com.interwoven.livesite.runtime.model.component.Component.executeExternal(Component.java:455) at com.interwoven.livesite.runtime.model.page.RuntimeComponent.buildComponentTransformData(RuntimeComponent.java:272) at com.interwoven.livesite.runtime.model.page.RuntimePage.buildComponentRenderingModel(RuntimePage.java:488) at com.interwoven.livesite.runtime.rendering.RenderingManager.doOutputAjax(RenderingManager.java:1255) ... 15 moreCaused by: java.lang.RuntimeException: Execution exception in com.interwoven.livesite.external.ExternalCall@7c2bc51f[object=com.gec.ls.core.display.external.EApplyFormExternal,method=public org.dom4j.Document executeExternal(com.interwoven.livesite.runtime.RequestContext,),scope=local,parameters={},prefixCalls=[]] at com.interwoven.livesite.common.pojo.PojoMethodCall.execute(PojoMethodCall.java:460) at com.interwoven.livesite.external.ExternalCall.execute(ExternalCall.java:142) at com.interwoven.livesite.runtime.model.component.Component.executeExternal(Component.java:426) ... 18 more
Caused by: java.lang.RuntimeException: Could not invoke method: executeExternal, reason: Invalid use of SingleClientConnManager: connection still allocated.Make sure to release the connection before allocating another one. at com.interwoven.livesite.common.util.ClassUtils.executeMethod(ClassUtils.java:113) at com.interwoven.livesite.common.pojo.PojoMethodCall.executeMethod(PojoMethodCall.java:401) at com.interwoven.livesite.common.pojo.PojoMethodCall.execute(PojoMethodCall.java:455) ... 20 moreCaused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.interwoven.livesite.common.util.ClassUtils.executeMethod(ClassUtils.java:105) ... 22 moreCaused by: java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated.Make sure to release the connection before allocating another one. at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:199) at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:173) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:390) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554) at com.gec.ls.dao.WebServiceDAO.put(WebServiceDAO.java:193) at com.gec.ls.core.display.external.helper.WebServiceHelper.submitData(WebServiceHelper.java:19) at com.gec.ls.core.display.external.helper.EapplyHelper.generateOTP(EapplyHelper.java:342) at com.gec.ls.core.display.external.helper.EapplyHelper.executeRequest(EapplyHelper.java:266) at com.gec.ls.core.display.external.EApplyFormExternal.executeExternal(EApplyFormExternal.java:30) ... 26 more
The bottom line is that your com.gec.ls.dao.WebServiceDAO.put() method is not thread-safe and you're getting multiple concurrent calls to it. So either synchronize the method or the relevant block, or use a connection pool rather than a single http connection. This may also require you to change some of the related code to also make that thread-safe.