This discussion is archived
5 Replies Latest reply: Sep 25, 2013 12:33 PM by ManojC RSS

Error - Unable to execute service and function

872629 Newbie
Currently Being Moderated

Hi all,

 

   I created a sample component with service handlers but it is giving errors Unable to execute service GET_PURGE_LIST and function getPurgeList.
(System Error: The service method 'getPurgeList' is not defined.) Please let me know what changes to be made to fix this


Below are the files I used:

======================

ampfacpurgecontents_resource.htm


<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>

ServiceHandlerSample htmlIncludeOrString

</title>

</head>

<body>

 

 

<@dynamichtml custom_finish_layout_init@>

<$include super.custom_finish_layout_init$>

if (navBuilder)

  {

 

  if (isLoggedIn)

  {

  

 

 

  navBuilder.addChildNodeTo('MY_CONTENT', 'item', 'id==GET_PURGE_LIST',

  'label=='+'Show Purge List',

  'url==<$HttpCgiPath$>?IdcService=GET_PURGE_LIST');

 

 

  }

  }

<@end@>

 

 

</body></html>

===============================================

Services

======

servicehandlersample_service.htm

------------------------------------------------------

 

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>

ServiceHandlerSample service

</title>

</head>

<body>

 

 

<@table ServiceHandlerSample_Services@>

<table border=1><caption><strong>Scripts For Custom Services</strong></caption>

<tr>

  <td>Name</td><td>Attributes</td><td>Actions</td>

</tr>

<tr>

  <td>GET_PURGE_LIST</td>

  <td>DocService

  0

  PUTRGE_LIST_PAGE

  null

  null<br>

  null</td>

  <td>3:getPurgeList:GET_LIST:0:null</td>

</tr>

</table>

<@end@>

</body></html>

======================

service handler

============

servicehandlers_handlers.htm

-------------------------------------

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>

ServiceHandlerSample htmlIncludeOrString

</title>

</head>

<body>

 

 

<@table SampleServiceHandlers@>

<table border=1><caption><strong>ServiceHandlers</strong></caption>

<tr>

  <td>serviceName</td><td>handler</td><td>searchOrder</td>

</tr>

<tr>

  <td>DocService</td>

  <td>com.ameriprise.ServiceHandlerSample.getPurgeList</td>

  <td>100</td>

</tr>

</table>

<@end@>

</body></html>

======================================================

 

ServiceHandlerSample.hda

--------------------------------------

<?hda version="10.1.3.3.3 (080807)" jcharset=UTF8 encoding=utf-8?>

@Properties LocalData

version=2013_09_25(build 1)

blFieldTypes=

ComponentName=ServiceHandlerSample

hasPreferenceData=false

blDateFormat=M/d/yy {h:mm[:ss] {aa}[zzz]}!mAM,PM!tAsia/Calcutta

@end

@ResultSet ResourceDefinition

4

type

filename

tables

loadOrder

resource

resources/servicehandlersample_resource.htm

null

1

resource

resources/servicehandlers_handlers.htm

SampleServiceHandlers

1

service

resources/servicehandlersample_service.htm

ServiceHandlerSample_Services

1

template

templates/servicehandlersample_template.hda

null

1

@end

@ResultSet Filters

4

type

location

parameter

loadOrder

@end

@ResultSet MergeRules

4

fromTable

toTable

column

loadOrder

ServiceHandlerSample_Templates

IntradocTemplates

name

10

SampleServiceHandlers

ServiceHandlers

null

1

@end

@ResultSet ClassAliases

3

classname

location

loadOrder

@end

========================

Java Class

package com.ameriprise.ServiceHandlerSample;

import java.util.*;

import java.io.*;

import java.net.*;

 

 

import intradoc.common.*;

import intradoc.data.*;

import intradoc.shared.*;

import intradoc.server.*;

public class GetPurgedList extends ServiceHandler {

  public void getPurgeList() throws ServiceException, DataException

  {

  DataResultSet fullStockData = new DataResultSet(new String[] {"Sample Content",

  "11111", "123", "Sept-25-13" });

  String resultSetName = m_currentAction.getParamAt(0);

  m_binder.addResultSet(resultSetName, fullStockData);

  }

}

 

============================================================

Template

 

servicehandlersample_template.hda

 

 

 

<?hda version="10.1.3.3.3 (080807)" jcharset=UTF8 encoding=utf-8?>

@Properties LocalData

blFieldTypes=

blDateFormat=M/d/yy {h:mm[:ss] {aa}[zzz]}!mAM,PM!tAsia/Calcutta

@end

@ResultSet ServiceHandlerSample_Templates

5

name

class

formtype

filename

description

PUTRGE_LIST_PAGE

Document

null

purge_list_page.htm

null

@end

  • 1. Re: Error - Unable to execute service and function
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

     

    PUTRGE_LIST_PAGE - is there a typo in this resource name set under @ResultSet ServiceHandlerSample_Templates


    Thanks,

    Srinath    


  • 2. Re: Error - Unable to execute service and function
    872629 Newbie
    Currently Being Moderated

    Srinath,

     

       Same name is used as part of Service also, let me know if I can share the component to u

     

    Regards,

    Ashok

  • 3. Re: Error - Unable to execute service and function
    Anand U Journeyer
    Currently Being Moderated

    Hi Ashok,

     

    In your servicehandlersample_service.htm the Service Class should be your package name and not DocService. Here is how it should be:

     

    <@table ServiceHandlerSample_Services@>

    <table border=1><caption><strong>Scripts For Custom Services</strong></caption>

    <tr>

      <td>Name</td><td>Attributes</td><td>Actions</td>

    </tr>

    <tr>

      <td>GET_PURGE_LIST</td>

      <td>com.ameriprise.ServiceHandlerSample

      0

      PUTRGE_LIST_PAGE

      null

      null<br>

      null</td>

      <td>3:getPurgeList:GET_LIST:0:null</td>

    </tr>

    </table>

    <@end@>

     

    HTH

    - Anand

  • 4. Re: Error - Unable to execute service and function
    872629 Newbie
    Currently Being Moderated

    Anand,

     

        it is throwing the error  - System code execution error. Unable to create service. Unable to instantiate java class code for 'com.ameriprise.ServiceHandlerSample.GetPurgedList' at location 'com.ameriprise.ServiceHandlerSample.GetPurgedList' with default location at 'com.ameriprise.ServiceHandlerSample.GetPurgedList'.

     

     

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>

    ServiceHandlerSample service

    </title>

    </head>

    <body>

     

     

    <@table ServiceHandlerSample_Services@>

    <table border=1><caption><strong>Scripts For Custom Services</strong></caption>

    <tr>

      <td>Name</td><td>Attributes</td><td>Actions</td>

    </tr>

    <tr>

      <td>GET_PURGE_LIST</td>

      <td>com.ameriprise.ServiceHandlerSample.GetPurgedList

      0

      PUTRGE_LIST_PAGE

      null

      null<br>

      null</td>

      <td>3:getPurgeList:GET_LIST:0:null</td>

    </tr>

    </table>

    <@end@>

    </body></html>

  • 5. Re: Error - Unable to execute service and function
    ManojC Explorer
    Currently Being Moderated

    Hi Ashok,

     

             The above error occurs because the service couldn't find the java class file. Please make sure to create a replica of package directory under the components class folder. For example if the package name is 'com.ameriprise.ServiceHandlerSample.GetPurgedList' then the directory should be <ComponentDir>/classes/com/ameriprise/ServiceHandlerSample/GetPurgedList/<JavaClassFile>.

     

    Regards,

    Manoj

     


Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points