on 03-08-2006 3:30 PM
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!?!?
Hi,
in the forth line try "c" instead of "o".
regards
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.