cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Java SDK: ERROR java.util.concurrent.TimeoutException APIRequestMessage

maximilian
2-Explorer

Java SDK: ERROR java.util.concurrent.TimeoutException APIRequestMessage

Hello community,

good to be here, my question:

Use-Case: I have a DataTable with orders. A service (receiveNewOrder) is looking for new free orders for my machines. The machines are simulated with the Java Edge SDK.

 

Issue: Every time I run my Application which ist providing all machines in state 'IDLE' with new orders I get the following ERROR when trying to set machine (thing) property (CurrentOrder) to new order (String):
2020-08-11 12:57:00.346+0200 [L: ERROR] [O: S.c.t.d.e.DSLScript] [I: ] [U: Administrator] [S: ] [T: TWEventProcessor-4] Asset_M_011001.receiveNewOrder - Error [Line: 16]: JavaException: java.util.concurrent.TimeoutException: Timed out APIRequestMessage [requestId: 13, endpointId: -1, sessionId: -1, method: PUT, entityName: *xxxx_010719, characteristic: Properties, target: CurrentOrder]

 

 

logger.debug(me.name + ".receiveNewOrder started.");
try {
	var orderStatus = "FREI";
    var sortColumn = "Erdat";
	// result: INFOTABLE dataShape: "sapOrders"
    // FYI: getOrder is calling QueryDataTableEntries with query containing Status and Capability
	var fittingOrders = Things["orders"].getOrder({Status: orderStatus,	Capability: me.Capability});
    if (fittingOrders !== undefined && fittingOrders.length !== 0) {
    	var sort = new Object();
    	sort.name = sortColumn;
    	sort.ascending = true;
    	fittingOrders.Sort(sort);
    	var sortedOrders = fittingOrders;
        me.TargetQuantity = sortedOrders.getRow(0).Gamng;
        me.CurrentQuantity = sortedOrders.getRow(0).Prodmng;
        logger.warn(me.name + ".receiveNewOrder - found Order (" + sortedOrders.getRow(0).Aufnr + ") for machine: " + me.name + " - CurrentOrder: " + me.CurrentOrder);
    	me.CurrentOrder = sortedOrders.getRow(0).Aufnr; // <--- ERROR
    } else {
    	logger.info(me.name + ".receiveNewOrder - found NO fitting Order for machine: " + me.name);
    }
} catch (err) {
	logger.error(me.name + ".receiveNewOrder - Error [Line: " + err.lineNumber + "]: " + err);
}

logger.info(me.name + ".receiveNewOrder finished.");

 

 

Maybe I am locking the property? I am grateful for any help, thanks for your time in advance.


Additional Info: The error occurs every time when the orders are processed by the edge device which is simulating the machines. The error has as a consequence that one order gets the target quantity from the order which was the last to be produced. As it looks my service want to set the CurrentOrder Property but can't and then runs in the timeout above. But this is not always the case only from time to time.

Hardware: I am using the Manufacturing Apps Trail Edition on a Windows Server with:

  • 6 CPU vCores
  • 8 GB RAM (about 7 GB are in use)
  • 500 GB SSD/HDD

Attachments:

  • Edge Device consisting of two java classes.
  • The log messages from service.log.
0 REPLIES 0
Announcements


Top Tags