cancel
Showing results for 
Search instead for 
Did you mean: 

Casting Issue with ApplicationConfigHandlerFactory

Former Member
0 Kudos

Hi,

I am very much in the need for a helping hand. Since days I am struggling with a strange problem:

I use a message driven bean that needs to lookup the configuration that was created using a WebDynpro via the ConfigurationManager.

From my onMessage method I call the getCfgHandler method that looks like this:

private ApplicationConfigurationHandler getCfgHandler()
		throws Exception {
		//Obtain ConfigurationManager interface:
		Context ctx = new InitialContext();
		Object pojo = ctx.lookup("ApplicationConfiguration");
		ApplicationConfigHandlerFactory factory =
			(ApplicationConfigHandlerFactory) pojo;
		return factory.getApplicationConfigurationHandler();
	}

While casting from pojo to factory I encounter a ClassCastException. Strangely, when I debug I see that pojo is of type

com.sap.engine.services.configuration.appconfiguration.impl.ApplicationConfigHandlerFactoryImpl

.

This class in turn implements the ApplicationConfigHandlerFactory. I made sure I import the correct one

(

import com.sap.engine.services.configuration.appconfiguration.ApplicationConfigHandlerFactory;

)

I have not declared anything for my MDB in any deployment descriptor. I thought that maybe a ressource-ref might be appropriate, but I did not find a way how to do this.

Could anyone help me please? I am really desperate and the deadline is coming soon...

Regards,

Helge

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

amazing what you find if you do not rely on TREX but google...

For those of you facing the same problem I suggest to read

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/45/e7e14b517b42788a1c166f9f32455e/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/45/e7e14b517b42788a1c166f9f32455e/content.htm</a>

For me this solved the issue