JBoss have their custom class loading mechanism and hence why you see the ClassCastException.
To have this to work you need to have some sort of JBoss classloader adapter. And its not easy.
For example to let Camel run in JBoss we do have such an adapter at
http://camel.apache.org/camel-jboss.html but it's only for JBoss+Camel.
I think you have to take your question to JBoss and ask them why their classloader is not an URLClassLoader instance
2010-07-16 09:47:54,902 ERROR STDERR (main) java.lang.ClassCastException: org.jboss.classloader.spi.base.BaseClassLoader cannot be cast to java.net.URLClassLoader
i wish also to deploy SMX4 to jbossAS 5.1.
please tell me know if you resolved your problem.
ServiceMix 4.x does not support deployment in JBoss 5.1.
Instead you can just use Camel and deploy it as WAR files.
so if i want to invoke an EJB from servicemix 4, how i can do this?
i must run two servers (jboss and servicemix)??
You can use the camel EJB component
Or just use Java code, and invoke the EJB as you would normally do. Its nothing different when you need to invoke a EJB on a remote JBoss server, when its from ServiceMix or from something else.