How to use getContainerBean() method?

Posted by Admin on 20-Dec-2010 05:02

Hello, Heres is my code:

MQMgmtBeanFactory domain = new MQMgmtBeanFactory();
        ConfigServerUtility configServeur = new ConfigServerUtility();
        configServeur.setConnectTimeout(3000);
        try {
            domain.connect("DomainSonic", "urls", "Administrator", "
Administrator");
            List list = domain.getContainerBeanNames();
            for(int i=0 ; i<list.size(); i++){
                System.out.println(list.get(i));
            }
            IContainerBean container = domain.getContainerBean("/Containers/ct_Msg");
        } catch (MgmtException e) {
            e.printStackTrace();
        }

Result:

/Containers/VerificationContainer
/Containers/ct_Msg
/Containers/ct_Esb
/Containers/DM
com.sonicsw.ma.mgmtapi.config.MgmtException: Failed to load configuration for /Containers/ct_Msg - org/apache/xerces/impl/dv/InvalidDatatypeFacetException
    at com.sonicsw.ma.mgmtapi.config.impl.MgmtBeanBase.loadBean(MgmtBeanBase.java:52)
    at com.sonicsw.mf.mgmtapi.config.gen.AbstractMFMgmtBeanFactory.getContainerCollectionBean(AbstractMFMgmtBeanFactory.java:767)
    at CreatingQueues.main(CreatingQueues.java:46)
Caused by: java.lang.NoClassDefFoundError: org/apache/xerces/impl/dv/InvalidDatatypeFacetException
    at com.sonicsw.mx.config.impl.ConfigServer.loadConfigType(ConfigServer.java:713)
    at com.sonicsw.mx.config.impl.ConfigServer.loadConfigType(ConfigServer.java:678)
    at com.sonicsw.mx.config.impl.ConfigBeanImpl.<init>(ConfigBeanImpl.java:77)
    at com.sonicsw.mx.config.impl.ConfigServer.dirElement2ConfigElement(ConfigServer.java:1797)
    at com.sonicsw.mx.config.impl.ConfigServer.loadConfigElement(ConfigServer.java:525)
    at com.sonicsw.mx.config.impl.ConfigServer.loadConfigElement(ConfigServer.java:540)
    at com.sonicsw.ma.mgmtapi.config.impl.MgmtBeanBase.loadBean(MgmtBeanBase.java:47)
    ... 2 more
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.impl.dv.InvalidDatatypeFacetException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 9 more

I don't understand this problem. Can you help me please?

Thanks

All Replies

Posted by tsteinbo on 20-Dec-2010 06:17

You simply missing xerces on your classpath.

BTW, you should not use ConfigServerUtility. There is no need for this internal class here and you actually not referencing it in your code.

Thomas

This thread is closed