Wednesday 13 March 2013

Issues with ControllerCommand and TaskCommand - solution

Issue 1) 00000114 CommerceSrvr  E CommandFactory locateCommandEntry CMN0203E: Command not found: "com.mycompany.commands.MyCatalogControllerCmd".

Solution : We need to make an entry in CMDREG table as mentioned at Register the Controller Command - CMDREG

otherwise at run time it throws exception


Issue 2) 000001a5 CommerceSrvr  E CommandManager createCommand CMN0110E: Cannot instantiate com.myCompany.commands.MyCatalogTaskCmdImpl for command com.mycompany.commands.MyCatalogTaskCmd. java.lang.NoClassDefFoundError: com/myCompany/commands/MyCatalogTaskCmdImpl (wrong name: com/mycompany/commands/MyCatalogTaskCmdImpl)
    at java.lang.ClassLoader.defineClassImpl(Native Method)



Solution : Make sure the value of public static final String defaultCommandClassName should match with actuals
example:

    public static final String defaultCommandClassName = "com.myCompany.commands.MyCatalogTaskCmdImpl";

make sure you have package com.myCompany.commands and class name as
MyCatalogTaskCmdImpl

If any of these mismatches, i.e.,  the package name here is
com.myCompany.commands and the original package name is
com.mycompany.commands (small c in mycompany), then at runtime we get exception.

No comments:

Post a Comment