That's complete nonsense. You already provided the RPCManager to this dsRequest instance, so it already had a requestContext. And that's the requestContext where you have gotten an error message saying that requestContext.servletContext is missing.
So, either something you told us before isn't true, or you are in a "two wrongs make a right" situation where you created a problem through bad usage and then "fixed" it through more bad usage.
We would recommend looking into how you actually broke things in the first place - probably some bad servlet-level code as we mentioned before - rather than considering it "resolved".
Announcement
Collapse
No announcement yet.
X
-
Resolved it using the below code :
Code:dsRequestB.setContext(rpcManager.getContext());
Leave a comment:
-
Normally, the RPCManager and RequestContext is created in the IDACall servlet, in processRequest(). Somehow you've broken that process, possibly with an override of the IDACall servlet, or maybe with a servlet you've put in front of IDACall.
Whatever the problem, it has nothing to do with the code you've shown so far.
Leave a comment:
-
New DSRequest from service is failing
Hi,
I am trying to make a DSRequest fetch from service using new DSRequest() and I am getting following exception :
Code:java.lang.Exception: RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call. at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:225) at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:70)
Code:@Override public DSResponse fetch(final DSRequest req, final RPCManager rpcManager) throws Exception { // Execute Another DS Fetch final DSRequest dsRequest= new DSRequest("DatasourceB", DS_OPERATIONTYPE_FETCH); dsRequest.execute(); //this line is throwing exception }
Code:dsRequest.setRPCManager(rpcManager);
The DatasourceB fetch is given below:
Code:<operationBindings> <operationBinding operationType="fetch"> <serverObject lookupStyle="spring" bean="myService" className="com.test.MyServiceImpl" /> </operationBinding> </operationBindings>
Code:@Override public DSResponse fetch(final DSRequest dsRequest,final RPCManager rpcManager) throws Exception { // some logic return dsRequest.execute(); }
Tags: None
Leave a comment: