avatar
JEE EJB Question# Java - 爪哇娇娃
s*n
1
我推荐你看个小说吧,江南的《上海堡垒》。
avatar
b*9
2
JEE 高手:
本人正自学JEE,有个问题想请教。I found an application client directly calls
session bean remote interface without URL in the client program. I just don'
t understand why it can call from one computer to another computer (or from
one JVM to anther JVM) without URL. What is the mechanism? Or where is the
URL defined or established?
Thanks.
Bajamin
avatar
wh
3
哇,此间少年的作者嘛,灵的灵的。此间有没有后续啊,盼啊盼。你贴个链接吧,嘻嘻
。谢谢谢谢。

【在 s***n 的大作中提到】
: 我推荐你看个小说吧,江南的《上海堡垒》。
avatar
g*g
4
Usually remote service needs to register in JNDI.

calls
don'
from

【在 b*******9 的大作中提到】
: JEE 高手:
: 本人正自学JEE,有个问题想请教。I found an application client directly calls
: session bean remote interface without URL in the client program. I just don'
: t understand why it can call from one computer to another computer (or from
: one JVM to anther JVM) without URL. What is the mechanism? Or where is the
: URL defined or established?
: Thanks.
: Bajamin

avatar
A*o
5
it's in the client configuration, and many are application specific.

calls
don'
from

【在 b*******9 的大作中提到】
: JEE 高手:
: 本人正自学JEE,有个问题想请教。I found an application client directly calls
: session bean remote interface without URL in the client program. I just don'
: t understand why it can call from one computer to another computer (or from
: one JVM to anther JVM) without URL. What is the mechanism? Or where is the
: URL defined or established?
: Thanks.
: Bajamin

avatar
b*9
6
Thanks. But no any JNDI for this session bean.

【在 g*****g 的大作中提到】
: Usually remote service needs to register in JNDI.
:
: calls
: don'
: from

avatar
b*9
7
Thanks. But I didn't find anything in client configuration.
I guess maybe it is done by multiple computers (servers, or JVM)
configuration.
Does anybody have this experiences?
Thanks.
Zhangshi

【在 A**o 的大作中提到】
: it's in the client configuration, and many are application specific.
:
: calls
: don'
: from

avatar
A*o
8
it's for sure not in your session bean.
what's your application container,
what's your application client?

【在 b*******9 的大作中提到】
: Thanks. But I didn't find anything in client configuration.
: I guess maybe it is done by multiple computers (servers, or JVM)
: configuration.
: Does anybody have this experiences?
: Thanks.
: Zhangshi

avatar
t*e
9
Post your code that locates the remote session bean pls.
avatar
g*g
10
Haven't been working on ejb for a long time, but check your xmls,
it should be somewhere in it.

【在 b*******9 的大作中提到】
: Thanks. But I didn't find anything in client configuration.
: I guess maybe it is done by multiple computers (servers, or JVM)
: configuration.
: Does anybody have this experiences?
: Thanks.
: Zhangshi

avatar
b*9
11
I posted all codes here. Part 1 is remote insterface. Part 2 is session bean.
Part 3 is client. You can see the client directly call remote interface
without URL. The client has no xml. Thanks.
Part 1
package order.request;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.ejb.Remote;
@Remote
public interface Request
{
void addLineItem(
Integer orderId,
String partNumber,
int revision,
int quantity);
void addPart

【在 t*******e 的大作中提到】
: Post your code that locates the remote session bean pls.
avatar
g*g
12
If OrderClient doesn't need any parameter, what's the point of
having a method
public OrderClient(String[] args)
I suspect the point is to pass args and create an InitialContext there.
Your code can run fine only if it's inside JEE container.

bean.

【在 b*******9 的大作中提到】
: I posted all codes here. Part 1 is remote insterface. Part 2 is session bean.
: Part 3 is client. You can see the client directly call remote interface
: without URL. The client has no xml. Thanks.
: Part 1
: package order.request;
: import java.io.Serializable;
: import java.util.Collection;
: import java.util.Date;
: import javax.ejb.Remote;
: @Remote

avatar
t*e
13
Injection through @EJB only works with app clients, typically deployed as a
client module in an ear. Standalone clients have to use JNDI to lookup EJBs.
avatar
A*o
14
as i'd suspected, it's only the java source code,
w/o configuration...
source code is for demo only, lz needs a container
to get the details configuration set.
and the client here is an application client,
which as you said, requires a container to run as well.
again, for lz, it's container specific,
find one and read the docs.

【在 g*****g 的大作中提到】
: If OrderClient doesn't need any parameter, what's the point of
: having a method
: public OrderClient(String[] args)
: I suspect the point is to pass args and create an InitialContext there.
: Your code can run fine only if it's inside JEE container.
:
: bean.

avatar
b*9
15
In my example, ejb and client is in the same ear. You mean this is called
the inside JEE container? I want to modify the client in different computer
to call ejb. Do you know how to do that?
Thanks.

【在 g*****g 的大作中提到】
: If OrderClient doesn't need any parameter, what's the point of
: having a method
: public OrderClient(String[] args)
: I suspect the point is to pass args and create an InitialContext there.
: Your code can run fine only if it's inside JEE container.
:
: bean.

avatar
b*9
16
Yes, I want to make standalone client to call remote ejb. How to modify it?
Do you have a good example?
Thanks.

a
EJBs.

【在 t*******e 的大作中提到】
: Injection through @EJB only works with app clients, typically deployed as a
: client module in an ear. Standalone clients have to use JNDI to lookup EJBs.

avatar
b*9
17
What does container mean here?
How to configure a client to call remote ejb?
Thanks.

【在 A**o 的大作中提到】
: as i'd suspected, it's only the java source code,
: w/o configuration...
: source code is for demo only, lz needs a container
: to get the details configuration set.
: and the client here is an application client,
: which as you said, requires a container to run as well.
: again, for lz, it's container specific,
: find one and read the docs.

avatar
A*o
18
which application server you are using? glassfish?
read it's ejb example project.

【在 b*******9 的大作中提到】
: What does container mean here?
: How to configure a client to call remote ejb?
: Thanks.

avatar
w*f
19
You need use the JNDI look up to find the register EJB bean, here is the
sample code for jboss container.
Under jboss, the JNDI port is 1099 and 1098, EJB access port is 3837. You
need make sure those port is on when your client want to remote invoke a
server under firewall
public static void init(String server) {
mServer = server;
CONTEXT_PROPERTIES = new Properties();
CONTEXT_PROPERTIES.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.Namin
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。