cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from Configuration Adapter

Former Member
0 Kudos

Hi!

I try to read values for configuration adapter out of webdynpro with following code:


1 ctx = new InitialContext();			
2 Object o = ctx.lookup("ApplicationConfiguration");
3 Class c = o.getClass();
4 appCfgHdlFctry = (ApplicationConfigHandlerFactory) o;
5 cfgHandler = appCfgHdlFctry.getApplicationConfigurationHandler();

Until row 4 everything works fine, but when I try to cast object o to ApplicationHandlerFactory, application crashs with a NoClassDefError. So I searched for "configuration.jar" file containing the ApplicationConfigHandlerFactory class and added it to my project.

Unfortunately I´m getting a ClassCastException now, so that I think, I still have not the right jar file. The object in o is of type ApplicationConfigHandlerFactoryImpl which implements ApplicationConfigHandlerFactory, so I don´t see any mistake!?!?

Can anybody tell me, what I´m doing wrong!?!?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

in the forth line try "c" instead of "o".

regards

Martin

Former Member
0 Kudos

Excuse me, listing was not complete:


1 ctx = new InitialContext();			
2 Object o = ctx.lookup("ApplicationConfiguration");
3 Class c = o.getClass();
4 ApplicationConfigHandlerFactory appCfgHdlFctry = (ApplicationConfigHandlerFactory) o;
5 ApplicationConfigurationHandler cfgHandler = appCfgHdlFctry.getApplicationConfigurationHandler();

The ClassCastException is thrown in line 4.