Skip to content

Can not retrieve attribute value via /instance/getAttributeValue operation

When deployed as part of the ADOxxWeb API the /instance/getAttributeValue operation leads to a server error when the modelid, objectid and attributeid parameters are specified:
Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because "format" is null

java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because "format" is null
	org.adoxx.basis.read.AttributeReadImpl.getAttributeValue(AttributeReadImpl.java:49)
	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.base/java.lang.reflect.Method.invoke(Method.java:568)
	org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
	org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201)
	org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)
	org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
	org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
	org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
	org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
	org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265)
	org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
	org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
	org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:222)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
	org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

Using the same parameters to get the attribute value directly via /dao/execute worked:

  • AdoScript: CC "Core" LOAD_MODEL modelid:(91215) CC "Core" GET_ATTR_VAL objid:(91220) attrid:(89138) CC "Core" DISCARD_MODEL modelid:(91215)
  • AdoScriptResultVariable: val
  • dataType: string
  • URL for POST request: http://localhost:8080/ADOxxWEBAPI/services/rest/dao/execute?AdoScript=CC%20%22Core%22%20LOAD_MODEL%20modelid%3A(91215)%20CC%20%22Core%22%20GET_ATTR_VAL%20objid%3A(91220)%20attrid%3A(89138)%20CC%20%22Core%22%20DISCARD_MODEL%20modelid%3A(91215)&AdoScriptResultVariable=val&dataType=string
  • Response:
    {
      "result": "blubblub",
      "ecode": "0",
      "duration": 113,
      "startTime": "19.09.2025,10:34:14",
      "endTime": "19.09.2025,10:34:15",
      "script": {
        "script": "CC \"Core\" LOAD_MODEL modelid:(91215) CC \"Core\" GET_ATTR_VAL objid:(91220) attrid:(89138) CC \"Core\" DISCARD_MODEL modelid:(91215)\r\nSET adowsresponse:(val + \"@@@\" + STR ecode)",
        "name": null,
        "waitTime": "30000",
        "executeTime": "30000",
        "retries": "1",
        "userType": "usertype_one",
        "dataType": "string",
        "dbname": "adoxx18lbrs"
      },
      "errorText": "No error",
      "success": true
    }

The /instance/getAttributeValue operation seems to work when format is set to one empty space (http://localhost:8080/ADOxxWEBAPI/services/rest/instance/getAttributeValue?modelid=91215&objectid=91220&attributeid=89138&format=%20):

{
  "success": true,
  "startDate": "19.09.2025,10:42:42",
  "endDate": "19.09.2025,10:42:42",
  "script": "CC \"Core\" UPDATE_MODEL_LIST\r\nCC \"Core\" LOAD_MODEL modelid:(91215)\r\nCC \"Core\" GET_ATTR_VAL objid:(91220) attrid:(89138) format:(\" \") sep:(\"null\") as-string\r\nCC \"Core\" DISCARD_MODEL modelid:(91215)\r\nSET value:(toutf8(val))\r\nSET adowsresponse:(value + \"@@@\" + STR ecode)",
  "duration": 195,
  "ecode": "0",
  "errorText": "No error",
  "result": "blubblub"
}