JSP client in RMI system - java.rmi.UnmarshalException: error unmarshalling

Hi,

Im developing a login part for a distributed airline reservation system using JSP as the client but while executing the jsp, the error that is being catched is :

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

Here are my codes:

//Interface - Airline.java

package Air;

import java.rmi.*;

publicinterface Airlineextends Remote

{

publicint CheckUname(String username)throws RemoteException;

}

//implementation - AirlineImpl.java

import java.net.*;

import java.io.*;

import java.sql.*;

import java.rmi.*;

import java.rmi.server.UnicastRemoteObject;

publicclass AirlineImplextends UnicastRemoteObjectimplements Airline

{

public AirlineImpl()throws RemoteException

{

super();

}

publicint CheckUname(String username)throws RemoteException

{

try

{

int UnameCount = 0;

String xxx ="eaglebeta";

if(username.equals(xxx)

{

UnameCount++;

}

return UnameCount;

}

catch (Exception e3)

{

System.out.println("Error: " + e3);

return 0;

}

}

}

//Server - AirlineServer.java

import java.rmi.*;

import java.rmi.server.UnicastRemoteObject;

publicclass AirlineServer

{

publicstaticvoid main(String arg[])

{

try

{

Airline myAirline =new AirlineImpl();

Naming.rebind("Airline", myAirline);

System.out.println();

System.out.println("************************************");

System.out.println(" >>> Airline Reservation System <<< ");

System.out.println(">>> Server is Listening! <<<");

System.out.println("************************************");

System.out.println();

}

catch (RemoteException e)

{

//System.out.println("Error: " + e);

System.out.println("RMI Registry is not active!");

System.out.println("Activate RMI Registry and retry!");

System.out.println("Bye bye, exiting...");

}

catch (java.net.MalformedURLException e)

{

//System.out.println("URL Error: "+ e);

System.out.println("URL Malformed!");

System.out.println("Bye bye, exiting...");

}

}

}

//JSP client - newuser.jsp

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>

<%@ page import="java.rmi.*, javax.servlet.*" %>

<%@ page import="java.util.*, java.lang.*, java.io.*, Air.Airline" %>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#99CCFF">

<%

Object Airline =null;

try

{

Airline Air = (Airline)Naming.lookup("rmi://localhost/Airline");

String Name ="eaglebeta";

if(Air.CheckUname(Name)>0)

{

%>

Username already exists, choose another name

<%

}

else

{

%>

<%=Name%>

<%

}

}

catch (Exception e1)

{

%>

<%=e1%>

<%

}

%>

</body>

</html>

The server, implementation, interface and stub are in a folder named "Airline Server" located on my desktop.

The interface and stub again are in another folder named "Air" located in the "classes\Air" directory which is located in the tomcat 5.5 installation directory!

The JSP client is located in the "Root" folder in the tomcat 5.5 installation derectory!

1. I start the registry in the "Airline Server" folder by typing rmiregistry

2. Load the Airline Server - java AirlineServer

3. Call the jsp - http://localhost/newuser.jsp

And i get the following error:

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

Please help me to solve this problem!

[7261 byte] By [EagleBetaa] at [2007-11-26 20:52:21]
# 1
http://java.sun.com/j2se/1.5.0/docs/guide/rmi/faq.html#codebase http://java.sun.com/j2se/1.5.0/docs/guide/rmi/faq.html#wrongcodebase
ejpa at 2007-7-10 2:17:44 > top of Java-index,Core,Core APIs...
# 2

When I am including security manager in my JSP code, the browser just get blank without any display

if(System.getSecurityManager() == null)

{

System.setProperty("java.security.policy", "java.policy");

System.setSecurityManager(new RMISecurityManager());

}

Please, someone solve my problem! Im realy stuck and I don't know how to proceed! Provide me with a solution or any tutorial that would help me...

EagleBetaa at 2007-7-10 2:17:44 > top of Java-index,Core,Core APIs...