Problem with IExtensionConf method getState (is Extension checked)

Discussion created by petra.zieger on Sep 25, 2012
Latest reply on Oct 8, 2012 by petra.zieger
I want to check, wether FME is installed (works) and wether the FME-Licence is checked or not (does not work).

I did noh find an example in Java, but all other examples manage the problem
by casting IExtension to IExtensionConfig and using the method getState(UID).
In the ArcObjects Java SDK is also said "use QI from IExtension to IExtensionConfig".
QI means "casting" or am I wrong?

I allways get the error "IExtensionProxy can not be cast to IExtensionConfig".
Why do I have a proxy-object?! Causes the proxy the problem?
How can I avoid to have a proxy-object?
Has anybody an idea?


      private boolean FMELicense() {
            boolean isActivated = false;
            try {

                  IUID fmeUID = new UID();
                  IExtensionManager extensionMgr = new ExtensionManager();
                  extensionMgr = (IExtensionManager) app;
                  IExtension fmeExtension = extensionMgr.findExtension(fmeUID);
                  if (fmeExtension == null) {
                        isActivated = false;
                        Util.addToLog("Fehler: FME-Lizenz ist nicht vorhanden...");
                  } else {
Util.addToLog("fmeExtension.getClass() = " + fmeExtension.getClass().getName());
                             Util.addToLog("FME-Lizenz vorhanden...");
                             Util.addToLog("vor extensionConf = ...");
                             IExtensionConfig extensionConf = (IExtensionConfig) app.findExtensionByCLSID(fmeUID); // does not work..
                             Util.addToLog("nach extensionConf = ...");
                             if (extensionConf.getState() == esriExtensionState.esriESEnabled) {
                                   isActivated = true;
                             else {
                                   isActivated = false;
                                   Util.addToLog("Fehler: FME-Lizenz ist nicht aktiviert...");
            } catch (IOException e) {
            return isActivated;