You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Makarov Alexey <al...@yandex.com> on 2019/11/27 12:24:20 UTC
IllegalArgumentException: No mainInterface: otherwise di: BeanContext(id=ServerStateImpl) InterfaceType: BUSINESS_REMOTE_HOME interfaces: [null]
Hello!
I use EJB for managing server state for client side regression tests. When I run client side tests with Arquillian, all test pass, but I receive exception on deployment time: https://pastebin.com/ybC8Hs1a
Why I recevie this exception?
This my remote interface:
@Remote
public interface ServerState {
public void load(Collection<StateAction> stateActions) throws Exception;
public void clean();
public void setSession(String sessionId, int sessionMaxInactiveInterval);
}
This my EJB:
@Stateful(mappedName = "MyServer")
public class ServerStateImpl implements ServerState {
@Override
@Transactional
public void load(Collection<StateAction> fromClient) throws Exception {
// do something
}
@Override
@Transactional
public void clean() {
// do something
}
@Override
public void setSession(String sessionId, int sessionMaxInactiveInterval) {
// do something
}
public void otherMethod() {
// do something
}
}
This my lookup code:
@RunWith(Arquillian.class)
@RunAsClient
public class MyTest {
private ServerState serverState;
@Deployment(testable = false)
public static WebArchive createDeployment() {
...
}
@Before
public void init() {
Properties p = new Properties();
p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
InitialContext ctx = new InitialContext(p);
myServer = (ServerState) ctx.lookup("MyServer");
}
...
}
Thank you!
--
WIth best regards,
Makarov Alexey