0 Replies Latest reply on Jan 22, 2002 6:34 PM by jorj

    EJB call from custom MBean failed with ClassCastException! H

    jorj

      Hi,
      First of all, please accept my apologizes because I disturb you with my question, but it becomes a nightmare for me. Maybe you can help me ...

      I use an embedded JBoss 2.4.0 + tomcat 3.2.3 and I try to access some EJBs from a custom MBean (ApplicationStartupService that is a service MBean and it's declared in jboss.jcml). The MBean it's initialized correctly. in start method I call a a static method (through a Jar Url Connection) from a class, CIPIDStartup, that is packaged together with my EJBs (under /deploy). Everything goes fine until CIPIDStartup try to call an EJB. In this point I got an ClassNotFoundError. I've corrected packaging the remote and home interface in a jar under /lib/ext or using

      javax.management.loading.MLet mlet = (javax.management.loading.MLet)Thread.currentThread().getContextClassLoader();
      mlet.addURL(new java.net.URL("file:D:\\jboss-2.4.0_tomcat-3.2.3\\jboss\\deploy\\cipid.jar"));

      Now i can lookup but i got an ClassCastException and I don't why :( I've tried a lot, I've searched the forums but without success.
      MessageSpoolerMailerHome is an stateless session that calls some entity beans.

      Thank you very, very much for your patience and excuse me again for this small inconvenience.

      Sincerely yours,
      Jorj-Cezar Munteanu



      INFO [ApplicationStartupService] Starting
      DEBUG [ApplicationStartupService] startService() called
      INFO [Default] 0 [JBossMain] DEBUG cipid.util.startup.CIPIDStartup - CIPIDStartup() called
      INFO [Default] CIPID/MessageSpoolerMailerHome
      ERROR [Default] java.lang.ClassCastException: $Proxy27
      ERROR [Default] at cipid.util.startup.CIPIDStartup.doIt(CIPIDStartup.java:65)
      ERROR [Default] at java.lang.reflect.Method.invoke(Native Method)
      ERROR [Default] at cipid.util.startup.JarClassLoader.invokeClassMethod(JarClassLoader.java:37)
      ERROR [Default] at cipid.util.startup.ApplicationStartupService.startService(ApplicationStartupService.java:69)
      ERROR [Default] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:107)
      ERROR [Default] at java.lang.reflect.Method.invoke(Native Method)
      ERROR [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      ERROR [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      ERROR [Default] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
      ERROR [Default] at $Proxy0.start(Unknown Source)
      ERROR [Default] at org.jboss.util.ServiceControl.start(ServiceControl.java:81)
      ERROR [Default] at java.lang.reflect.Method.invoke(Native Method)
      ERROR [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      ERROR [Default] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      ERROR [Default] at org.jboss.Main.(Main.java:210)
      ERROR [Default] at org.jboss.Main$1.run(Main.java:116)
      ERROR [Default] at java.security.AccessController.doPrivileged(Native Method)
      ERROR [Default] at org.jboss.Main.main(Main.java:112)
      INFO [ApplicationStartupService] Started