Question & Answer
Why would I receive a DFHSJ1004 exception message indicating that something is wrong with my CICS-MainClass? I am running CICS Transaction Server for z/OS (CICS TS) V5.2 and having a problem installing a Java application in my CICS region. I have successfully exported the CICS Bundle to my zFS directory.
This is the message I am receiving:
DFHSJ1004 date time applid userid An exception has been thrown by the route method of class com/ibm/cics/router/Router running in JVMSERVER DFHOSGI. Exception 'No CICS-MainClass services with the classname 'examples.hello.HelloCICSWorld' could be found. Either the implementing Bundle has not been enabled, or the MANIFEST of the Bundle does not contain a CICS-MainClass (Entry point) for this class.'.
The CICS-MainClass declaration within the Bundle manifest file is used to declare the classes that can be called by other CICS applications from outside the JVM server. Within your manifest file you have specified CICS-MainClass using an alias as follows:
The alias is an optional variable that provides an alternative name for the class that you can use in a PROGRAM resource instead of the fully qualified class name. When an alias is found, the CICS MainClass will be registered in the OSGi framework under the alias, not the class name. Therefore, when you define the PROGRAM resource to CICS, you must specify the alias name instead of the actual class name.
Using an alias comes in handy when you run multiple versions of the same Java application program in a JVM server, each with the same class name. It allows you to identify the different versions.
CICS/TS CICSTS CICS TS CICS Transaction Server
03 November 2016