Wrox Home  
Search P2P Archive for: Go

  Return to Index  

enterprise_java_beans thread: help me,this err!


Message #1 by "toxin" <toxin@b...> on Tue, 11 Jun 2002 08:26:47
Send more details and all the soft you have, and the home - remote and
implemetation class like the deployment ejb.jar.
Put all in a .zip and send it.
What application server you use.


   Julio Oliveira
Buenos Aires - Argentina
Java Developer - Instructor - Cursos @-Mail
-------------------------------------------
JOliveiraAR@y...
Oliveira_julio@y...

***********************************************************************

-----Mensaje original-----
De: toxin [mailto:toxin@b...]
Enviado el: martes 11 de junio de 2002 8:27
Para: Enterprise Java Beans
Asunto: [enterprise_java_beans] help me,this err!


where I run it:
java SalaryClient

err info is:

Exception in thread "main" java.lang.NoClassDefFoundError:
javax/naming/NamingException

SalaryClient.java
import javax.ejb.*;
import simpleBean.*;
import javax.naming.InitialContext;

class SalaryClient {

  public static void main(String[] args) {

    try {

       InitialContext ctx = new InitialContext();
       Object objRef = ctx.lookup("Salary");

       SalaryHome home = (SalaryHome)javax.rmi.PortableRemoteObject.narrow(
                             objRef, SalaryHome.class);

       Salary bean = home.create();

       System.out.println("Monthly net salary: " +
             bean.calculateSalary(28000, 2, 500));

    } catch (javax.naming.NamingException ne) {
      System.out.println("Naming Exception caught: " + ne);
    } catch (javax.ejb.CreateException ce) {
      System.out.println("Create Exception caught: " + ce);
    } catch (java.rmi.RemoteException re) {
      System.out.println("Remote Exception caught: " + re);
    }
  }
}


why?


  Return to Index