由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - JEE EJB Question
相关主题
怎么能学成J2EE的全能Any good book recommendation for EJB?
Does EJB specification require the use of other eSpring 工作机会好象不多啊!
EJB Server光学Java Standard 本身是不是永远不够?
Help: J2EE beginner Deploy problemJEE 6 看起来不错
J2EE入门any good j2ee book?
想请教J2EE的JNDI是如何实现的。去做J2EE好,还是Android好?
怎么快速掌握J2EE?weblogic 分布式问题
java ldap by novell or netscape directory sdk?对J2EE的几个迷惑 (转载)
相关话题的讨论汇总
话题: client话题: ejb话题: jee话题: url话题: remote
进入Java版参与讨论
1 (共1页)
b*******9
发帖数: 15
1
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
g*****g
发帖数: 34805
2
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

A**o
发帖数: 1550
3
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

b*******9
发帖数: 15
4
Thanks. But no any JNDI for this session bean.

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

b*******9
发帖数: 15
5
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

A**o
发帖数: 1550
6
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

t*******e
发帖数: 684
7
Post your code that locates the remote session bean pls.
g*****g
发帖数: 34805
8
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

b*******9
发帖数: 15
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
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.
g*****g
发帖数: 34805
10
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

相关主题
想请教J2EE的JNDI是如何实现的。Any good book recommendation for EJB?
怎么快速掌握J2EE?Spring 工作机会好象不多啊!
java ldap by novell or netscape directory sdk?光学Java Standard 本身是不是永远不够?
进入Java版参与讨论
t*******e
发帖数: 684
11
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.
A**o
发帖数: 1550
12
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.

b*******9
发帖数: 15
13
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.

b*******9
发帖数: 15
14
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.

b*******9
发帖数: 15
15
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.

A**o
发帖数: 1550
16
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.

w******f
发帖数: 620
17
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
1 (共1页)
进入Java版参与讨论
相关主题
对J2EE的几个迷惑 (转载)J2EE入门
java在美国到底怎样?想请教J2EE的JNDI是如何实现的。
Difference btw EJBLocalHome and EJBHome?怎么快速掌握J2EE?
OutofMemoryError: Java Heap Spacejava ldap by novell or netscape directory sdk?
怎么能学成J2EE的全能Any good book recommendation for EJB?
Does EJB specification require the use of other eSpring 工作机会好象不多啊!
EJB Server光学Java Standard 本身是不是永远不够?
Help: J2EE beginner Deploy problemJEE 6 看起来不错
相关话题的讨论汇总
话题: client话题: ejb话题: jee话题: url话题: remote