Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMIC in WLS 6.1 "Doesn't work"?

0 views
Skip to first unread message

Roger Lee

unread,
Aug 29, 2001, 6:57:08 PM8/29/01
to

Trying to move a working RMI Application from WLS 6.0 to 6.1. The WLS 6.1 RMIC
compiler doesn't generate the Stubs & Skels from my Impl Class. No errors, just
returns to the DOS prompt (Windows 2000 Prof.) with nothing generated. Any ideas?

Thanks.

Don Ferguson

unread,
Aug 29, 2001, 7:24:19 PM8/29/01
to
This is a feature. We no longer generate stub or skel classes. For stubs, we now
use dynamic proxies and for skels we do hot code gen (that is, we generate the
bytecode in memory for the skel class). So (except for IIOP) we no longer need to
generate classes. Under some circumstances, RMIC will generate an XML deployment
descriptor.

Roger Lee

unread,
Aug 30, 2001, 6:33:37 AM8/30/01
to

Thanks. Perhaps the RMI documentation could be upgraded as it still refers to generating
stubs & skels.

Roger Lee

unread,
Aug 30, 2001, 10:15:14 AM8/30/01
to

Contradicts what you said. However I have my RMI application now running under
6.1

http://e-docs.bea.com/wls/docs61/notes/migrate.html#1071425

The following tips are for users migrating to WebLogic Server 6.1 who used RMI
in their previous version of WebLogic Server:

Re-run the WebLogic RMI compiler, weblogic.rmic, on any existing code to regenerate
the wrapper classes so they are compatible with WebLogic Server 6.1.

Use java.rmi.Remote to tag interfaces as remote. Do not use weblogic.rmi.Remote.


Use java.rmi.*Exception (e.g., import java.rmiRemoteException;). Do not use weblogic.rmi.*Exception.


Use JNDI instead of *.rmi.Naming.

Use weblogic.rmic to generate stubs and skeletons.

Use weblogic.rmi.server.UnicastRemoteObject.exportObject() to get a stub instance.


The RMI examples have not currently been updated to use java.rmi.* and JNDI. The
examples will be revised to reflect java.rmi.* and JNDI in a future release.

Daniel Hoppe

unread,
Aug 30, 2001, 2:23:29 PM8/30/01
to
Hmm. I tried without the stubs. What I got was a ClassNotFoundexception
because the stub was not there. Anything specific I would have to look
for? Which Classloader knows of these dynamically generated Skeletons?

Thanks,

Daniel

Don Ferguson

unread,
Aug 30, 2001, 6:24:57 PM8/30/01
to Daniel Hoppe
Could you post the exact stack trace, and provide more details about what
you are doing (and what release you're using)?

Don Ferguson

unread,
Aug 31, 2001, 12:53:19 PM8/31/01
to
Thanks for the feedback. I've logged a bug report for the doc group to update the RMIC documentation.

-Don

roberto giordano

unread,
Nov 13, 2001, 3:57:28 PM11/13/01
to

Hi,

I followed the indications that Roger Lee posted (Thanks!), but I still have
some problems with RMI and WL61.

- I'm trying to instantiate an object in an Applet that is registered in Weblogic.
It was registered using JNDI as sugested, and it worked fine (it doesn't throw
any exception). But when I try to get a reference to it in my Applet, I get the
following exception:
"javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
Root exception is java.lang.ClassNotFoundException: java.io.IOException: open
HTTP connection failed."
followed by some more AccessControlExceptions. Here is the code that I use to
try to get a remote reference in the Applet:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://" + getCodeBase().getHost() + ':' + port);
Context ctx = new InitialContext(env);
Object o = ctx.lookup("HelloServer");
Hello hello = (Hello) o;

And here is the registration code used in the Server class:
HelloImpl obj = new HelloImpl();
Context ctx = new InitialContext(null);
ctx.bind("HelloServer", obj);

Am I doing something wrong ???


Some other quick doubts:

- The method that Roger Lee mentioned (java.rmi.server.UnicastRemoteObject.exportObject(obj))
is used for what? It's used as an alternative way for register an RemoteObject,
or I need to register in JNDI the stub returned by this method ??

- weblogic.rmic is totally useless if I'm not working with IIOP, is that right?
I'm asking it because I've got a little confused with all the posts about it
that I've found. I weren't able to generate any stubs nor skeletons with it. Only
an idl.

Thanks a lot for the incoming Help!!

RGB

Fabio Tassinari

unread,
Nov 23, 2001, 6:55:58 AM11/23/01
to

Roberto,

I did the same example with Applet and RMI using JNDI, like you.

The message that appear to me was


java.lang.ClassCastException: weblogic.rmi.internal.StubInfo
at RmiApplet.init(RmiApplet.java:62)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.lang.RuntimePermission
exitVM)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkExit(Unknown Source)
at java.lang.Runtime.exit(Unknown Source)
at java.lang.System.exit(Unknown Source)
at RmiApplet.init(RmiApplet.java:70)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


To solve this I create a java.policy with this lines:

grant {
permission java.security.AllPermission;
};


And chaged this file at workstation's plugin directory.

Fabio Tassinari

0 new messages