hi all,
I'm getting a starnge problem,when I run aplication thru the browser.It's
worked finely when I tested it with a satnd alone client.
I'm listing the error.(it's throwing ClassCastException,but it's a generic
error in weblogic ,I think).
I'm using weblogic5.1 and OS is NT4.0
error is:

 getting  intialcontext
 got   intialcontext
 returning  intialcontext
 intialfactiry returned AND GOINGGGGGGGGGGGGGGGGG to get home
 home object is
returned:7657com.cmc.InternetBanking.login.ejb.LoginEJBHomeImpl
[EMAIL PROTECTED]:[7001,7001,7002,7002,7001,-1]
newl
ogin [
newlogin
]
Caught an ClassCastException in validate99
:com.cmc.InternetBanking.login.ejb.Lo
ginEJBHomeImpl_ServiceStub
java.lang.ClassCastException:
com.cmc.InternetBanking.login.ejb.LoginEJBHomeImpl
_ServiceStub
        at
com.cmc.InternetBanking.login.web.CheckPasswordBean2.Validate(CheckPa
sswordBean2.java:171)
        at jsp_servlet._inetbank._newlogin._jspService(_newlogin.java,
Compiled
Code)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java, Compiled Code)
        at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java, Compiled Code)
        at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java, Compiled Code)
        at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java, Compiled Code)
        at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a, Compiled Code)
        at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Com
piled Code)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)



My Code:(Java Bean):

public boolean Validate(){
  if(pin!=null) {
    try {
      System.out.println("Entered the newwwwwwwwwwwwwwwwwwwwww validate
method");
    System.out.println("pin is:"+pin);
    System.out.println("Into the Validate() method");
    file://addLogin();
    file://System.out.println("logininfo added");
    file://Context initial=new InitialContext();
    file://initial=new InitialContext();
    System.out.println("After initialContext method");
    /********************** Look Up using weblogic context factory
****************/

    file://Context ctx = getInitialContext();
    getInitialContext();
    file://LoginHome home2=null;

    log(" intialfactiry returned AND GOINGGGGGGGGGGGGGGGGG to get home");
    Object home1=null;
    home1 =  initial.lookup("newlogin");

    log (" home object is  returned:7657"+home1);
    home= (LoginHome) PortableRemoteObject.narrow(home1, LoginHome.class);
          log (" home  is  returned:"+home);

    file://LoginHome home2 = lookupHome();
    System.out.println("After returning from LookUp.........*********.");

    file://home = (com.cmc.InternetBanking.login.ejb.LoginHome) home1;
    file://System.out.println("In Bean:got object ");

    file://LoginHome home
=(LoginHome)PortableRemoteObject.narrow(obj,LoginHome.class);
    file://System.out.println("In Bean:got home :"+home2);

    file://LoginHome
home=(LoginHome)LookUp.getHome("login",LoginHome.class);
    file://Login login = (Login) PortableRemoteObject.narrow(home.create(id,
balance, accountType),Login.class);
    /********************** Look Up is over  using weblogic context factory
************/
    file://objref=initial.lookup("login");
    file://System.out.println("After Lookup");
    file://LoginHome
home=(LoginHome)PortableRemoteObject.narrow(objref,LoginHome.class);
    file://LoginHome home=EJBUtil.getLoginHome();
    System.err.println("login home cerated"+home+"PIN:"+pin);
    login=home.findByPrimaryKey(pin);
    System.err.println("login object cerated");
    String spwd=(String)login.getPassword();
    System.err.println("pasword from EJB:"+spwd);
    file://String spwd1=(String)login.getPassword1();
    file://System.err.println("pasword1 from EJB:"+spwd1);

    System.err.println("Decrypted passwords9");
    String dpwd=encryption.decryptData(spwd);
    System.err.println("pasword from EJB:"+dpwd);
    file://String dpwd1=encryption.decryptData(spwd1);
    file://System.err.println("pasword1 from EJB:"+dpwd1);


      file://if(password.equals(dpwd))
      if(password.equals(dpwd)){
        System.err.println("Passwords are matched ,user is successfully
logged in,Redirecting to j2ee loginpage");
        flag=true;
    }else {
           System.err.println("Passwords aresswords are not  m not  matched
,Redirecting to  loginpage");
       }
     }catch(ClassCastException ce){
      System.out.println("Caught an ClassCastException in validate99
:"+ce.getMessage());
      ce.printStackTrace();
     }catch(javax.naming.NamingException ne){
      System.out.println("Caught a Naming  exception in validate99
:"+ne.getMessage());
      ne.printStackTrace();
     }catch(Exception e){
      System.out.println("Caught an exception in validate99
:"+e.getMessage());
      e.printStackTrace();
     }
  }
     return flag;
  }


 private void getInitialContext() throws NamingException {

    try {
        // Get an InitialContext
        Properties h = new Properties();
        h.put(Context.INITIAL_CONTEXT_FACTORY,
            "weblogic.jndi.WLInitialContextFactory");
        h.put(Context.PROVIDER_URL, url);
        if (user != null) {
          log ("user: " + " ");
          h.put(Context.SECURITY_PRINCIPAL, " ");
          log (" putting the user in to the intialfactiry");
          if (password1 == null)
          password1 = "";
          h.put(Context.SECURITY_CREDENTIALS, " ");
          log (" putting the password in to the intialfactiry");
        }
        log (" getting  intialcontext");
        initial=new InitialContext(h);
        log (" got   intialcontext");
        file://return new InitialContext(h);
      } catch (NamingException ne) {
        log(" Caught an exception:"+ne.getMessage());
        ne.printStackTrace();
      }

      catch (Exception e) {
         log(" Caught an exception:"+e.getMessage());
           e.printStackTrace();
      }
      log (" returning  intialcontext");

   // return initial;
  }

private static void log(String s) {
    System.out.println(s);
  }


Awaiting your early response.
Thanks in advance.
Sreenivas,
VISIC,CMCLtd.Hyderabad-19

Phone no (O):(040)3000401 extn2166,2168

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to