Highlighted

service is undefined error (cf11)

Participant ,
Jul 18, 2018

Copy link to clipboard

Copied

I am having an issue with services not being recognized.  I am running CF 11 on a VM with win2012R2.  This is dev box so the permissions are 777 from webroot to file.

right now I am just trying to retrieve a list of cases from the DB and display them to the user.

I am getting the following

Error: Element CASESERVICE is undefined in a Java object of type class [Ljava.lang.String;.

Type: Expression

the Code:

controller:

component  displayname='case'name='case controller' accessors="true"

{

property caseservice;

writeLog(type='info', file='erctsTRACE', text='enter case controller');

public any function init( fw ) {

variables.fw = fw;

return this;

}

public any function default( rc ){

param name = 'rc' type='struct';

writeLog(type='info', file='erctsTRACE', text='enter default()');

//rc.a = 1 ;

        //rc.b = 3;

        //rc.c = rc.a + rc.b;

        //writedump(var=rc.c, abort=false);

writeLog(type='info', file='erctsTRACE', text='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

writeLog(type='info', file='erctsTRACE', text='call variables.caseservice.getcaselist()');

       rc.cl = variables.caseservice.getcaselist();

writeLog(type='info', file='erctsTRACE', text='exit variables.caseservice.getcaselist()');

writeLog(type='info', file='erctsTRACE', text='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

       writedump(var=rc.cl, abort=true,label='case list from caseservice');

writeLog(type='info', file='erctsTRACE', text='exit default function'); 

}

///////////////////////////////////////////

Case service:

component displayname='case service' accessors="true" {

writeLog(type='info', file='erctsTRACE', text='enter case service-');

function getcaselist(){

writeLog(type='info', file='erctsTRACE', text='enter getcaselist -');

try{

clistqry = new Query();

        clistqry.setSQL("SELECT erCase.caseNum,

       erCase.caseEmpID,

       erCase.dteRecieved,

       erCase.caseOrg,

       erCase.caseOffice,

       erCase.caseIssueDscr,

       erCase.caseOffense,

       erCase.casePropOff,

       erCase.caseDecOff,

       erCase.casePropDisc,

       erCase.caseID,

       erCase.erGradeid,

       erCase.caseTypeId,

        erCaseType.caseTypeShort,

erCaseType.caseType,

       erCase.caseDatePropIss,

       erCase.caseAppeal,

       erCase.caseAppealDte,

       erCase.caseDecision,

       erCase.caseDecisDte,

       erCase.caseCloseDte,

       erCase.caseSuspDte,

       erCase.caseRepRemoveDate,

       erCase.comment,

       erCase.caseModBy,

       erCase.caseModDte,

        erCase.status,

       erCase.valid_Flag,

       PERSONAL_V.LAST_NAME,

       PERSONAL_V.FIRST_NAME,

       PERSONAL_V.VALID_FLAG,

       PERSONAL_V.JOB_TITLE,

       erGrade.erGradeLevel,

       erGrade.erGradeValid

FROM ((ercts.dbo.erCase erCase

         INNER JOIN ercts.dbo.erCaseType erCaseType

            ON (erCase.caseTypeId = erCaseType.caseTypeId))

        INNER JOIN ercts.dbo.PERSONAL_V PERSONAL_V

           ON (erCase.caseEmpID = PERSONAL_V.EMP_ID))

       INNER JOIN ercts.dbo.erGrade erGrade

          ON (erCase.erGradeid = erGrade.erGradeId)

WHERE (PERSONAL_V.VALID_FLAG = 'Y') AND (erGrade.erGradeValid = 'Y')");

        cl = clistqry.execute();

       caseList = cl;

        return caseList;

}

catch (expression e) {

        WriteOutput("<p>An Expression exception was thrown.</p>");

    WriteOutput("<p>#e.message#</p>");

       }

/////////////////////////////////

the rc.a .... above executes perfectly

if i put the clistqry  in the view; it works perfectly so the DB connection and query are fine.

This dies before it ever gets out of the controller

I use this same setup in other applications on the same dev box and dont have problems

Views

174

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

service is undefined error (cf11)

Participant ,
Jul 18, 2018

Copy link to clipboard

Copied

I am having an issue with services not being recognized.  I am running CF 11 on a VM with win2012R2.  This is dev box so the permissions are 777 from webroot to file.

right now I am just trying to retrieve a list of cases from the DB and display them to the user.

I am getting the following

Error: Element CASESERVICE is undefined in a Java object of type class [Ljava.lang.String;.

Type: Expression

the Code:

controller:

component  displayname='case'name='case controller' accessors="true"

{

property caseservice;

writeLog(type='info', file='erctsTRACE', text='enter case controller');

public any function init( fw ) {

variables.fw = fw;

return this;

}

public any function default( rc ){

param name = 'rc' type='struct';

writeLog(type='info', file='erctsTRACE', text='enter default()');

//rc.a = 1 ;

        //rc.b = 3;

        //rc.c = rc.a + rc.b;

        //writedump(var=rc.c, abort=false);

writeLog(type='info', file='erctsTRACE', text='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

writeLog(type='info', file='erctsTRACE', text='call variables.caseservice.getcaselist()');

       rc.cl = variables.caseservice.getcaselist();

writeLog(type='info', file='erctsTRACE', text='exit variables.caseservice.getcaselist()');

writeLog(type='info', file='erctsTRACE', text='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

       writedump(var=rc.cl, abort=true,label='case list from caseservice');

writeLog(type='info', file='erctsTRACE', text='exit default function'); 

}

///////////////////////////////////////////

Case service:

component displayname='case service' accessors="true" {

writeLog(type='info', file='erctsTRACE', text='enter case service-');

function getcaselist(){

writeLog(type='info', file='erctsTRACE', text='enter getcaselist -');

try{

clistqry = new Query();

        clistqry.setSQL("SELECT erCase.caseNum,

       erCase.caseEmpID,

       erCase.dteRecieved,

       erCase.caseOrg,

       erCase.caseOffice,

       erCase.caseIssueDscr,

       erCase.caseOffense,

       erCase.casePropOff,

       erCase.caseDecOff,

       erCase.casePropDisc,

       erCase.caseID,

       erCase.erGradeid,

       erCase.caseTypeId,

        erCaseType.caseTypeShort,

erCaseType.caseType,

       erCase.caseDatePropIss,

       erCase.caseAppeal,

       erCase.caseAppealDte,

       erCase.caseDecision,

       erCase.caseDecisDte,

       erCase.caseCloseDte,

       erCase.caseSuspDte,

       erCase.caseRepRemoveDate,

       erCase.comment,

       erCase.caseModBy,

       erCase.caseModDte,

        erCase.status,

       erCase.valid_Flag,

       PERSONAL_V.LAST_NAME,

       PERSONAL_V.FIRST_NAME,

       PERSONAL_V.VALID_FLAG,

       PERSONAL_V.JOB_TITLE,

       erGrade.erGradeLevel,

       erGrade.erGradeValid

FROM ((ercts.dbo.erCase erCase

         INNER JOIN ercts.dbo.erCaseType erCaseType

            ON (erCase.caseTypeId = erCaseType.caseTypeId))

        INNER JOIN ercts.dbo.PERSONAL_V PERSONAL_V

           ON (erCase.caseEmpID = PERSONAL_V.EMP_ID))

       INNER JOIN ercts.dbo.erGrade erGrade

          ON (erCase.erGradeid = erGrade.erGradeId)

WHERE (PERSONAL_V.VALID_FLAG = 'Y') AND (erGrade.erGradeValid = 'Y')");

        cl = clistqry.execute();

       caseList = cl;

        return caseList;

}

catch (expression e) {

        WriteOutput("<p>An Expression exception was thrown.</p>");

    WriteOutput("<p>#e.message#</p>");

       }

/////////////////////////////////

the rc.a .... above executes perfectly

if i put the clistqry  in the view; it works perfectly so the DB connection and query are fine.

This dies before it ever gets out of the controller

I use this same setup in other applications on the same dev box and dont have problems

Views

175

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 18, 2018 0
Adobe Community Professional ,
Jul 18, 2018

Copy link to clipboard

Copied

I see two potential problems. First, I haven't played around with variable scopes in a CFC lately, but I suspect you should be using:

rc.cl = this.caseservice.getcaselist();

instead of:

rc.cl = variables.caseservice.getcaselist();

Second, I don't see where in your code you're actually assigning an instance of the caseservice object to the local property caseservice. I could just be missing it because the code sample is a bit hard to read on my screen, though.

Dave Watts, Fig Leaf Software

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 18, 2018 0
BKBK LATEST
Adobe Community Professional ,
Jul 18, 2018

Copy link to clipboard

Copied

I see no reason to use 'property'. In place of

property caseservice;

you could define the instance variable:

variables.caseservice = new casesensitive();

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 18, 2018 0