1 Reply Latest reply: Oct 2, 2009 6:55 AM by 725569 RSS

    OCCAS (SNMPTrap Exception) Exception caught: java.lang.ClassCastException:

    681833
      Hello.
      I try send SNMP trap from my sipservlet. But when I try get SipServletSnmpTrapRuntimeMBean, I get Exception in Cast operation:
      SipServletSnmpTrapRuntimeMBean ssTrapMB = (SipServletSnmpTrapRuntimeMBean) set.iterator().next();
      Exception caught: java.lang.ClassCastException: $Proxy50 cannot be cast to com.bea.wcp.sip.management.runtime.SipServletSnmpTrapRuntimeMBean

           public SipServletSnmpTrapRuntimeMBean getServletSnmpTrapRuntimeMBean() {

                try {
                     Environment env = new Environment();
                     env.setProviderUrl("t3://localhost:7001");
                     env.setSecurityPrincipal("weblogic");
                     env.setSecurityCredentials("weblogic");
                     Context ctx = env.getInitialContext();
                     MBeanHome home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
                     System.out.println("Got the Server-specific MBeanHome: " + home);
                     Set set = home.getMBeansByType("SipServletSnmpTrapRuntime");
                     if (set == null || set.isEmpty()) {
                          try {
                               throw new ServletException(
                                         "Unable to lookup type 'SipServletSnmpTrapRuntime'");
                          } catch (ServletException e) {
                               e.printStackTrace();
                          }
                     }
                     SipServletSnmpTrapRuntimeMBean ssTrapMB = (SipServletSnmpTrapRuntimeMBean) set.iterator().next();
                     return ssTrapMB;
                } catch (Exception e) {
                     System.out.println("Exception caught: " + e);
                     return null;
                }
           }

      How I can send SNMPTrap?

      Edited by: user10226057 on 27.01.2009 4:27