Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exception for rpc.send(dsRequest, dsResponse)

    I am usigng the following code on client side to update a treegrid record.

    Code:
    StoreDetails_TreeGrid.updateData(StoreDetails_TreeGrid.getSelectedRecord(),
    			"fnUpdateLocnTableCB(dsResponse,data,dsRequest)",null);
    and on the action side i have the following code:

    Code:
    	public String saveDetails() throws Exception {
    		DSRequest dsRequest = null;
    		DSResponse dsResponse = new DSResponse();
    		RPCManager objRpc = null;
    		Map<String, String> mpErrorResponseData =
    			new HashMap<String, String>();
    		MasterObjectLocation objMasterObjectLocn = 
    			new MasterObjectLocation();
    		List<MasterObjectLocation> lstMasterObjectLocn = 
    			new ArrayList<MasterObjectLocation>();
    
    		try {
    			objRpc = getRPCObject();
    			logger.debug("inside searchStoreCluster");
    			rpc = getRPCObject();
    			String strLocn = null;
    			PromoAdLocnService objPromoAdLocnServiceSLSB =
    				getPromoAdLocnService();
    			for (Iterator<?> i = rpc.getRequests().iterator(); i.hasNext();) {
    				Object req = i.next();
    				dsRequest = (DSRequest) req;
    				String dsName = dsRequest.getDataSourceName();
    				dsResponse.setSuccess();
    				logger.debug("Criterias" + dsRequest.getCriteria());
    				if ((dsRequest.getCriteria() != null)
    						|| (dsRequest.getCriteria().size() != 0)) {
    					String operation = dsRequest.getOperationType();
    					logger.debug("operation " + operation);
    					List<MasterObjectLocation> lstMstAdvLoc = new ArrayList<MasterObjectLocation>();
    
    					Map<String,Object> mpNewValuesAdLocn = dsRequest.getValues();
    
    					logger.debug("Old Values"+dsRequest.getOldValueSets());
    
    					Map<String,Object> mpOldValuesAdLocn = dsRequest.getOldValues();
    					MasterObjectLocation MstAdvLoc = new MasterObjectLocation();
    
    					MasterObjectLocationPK objMstAdLocationPK =
    						new MasterObjectLocationPK();
    
    					Object dtEffDate = mpOldValuesAdLocn.get("dtEffDate");
    					if( dtEffDate instanceof java.util.Date){
    						objMstAdLocationPK.setDtEffectiveDate(new java.sql.Date(((java.util.Date)dtEffDate).getTime()));
    					}else{
    						objMstAdLocationPK.setDtEffectiveDate(PromoWebUtils.convertStringToSqlDate(dtEffDate.toString()));
    					}
    					
    					strLocn = (String) mpOldValuesAdLocn.get("iLocnNumber");
    					objMstAdLocationPK.setSLocnNumber(Short.valueOf(strLocn));
    					MstAdvLoc.setObjMasterObjectLocnPK(objMstAdLocationPK);
    
    					lstMstAdvLoc.add(MstAdvLoc);
    					for (MasterObjectLocation MasterObjectLocation
    							: lstMstAdvLoc) {
    						logger.debug("loc: "
    								+ MasterObjectLocation
    								.getObjMasterObjectLocnPK()
    								.getSLocnNumber());
    					}
    
    					PromoAdLocnService promoAdLocnServiceSLSB =
    						getPromoAdLocnService();
    					promoAdLocnServiceSLSB.saveAdLocnDetails(lstMstAdvLoc);
    				}
    			}
    		} catch (PromoFailureException fe) {
    			mpErrorResponseData.put(PromoExceptionConstants.TYP_ERR_MSG,
    					PromoErrorMessage.buildErrorMessage(fe
    							.getPromoErrorMessage()));
    			dsResponse.setData(mpErrorResponseData);
    			dsResponse.setStatus(RPCResponse.STATUS_FAILURE);
    		} catch (Throwable t) {
    			mpErrorResponseData.put("someKey","somemessage");
    							
    			dsResponse.setData(mpErrorResponseData);
    			dsResponse.setStatus(RPCResponse.STATUS_FAILURE);
    		} 
    		try{
    		objRpc.send(dsRequest, dsResponse);  ///This line thrrows error
    		/*
    		java.lang.Exception: No response for request: com.isomorphic.datasource.DSRequest@1d9a1d9a
    			at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:837)
    			at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494)
    			at com.shc.impact.promo.ui.market.action.PromoAdLocnAction.saveAdLocnDetails(PromoAdLocnAction.java:4538)
    		       .......
    		       ......
    		*/
    		}catch(Exception ex){
    			ex.printStackTrace();
    		}
    		return null;
    	}
    I am getting an exception when the code executes
    objRPC.send(dsRequest,dsResponse);

    Is there anything wrong with this ?
    I am not getting this error when i do a fetch operation.
    Last edited by ypoovil; 22 Jun 2010, 17:01.

    #2
    Post the server logs with the exception.

    We ask for the same thing every time. Please get used to providing it without needing to be asked.

    Comment


      #3
      following is what i get in my server console:


      Code:
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R java.lang.Exception: No response for request: com.isomorphic.datasource.DSRequest@273c273c
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:837)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.shc.impact.promo.ui.market.action.PromoAdLocnAction.saveAdLocnDetails(PromoAdLocnAction.java:4548)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at java.lang.reflect.Method.invoke(Method.java:618)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      [6/23/10 16:57:23:859 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
      [6/23/10 16:57:23:875 CDT] 0000004e SystemErr     R 	at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
      ....................................
      ..............................
      ..........................
      There are many morelines....

      Comment


        #4
        OK, that seems pretty self-explanatory - you can't pass a null response to RPCManager.send().

        Comment


          #5
          My Response object is not null.
          You can have a look in the first post, I have instantiated it.

          I have checked it in debug mode and i can see instantiated request and response objects.

          Comment


            #6
            The response is clearly null. The only thing we can suggest is that you have a multi-threading bug such as using the same RPCManager instance in multiple different servlets, which is invalid.

            Comment

            Working...
            X