Results 1 to 6 of 6

Thread: Class Not found

  1. #1
    jitendra is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default Class Not found

    i creating rmi application using swing. when i start the client program the following errors will appear:



    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: RmiServer_Stub (no security manager: RMI class loader disabled)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

  2. #2
    jitendra is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default Exception occured

    i did following work:
    i create service for server program and the service is successfully installed.
    when i execute the client program from command prompt then it work fine.

    now i create jar files for both client and server program.it can't include Server_stub class. But when i execute
    both the jar it will work fine.

    At last i want to start my client program using java swing program.This program has two package one is client containing Rmiclient.java file and second package containing ReceiveMessageInterface.Second package is commaon for both client and server program.
    When i execute the client program it will display following exception:

    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: RmiServer_Stub (no security manager: RMI class loader disabled)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

  3. #3
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by jitendra View Post
    When i execute the client program it will display following exception:

    first thing to check: are you sure that all needed class-files are available in the folder where you start your main? other question: how do you create your jar-file(s)?

  4. #4
    jitendra is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default

    all class files are placed in main folder. Only RmiServer_Stub class is not there because it will create after compiling the RmiServer class with rmic(RMI compiler).
    i create jar file using following command:
    java cvmf main.txt server.jar RmiServer.class

    content of main file:

    Manifest-Version: 2.0
    Main-Class: RmiServer

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by jitendra View Post
    all class files are placed in main folder. Only RmiServer_Stub class is not there because it will create after compiling the RmiServer class with rmic(RMI compiler).
    Since Java 1.5 you don't need to use rmic anymore: reflection does the job.

    kind regards,

    Jos

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,199
    Rep Power
    19

Similar Threads

  1. Class not found Exception
    By surendra in forum Java Servlet
    Replies: 8
    Last Post: 06-09-2011, 12:52 PM
  2. Main Class not found
    By Draugnar in forum New To Java
    Replies: 3
    Last Post: 01-09-2010, 03:12 AM
  3. man.java class not found
    By oneofthelions in forum Advanced Java
    Replies: 0
    Last Post: 12-14-2009, 11:32 PM
  4. No Class Def Found Error:
    By fithous in forum Java Applets
    Replies: 0
    Last Post: 04-02-2009, 05:30 PM
  5. No Class Def Found Error:
    By wrap23 in forum New To Java
    Replies: 9
    Last Post: 10-02-2008, 04:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •