Search This Blog

SBL-EAI-05001: Exception in Java Business Service in stage %1 : %2

Applies to: Siebel CRM - Version: 8.1.1.1 SIA [21211] and later [Release: V8 and later ]
Information in this document applies to any platform.
SymptomsA Java Business Service (JBS) has been configured, to invoke an external java class.

The following error is reported :-

SBL-EAI-05001: Exception in Java Business Service in stage Init : Method getFileRef with signature ()Ljava/lang/String; was not found
CauseIt was found that the jar files used were from a previous version (Siebel 7.8), while the current version was Siebel 8.1.x.
SolutionAfter ensuring the CLASSPATH in the JAVA named subsystem referenced the correct version of the Siebel.jar and SiebelJI_enu.jar (or other language jar), the error no longer occurred.





















Applies to: Siebel System Software - Version: 7.8.2.3 SIA [19221] and later [Release: V7 and later ]
z*OBSOLETE: Microsoft Windows 2000
Product Release: V7 (Enterprise)
Version: 7.8.2.3 [19221] Fin Svcs
Database: IBM DB2 5.2
Application Server OS: Microsoft Windows 2000 Advanced Server SP 4
Database Server OS: Sun Solaris 8

This document was previously published as Siebel SR 38-3191102961.
""""Checked for relevance on 17-Nov-2010""""
GoalProvide additional information on how to create a java business service and how to call it from siebel.
SolutionBookshelf provides sample code about the way Java class must be written.

Here are some additional points:
Java class must inherit from SiebelBusinessService
SiebelBusinessService declares the abstract doInvokeMethod method as follows:
public abstract void doInvokeMethod(String s, SiebelPropertySet siebelpropertyset, SiebelPropertySet siebelpropertyset1)
throws SiebelBusinessServiceException;

NOTE: the custom class must implement this method.


DoInvokeMethod behaves just like Service_PreInvokeMethod standard event; parameters are passed in using the siebelpropertyset parameter and returned back via the siebelpropertyset.
The 1st parameter is the name of the method that is invoked.

In the code provided as example in the Bookshelf, this results in
Testing the methodName parameter for switching the task to perform
Reading the input parameter for getting information passed in
Writing the output parameter for returning data
The only difference with the Service_PreInvokeMethod event is that CancelOperation does not need to be returned since the specific behavior of the CSSJavaBusinessService class does not return any error message if the flow execution is not canceled.

Once the class file is written, it is possible to embed it into a jar file. For this, the jar tool provided with JDK may be used.



Files containing classes (class/jar) may be located wherever in the machine, the only restriction is that this place needs to be reachable from the Object Manager.

In Tools, a specific Business Service based on the CSSJavaBusinessService class will allow accessing to this class.
Its “@class” user property (to add) specifies the path for accessing to the class file.
Please, ensure the generated jar file correctly respects the coding hierarchy, including packages, that is the jar generation did not insert any unnecessary directory information. For example if the class does not belong to any package its correct location is the root of the jar file.
If the class does not belong to any package, it will be the name of the class alone (IE ClassName).
If it belongs to a package, it will be the complete package listing from the root of the jar file plus the name of the class itself (IE Pack.subPack.ClassName).

[JAVA]
DLL=D:\Tools\j2ee\jdk\jre\bin\client\jvm.dll
CLASSPATH=D:\Misc\Projects\JavaBusinessService\JavaBusinessService.jar;D:\s78\SEA\Tools\CLASSES\Siebel.jar;D:\s78\SEA\Tools\CLASSES\SiebelJI_enu.jar;D:\Tools\j2ee\jdk\jre\lib\rt.jar;D:\Tools\j2ee\jdk\jre\lib;
VMOPTIONS = -Xrs -Djava.compiler=NONE -Djms.log=C:\log\jms.log


In case of Web Client, a new Profile in the Profile Configuration applet will set the information. Its name is Java and its Type is “JVMSubsys”.
Then set the corresponding three underlying Profile Parameters DLL, CLASSPATH and VMOPTIONS.

As you may notice in the above example, there are always three parameters to set:
“DLL” parameter points to the dll that implements the JVM
“CLASSPATH” lists jar files necessary; you must include Siebel.jar, SiebelJI_lang and the jar file that contains your class
“VMOPTIONS” that sets specific options for the JVM

CLASSPATH property and @class user property work together; when invoking the JBS, the JVM loads the class that is designed by a concatenation of the CLASSATH with the @class. Just like the standard JVM does in command line.

For example purposes, here is a sample code for invoking the code provided in the Bookshelf:
As explained above, Property Sets usage does not differ to other Business Services (assuming the JBS is named "Java Business Service").

var oBS = TheApplication().GetService("Java Business Service");
var inPS = TheApplication().NewPropertySet();
var outPS = TheApplication().NewPropertySet();
var result;

inPS.SetProperty("X", "3");
inPS.SetProperty("Y", "17");

oBS.InvokeMethod("Add", inPS, outPS);
result = outPS.GetProperty("Z");

Particular cases:

In some cases, class may be generated by a third party tool and must inherit from a given class, possibly some restrictions or business requirements may impose the parent class. In such a case, it is not possible to inherit from the “SiebelBusinessService” as specified in the Bookshelf.
For working around this restriction, it is necessary to consider approaches similar to the Tie or Delegate models.
These models suggest implementing a class for acting as a wrapper; in the present case, this class would inherit from the “SiebelBusinessService” class and delegate every invocation to the final class generated by the middleware.

The following code offers illustrating this approach.
We shall consider the MiddlewareGeneratedClass is the class generated by your middleware and the entry point is the doInvokeMethod method, such as in the standard Siebel implementation.
import com.siebel.data.SiebelPropertySet;
import com.siebel.eai.SiebelBusinessService;
import com.siebel.eai.SiebelBusinessServiceException;

public class JavaBusinessService extends SiebelBusinessService {
MiddlewareGeneratedClass delegate;

Public JavaBusinessService() {
delegate = new MiddlewareGeneratedClass();
}

public void doInvokeMethod(String methodName, SiebelPropertySet input, SiebelPropertySet output)
throws SiebelBusinessServiceException {
delegate.doInvokeMethod(methodName, input, output);
}
}


If generated final classes cannot be modified, a wrapping is necessary in the JBS class. In the below example, we assume the MiddlewareGeneratedClass offers a method with signature as follows:

public int performAddition(int x, int y);

Then the wrapper looks like (enum feature requires JVM 1.5):


import com.siebel.data.SiebelPropertySet;
import com.siebel.eai.SiebelBusinessService;
import com.siebel.eai.SiebelBusinessServiceException;

public class JavaBusinessService extends SiebelBusinessService {
static private enum Methods{Add, Sub, Mul, Div};

MiddlewareGeneratedClass delegate;

Public JavaBusinessService() {
delegate = new MiddlewareGeneratedClass();
}

public void doInvokeMethod(String methodName, SiebelPropertySet input, SiebelPropertySet output)
throws SiebelBusinessServiceException {
switch(FrameLabels.valueOf(tag)) {
case Add: // Addition
String X = input.getProperty("X");
String Y = input.getProperty("Y");
int result;

try {
result = delegate.performAddition(Integer.parseInt(X), Integer.parseInt(Y));
}
catch (NumberFormatException e) {
throw new SiebelBusinessServiceException("NOT_INT", "Non-integer passed");
}
output.setProperty("Z", new Integer(result).toString());
break;
case Sub:
// ...
}
}
}

ReferencesNOTE:503618.1 - Call java jarr and jvm
NOTE:1177253.1 - Invoking Java Business Service Results in SBL-EAI-05001 - Method getFileRef with signature ()Ljava/lang/String; was not found
NOTE:475359.1 - IBM 1.4.2 Java Virtual Machine Crashes Siebel Object Manager on AIX
NOTE:481301.1 - CLASSPATH for the Named Subsystem component is to small
NOTE:509850.1 - SRVRMGR problem with spaces
NOTE:502676.1 - JVM Class Path
Related


Products


Siebel > Customer Relationship Management > CRM - Enterprise Edition > Siebel System Software
Keywords

 
DLL; JVMSUBSYS; VMOPTIONS; CLASS; JAR; JAVA BUSINESS SERVICE
 


This is over concerning the creation of the JBS.

The use of Java Business Services does not differ from other Business Services; standard PropertySets are used for passing data in and out.

Once the configuration is completed, environment information needs to be specified for allowing the JVM to load this class and run it. This is done via the "JAVA" JVMSubSys. In case of dedicate client, A new [JAVA] section must be created in the cfg as follows:

No comments:

Post a Comment