It's all about the answers!

Ask a question

Cannot call method "getDataConnector" error


Alicia McPherson (7131418) | asked Jun 21 '12, 2:52 p.m.
retagged Jun 21 '12, 3:27 p.m. by David Olsen (5237)
I'm getting the error below. Is anyone familiar with it and can suggest some solutions? Thanks!  

 org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getDataConnector" of undefined (CalculatedValueSkeleton.js#19)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3557)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3535)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3563)
    at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3582)
    at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3601)
    at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2160)
    at org.mozilla.javascript.gen.c253._c2(CalculatedValueSkeleton.js:19)
    at org.mozilla.javascript.gen.c253.call(CalculatedValueSkeleton.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
    at org.mozilla.javascript.gen.c253._c3(CalculatedValueSkeleton.js:44)
    at org.mozilla.javascript.gen.c253.call(CalculatedValueSkeleton.js)
    at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2347)
    at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:272)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:127)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)

Comments
David Olsen commented Jun 21 '12, 3:28 p.m.
JAZZ DEVELOPER

What were you trying to do when you got the error? Where does the error message appear?

2 answers



permanent link
Alicia McPherson (7131418) | answered Jun 21 '12, 4:04 p.m.
edited Jun 21 '12, 4:52 p.m.
Hi David, Thanks for responding. I was invoking the getFilteredValueSet method from another class. I'm trying to find a way to return a calculated value and still use the HttpConnector. See code sample below.

dojo.provide("org.example.workitems.providers.CalculatedValueSkeleton");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");

(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;

dojo.declare("myclass",null,{
               
        getFilteredValueSet: function(attributeId, workItem, context, filter) {
           
            var params= new HttpConnectorParameters();
            params.url= myURL;
            params.xpath= "//srnumber";
            params.columnXpaths= ["./nextnumber/@data"];
            params.columnIds= ["nextnumber"];
           
            var connector= context.getDataConnector("HttpConnector");
            var values= connector.get(params);
           
            var result= [];
            var srnumber = "";
            while(values.hasNext()){
                var entry= values.next();
                var nextsrnumber= entry.getById("nextnumber");
                if (nextsrnumber.indexOf(filter) > -1) {
                    result.push(nextsrnumber);
                    srnumber = nextsrnumber;
                }
            }
                 
              return srnumber;
        }     
       
       
});

dojo.declare("org.example.workitems.providers.CalculatedValueSkeleton", myclass, {

    constructor: function(attributeId, workItem, context, filter) {
   
            var srnvalue = new myclass();
            this.srnumber = srnvalue.getFilteredValueSet();
        },
       
    getValue: function(attributeId, workItem, configuration) {
       
        return this.srnumber;
       
    }
});
})();

permanent link
Vivek Jain (112) | answered Nov 19 '12, 8:24 a.m.
Hi Alicia,
are you able to get Connector Object, i am still getting "
getDataConnector" error"
.

Please help.


Comments
Alicia McPherson commented Nov 19 '12, 8:32 a.m.

Yes, I was able to get it to work. I imported myURL client certificate into the tomcat keystore.

Alicia


Neeraj Laad commented Jun 28 '13, 3:44 a.m.

Hi Alicia,

Can you please elaborate on what you did to resolve this issue.. I have a similar requirement. I need to have a scripted calculated value that relies on a REST call (Data Connector).

Thanks.


Prakash Behrani commented Sep 09 '13, 10:19 a.m.

Was anyone able to resolve this issue using the code provided in this thread.  The certificate issue I believe could be resolved by setting ignoreInvalidCertificates flag to "true" for params.  However, the context is still undefined and getConnectorData is failing.

I would appreciate any input on this.

Thanks.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.