cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptor Module Paramters do not work.

Former Member
0 Kudos

Here is my Module Code:


public ModuleData process(ModuleContext moduleContext, 
        ModuleData inputModuleData)
        throws ModuleException {

    try {
        java.io.FileOutputStream fos = 
                new java.io.FileOutputStream("/ModuleData_process.txt");
    	    
        fos.write(("Parameter debug.n").getBytes());
    	    
        if (moduleContext == null) {
            fos.write(("Module Context is NULL!n").getBytes());
        }
    	    
        if (moduleContext.getContextData("parameterName") == null) {
            fos.write(("parameter is NULL.n").getBytes());
        }
    	    
        String parameter = moduleContext.getContextData("parameterName");
        fos.write(("parameterName value: " + parameter + "n").getBytes());
    	    
        java.util.Enumeration enumKeys = moduleContext.getContextDataKeys();
        while (enumKeys.hasMoreElements()) {
            Object obj = enumKeys.nextElement();
            fos.write(("obj to String is: " + obj.toString()).getBytes());
            fos.write(("Value: " + 
                    moduleContext.getContextData(obj.toString())).getBytes());
        }
	    
    } catch (Exception e){
        // Do nothing
    }
    ....

The configuration scrennshot can not be uploaded here becuase the forum does not support it but I will gladly email it to anyone that is interested. Basically I have configured an adaptor module with a module key and the module key is used to define paramter name and values.

This module throws and internal server error and the contents of the file "/ModuleData_process.txt" are only:

"

Parameter debug.

"

Therefore I can only conclude that the idea of:


String parameter = moduleContext.getContextData("parameterName");

is a good one but does not work at all.

Am I right? Have I made a mistake? Is the another way to parameterise an EJB?

Thanks,

Doug

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Douglas,

Use

String parameter = (String) moduleContext.getContextData("parameterName");

instead of

String parameter = moduleContext.getContextData("parameterName");

Because method getContextData will not return a string.

Regards,

Ibrahim

Former Member
0 Kudos

Thanks for the help Ibrahim,

I tried to cast the getContextData return to a string but the result is exactly the same.

I looked at the api and the return type is a String

public java.lang.String getContextData(java.lang.String name);

Therefore casting a String to a String is not likely to fix this and it did not.

However it was worth a try.

Thanks again,

Doug

Former Member
0 Kudos

I can answer this myself by adding SOAP to the Title

"SOAP Adaptor Module Paramters do not work."