You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mik <ws...@gmail.com> on 2005/08/10 18:58:46 UTC

Web Service Provider and Applet of JFrame

I have a question:
There is any very simple way to get data from a Web Service provider
(not a client) and show it
in a JFrame or an Applet ?.

I am trying to use RMI. 
First getting data trough the web service and then send it to an
Applet  trough an rmi call but i have some problems setting the java
policy file, i get this error:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
	java.lang.ClassNotFoundException: Hello (no security manager: RMI
class loader disabled).

Any idea how to do it in tomcat 5.5.

There is any other alternative way to rmi ?

Thanks in advance for any help.

RE: Web Service Provider and Applet of JFrame

Posted by Steven Smith <st...@geometryit.com>.
The problem is that your classes can not be found. There are a few ways to
get them where they need to be, but it helps to know where they can't be
found from: the server, the RMI registry, or the client. This can be even
more difficult to determine because the error can show on the server or the
client, even though it is a problem with the registry. Usually it is the RMI
registry.

If it is, then you need to setup a way for the registry to find your
classes. In your error message it says that the RMI class loader is
disabled. This is one way of getting your classes. Publish the class files
on a web-server and pass this URL to the server side of your code when you
execute it using a System Property (-Djava.rmi.server.codebase=<url to
classes>).

Alternatively, you can just give the classes to the RMI registry when you
instantiate it. This is the wrong way to go about it, but as long as the
classes are the same as the server is using, it will not cause problems. The
idea is that the registry knows nothing about your system, so it should not
have access to your classes. When the server binds itself to the registry,
it sends the server codebase property to the registry and then the registry
uses that URL to find the classes it requires. 

Personally, I find it a pain to have a web-server publishing my classes when
I am setting up the RMI registry only for my application, so I just pass the
classes to the registry to avoid yet another process needed to make things
work.

In Java 1.5 you can even setup the RMI registry inside your server to avoid
having a separate process for the RMI registry, which would accomplish what
I have described above, but I have not done this myself yet (but will when I
get time).

Also, I found that I did not need policy files when I gave the classes
straight to the RMI registry, even though the Java RMI tutorial said that
you must have a policy file even to bind to the registry.

Hope that helps.


-- 
Steven Smith <st...@geometryit.com>
Software Developer / Analyst
Geometry Pty Ltd

	
Telephone	 : 	 03 6223 1999	
Facsimile	 : 	 03 6223 1988	
Web	 : 	 www.geometryit.com	
Address	 : 	 31 Salamanca Square, Battery Point, TAS 7004, Australia

Postal	 : 	 PO Box 844, Sandy Bay, TAS 7006, Australia	
	 	

-----Original Message-----
From: Mik [mailto:wsdeveloper@gmail.com] 
Sent: Thursday, 11 August 2005 2:59 AM
To: axis-user
Subject: Web Service Provider and Applet of JFrame

I have a question:
There is any very simple way to get data from a Web Service provider (not a
client) and show it in a JFrame or an Applet ?.

I am trying to use RMI. 
First getting data trough the web service and then send it to an Applet
trough an rmi call but i have some problems setting the java policy file, i
get this error:

java.rmi.UnmarshalException: error unmarshalling return; nested exception
is: 
	java.lang.ClassNotFoundException: Hello (no security manager: RMI
class loader disabled).

Any idea how to do it in tomcat 5.5.

There is any other alternative way to rmi ?

Thanks in advance for any help.