I have a Maven project in which I want to try to integrate-test the EAR submodule. In the integration test submodule, I do the following:
Properties env; Context ctx; env = new Properties(); env.setProperty( "java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory"); env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); env.setProperty( "java.naming.provider.url", "remote://localhost:4447"); env.put(Context.SECURITY_PRINCIPAL, "jboss-user"); env.put(Context.SECURITY_CREDENTIALS, "*******"); ctx = new InitialContext( env ); IBMPFacadeRemote bmpFacade = ( IBMPFacadeRemote ) ctx.lookup( "ejb:DeDomain-ejb-1.0-SNAPSHOT/BMPFacade!de.domain.service.IBMPFacadeRemote"); bmpFacade.executeBMPProcess( model1, model2);
Problem: when mvn integration-test is called, it ends with the following Exception
java.lang.ClassCastException: org.jboss.ejb.client.naming.ejb.EjbNamingContext cannot be cast to de.domain.service.IBMPFacadeRemote
Can someone help me solve this problem? Are there any opportunities for integration - test it with Local Bean (maven project uses fault tolerant plugin)?
source share