I have a rather odd architecture here. What I am attempting to do is have
multiple instances of the same object registered using some king of unique
key(kind of like an Entity bean PK). So at any one time I may have 0 or more
of these objects out in the world and I would have a requirements to be able
to execute 1 method on these objects and have that method carried out, no
matter where in the world this object resides. Now the key is that I want
the one registry for these objects to be local(at our site). These objects
happen to be assigned to a specific person(who we have a PK for in Jboss).
When the user initializes there application it comes in over the internet
and registers with our naming service using the members PK and the unique
key. Our service can then notify them of events, real-time.

This is what I'm trying to do in a nutshell. If my design could be improved,
please let me know, otherwise I assume that this should work(after we get
the remote registering service to work : ) ) 

-John

-----Original Message-----
From: marc fleury [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 31, 2000 4:40 PM
To: jBoss
Subject: RE: [jBoss-User] perplexing problem

OK, well first the simplest thing for us is to make sure that JNP works in
distributed registering (which it should, we still have to establish that
what you are seeing is a bug :) and then no need for the servlet bypass.

Now as far as remote vs local, jboss ships a part of the container if you
wish to the client.  Some local methods can be executed (mostly the Object
and some EJBObject methods).  All the business methods however ARE executed
on the server, the copy of the real instance is always on the server.

marc


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of John McDonald
Sent: Thursday, August 31, 2000 3:32 PM
To: 'jBoss'
Subject: RE: [jBoss-User] perplexing problem


Marc,
Well, here is the problem I'm having. A remote object cannot register itself
over the network(per my last email). So I tried sending this object(in a
hashmap with some other data) to a servlet. I want the servlet to be
responsible for registering the object. The problem is that when I retrieve
the remote interface for this object(context.lookup("someobject")) and call
a method on it, for some reason a local copy of the object is being executed
instead of the remote object. I know this is happening because I have two
console windows open: one which represents the remote object and one for the
servletserver. The method I am executing simply prints some stuff to the
console. The servlet server window is written to, not the window for the
remote object.

I hope I explained that correctly. Any ideas?

-----Original Message-----
From: marc fleury [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 31, 2000 3:24 PM
To: jBoss
Subject: RE: [jBoss-User] perplexing problem

come again?

marc

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of John McDonald
Sent: Thursday, August 31, 2000 3:11 PM
To: 'jBoss'
Subject: RE: [jBoss-User] perplexing problem
Is there a way that I can pass a reference of the object to the remote
server, register is "locally" on the server and still maintain the reference
to the remote object and not a local object representation of the remote
object?



-----Original Message-----
From: John McDonald [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 31, 2000 2:07 PM
To: 'jBoss'
Subject: RE: [jBoss-User] perplexing problem

I really appreciate your reply Marc. One note is that on the DreamBean site,
the JNP(java naming provider), which I think was written by Rickard, claims
that one can bind objects remotely. This is exactly what I need.
Rickard..are you out there. The link is: http://www.dreambean.com/jnp.html.
It's at the bottom of the page. I haven't specifically tried using his
naming provider because I assumed that it is was bundled with Jboss.

If anyone has tried binding objects remotely, please let me know of your
success. In the mean time, I'll open a bug report.

Thanks.

-jdm

-----Original Message-----
From: marc fleury [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 31, 2000 2:07 PM
To: jBoss
Subject: RE: [jBoss-User] perplexing problem

that is interesting I guess we never tried to get the naming service on a
separate machine, but we should do that as we move to production quality and
offer redundant naming services....

interesting, please open a bug with this and we will try to see whether it
is real.  Any information you can dig is useful john, thanks

marc

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of John McDonald
Sent: Thursday, August 31, 2000 1:26 PM
To: '[EMAIL PROTECTED]'
Subject: [jBoss-User] perplexing problem
I'm trying to bind an object using jndi. It works great on my local machine,
but when I move the application to another machine and attempt to bind "over
the network" I get an NPE in NamingContext. I have to be missing something.
Can some please help me out with this. It's driving me _crazy_.

This is the Exception, and the Code is below.

I looked at the source for NamingContext and line 251, and 222 are nothing.
<exception>
java.lang.NullPointerException:
        at org.jnp.interfaces.NamingContext.bind(NamingContext.java:251)
        at org.jnp.interfaces.NamingContext.bind(NamingContext.java:222)
        at javax.naming.InitialContext.bind(InitialContext.java:303)
        at
com.tradingproduce.TestMemberRegistration.bindObject(TestMemberRegistration.
java:84)
        at
com.tradingproduce.TestMemberRegistration.<init>(TestMemberRegistration.java
:23)
        at
com.tradingproduce.TestMemberRegistration.main(TestMemberRegistration.java:2
7)
</exception>

Server is the class which implements extends UnicastRemoteObject and
implements the remote interface(this is rmi specific, do I still have to do
this for jndi?) Jboss is running on 63.199.148.48 and naming is started on
port 2101.
<code>
public void bindObject(){
     try{
       if(System.getSecurityManager() == null){
        System.setSecurityManager(new RMISecurityManager());
       }
       ObjectSignatureFactory osf = new ObjectSignatureFactory();
       ObjectSignature signature = osf.getObjectSignature(this);

       System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
       System.setProperty("java.naming.provider.url", "63.199.148.48:2101");
       Server server = new Server();

       //bind that baby!
       new InitialContext().bind("/applet/" + signature.getSignature(),
server);
       System.out.println("Server bound and running..");
     }catch(Exception e){e.printStackTrace();}
   }
</code>

What am I missing here?

-jdm



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to