gonx
asked on
A Jini and RMI problem: Class is not a valid remote interface
i've been trying to compile stubs for a Jini example i have to run but can't
rmic -d D:\JUSTIN~1\sampledir\EXPE RI~1\ch9 -classpath D:\JUSTIN~1\sampledir EXPERIMENTS.ch9.JINIConnec torImpl
it gives me errors:
EXPERIMENTS.ch9.JINIConnec terImpl is not a valid remote interface: method java.lang.Integer getMBeanCount() must throw java.rmi.Exception
EXPERIMENTS.ch9.JINIConnec terImpl is not a valid remote interface: method javax.management.ObjectIns tance createMBean() must throw java.rmi.Exception
rmic -d D:\JUSTIN~1\sampledir\EXPE
it gives me errors:
EXPERIMENTS.ch9.JINIConnec
EXPERIMENTS.ch9.JINIConnec
You need to define that those methods throw java.rmi.Exception as stated in error message.
ASKER
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.JINIConnec torExcepti on;
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.
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.JINIConnec
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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;}
public Integer getMBeanCount() throws RemoteException
public ObjectInstance createMBean(String className,
ObjectName name throws RemoteException;}
I believe so.
ASKER
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.
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.
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.
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
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