-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: error in typecasting to form
PostPosted: Fri Apr 06, 2007 7:24 am 
Newbie

Joined: Sun Mar 25, 2007 9:56 am
Posts: 2
Am using hibernate with struts. I wrote two ActionForms and for each ActionForm I wrote two .hbm.xml files they are LoginActionForm.hbm.xml & MailActionForm.hbm.xml. My code is shown below.


Code:
public boolean validateEmail(String userid,String email){
        System.out.println("AM IN HIBERDAO CLASS");
        Session session=connectHibernate();
        Transaction tran=session.beginTransaction();
       
        System.out.println("Iteration started****************Email");
        Query query=session.createQuery("from LoginActionForm");
        System.out.println("Iteration started****************Email");
        Iterator queryitr=query.iterate();
        boolean status=false;
        System.out.println("EMAIL TO ITERATE*********************");
        while(queryitr.hasNext()){
            MailActionForm maf=(MailActionForm)queryitr.next();
           
            if(userid.equals(maf.getUserid()) && email.equals(maf.getEmail())){
                status=true;
                break;} else
                    status=false;
           
        } System.out.println("Iteration complete****************Email");
        disconnectHibernate(session,tran);
       
        return status;
    }


I got the following error

Code:
java.lang.ClassCastException: com.miracle.forms.LoginActionForm$$EnhancerByCGLIB$$bb49811c
   com.miracle.hibernate.HiberConnect.validateEmail(HiberConnect.java:37)
   com.miracle.action.EmailAction.execute(EmailAction.java:62)
   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


I DONT UNDERSTAND WHAT THE ERROR ACTUALLY IS . CAN ANY BODY HELP ME

_________________
Venu madhav.Y
Miracle Software Systems


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 07, 2007 6:37 am 
Newbie

Joined: Sun Oct 08, 2006 8:03 am
Posts: 14
Can you say which is line 37 in your source? Also, it may help to post your xml files.

John.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.