?
Solved

A Jini and RMI problem: Class is not a valid remote interface

Posted on 2003-03-08
9
Medium Priority
?
510 Views
Last Modified: 2007-12-19
i've been trying to compile stubs for a Jini example i have to run but can't

rmic -d D:\JUSTIN~1\sampledir\EXPERI~1\ch9 -classpath D:\JUSTIN~1\sampledir    EXPERIMENTS.ch9.JINIConnectorImpl

it gives me errors:

EXPERIMENTS.ch9.JINIConnecterImpl is not a valid remote interface: method java.lang.Integer getMBeanCount() must throw java.rmi.Exception

EXPERIMENTS.ch9.JINIConnecterImpl is not a valid remote interface: method javax.management.ObjectInstance createMBean() must throw java.rmi.Exception


0
Comment
Question by:gonx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 8096076
You need to define that those methods throw java.rmi.Exception as stated in error message.
0
 

Author Comment

by:gonx
ID: 8096628
I have a class JINIConnectorException..

package EXPERIMENTS.ch9;

import java.rmi.*;

public class JINIConnectorException extends RemoteException
{
    public Exception exception = null;
    public JINIConnectorException( String message, Exception ex )
    {
        super( message, ex );
        this.exception = ex;
    }
   
    public Exception getWrappedException()
    {
        return exception;
    }
}

it is inherited by this class ..
---------------------------------
package EXPERIMENTS.ch9;
import java.rmi.*;
import javax.management.*;
import EXPERIMENTS.ch9.JINIConnectorException;
public interface JINIConnector extends Remote
{
   
    public Integer getMBeanCount() throws JINIConnectorException;
    public ObjectInstance createMBean(String className,
                                        ObjectName name) throws JINIConnectorException;}
---------------------------------

so in effect my understanding is that the methods still retain their java.rmi.Exception types (sorry im a newbie)
so i don't get why the rmic compiler is giving me the errors.
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 8096649
I don't think it really makes sense to declare throwing a subclass of RemoteException, as the throwing of the RemoteException is not done from your code and is intended for problems with RMI comms.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:gonx
ID: 8096863
So i should do away with the subclass JINIConnectorException and just declare

public Integer getMBeanCount() throws RemoteException
public ObjectInstance createMBean(String className,
                                       ObjectName name throws RemoteException;}




0
 
LVL 92

Expert Comment

by:objects
ID: 8096898
I believe so.
0
 

Author Comment

by:gonx
ID: 8097388
i got to revise the code but it still gave me errors.. anyway i went back to the site where i got the example. Luckily it had the revised code so its compiling now but with more errors. The rmic has been giving me a javax.management.<class> not found.
0
 

Expert Comment

by:CleanupPing
ID: 9058838
gonx:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9693339
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to objects

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question