0
votes

I have a question about calling a Remote EJB (3.0) running on a Weblogic instance using Host & Port name of the Weblogic Server.

I've read the Java EE 6 tutorial specifically about invoking a remote EJB either through JNDI or through Dependency Injection.

But the environment (Common Dev environment) I work with has client code that accesses the EJB through a host name and a port name using Spring.

I have a local instance of Weblogic and deployed the ear file. I wanted to follow the same workflow (using the host name and the portname) to call this ejb on my local machine (the client will be running on another application server locally) to see if remote attachment to my ejb works. But I'm not sure what the deal is with the port number. What am I missing?

1

1 Answers

1
votes

I believe, as far as the calling client is concerned, it's accessing the Remote EJB's via RMI via JNDI. It shouldn't be all that different.

Spring does have some native support for accessing the remote EJBs

http://docs.spring.io/spring/docs/4.0.0.RELEASE/spring-framework-reference/htmlsingle/#ejb-access

Typically, when you have the host/port of the remote server, that's part of the InitialContext object created for the JNDI Context. It also looks like there is some Spring components that look after this mapping: in the context.xml, there is jee:local-slsb. I don't know if there is an equivalent for annotations.

I haven't done any of this myself, but the documentation is probably a good start.