users@glassfish.java.net

Two applications sharing same remote interface?

From: <forums_at_java.net>
Date: Tue, 6 Sep 2011 06:54:27 -0500 (CDT)

We have a main application and a client application deployed on Glassfish
3.1. The main application invokes the client application through a JNDI
lookup over a @Remote interface. Now we tried to deploy another client
application that uses the same @Remote interface, hoping to be able to invoke
both applications but just changing target EJB name. However, we received the
following exception:

Caused by: java.lang.RuntimeException: Error while binding JNDI name
com.company.ClientRemote for EJB : Client2
        at
com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1550)
        at
com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:202)
        at
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:167)
        at
org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)
        ... 67 more
Caused by: javax.naming.NameAlreadyBoundException: Use rebind to override

Both clients need to have a common functionality, and this functionality is
used by the main application when it invokes the clients.

How do you suggest to go around this?

Thanks!


--
[Message sent by forum member 'ariod']
View Post: http://forums.java.net/node/840306