Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:44:41+00:00 2026-06-14T00:44:41+00:00

Why am I getting the ClassCastException: Wrapped exception: java.lang.ClassCastException: com.avt.model.CasePmt at com.avt.dao.impl.CasePmtDaoImpl.findAllCasePmt(CasePmtDaoImpl.java:68) at com.avt.ViewCasePmtAction.view(ViewCasePmtAction.java:127)

  • 0

Why am I getting the ClassCastException:

Wrapped exception:

java.lang.ClassCastException: com.avt.model.CasePmt
    at com.avt.dao.impl.CasePmtDaoImpl.findAllCasePmt(CasePmtDaoImpl.java:68)
    at com.avt.ViewCasePmtAction.view(ViewCasePmtAction.java:127)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at gov.pbgc.spectrum.util.SpectrumLookupDispatchAction.execute(SpectrumLookupDispatchAction.java:113)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)    
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

My implementation class is

public List<CasePmt> findAllCasePmt() {
            List list;
            list = getHibernateTemplate().executeFind(new HibernateCallback() {
                    public Object doInHibernate(Session session)
                                    throws HibernateException, SQLException {

                            Query q = session
                                            .getNamedQuery("findAll");
                            return q.list();
                    }
            });
            Iterator it = list.iterator();
            List<CasePmt> l = new ArrayList<CasePmt>();

            CasePmt voObj;
            while (it.hasNext()) {
                    voObj = new CasePmt();

                    Object[] objs = (Object[]) it.next();
                    // System.out.print("\n" + objs[0].toString());

                    if (objs[2] != null) {
                            voObj.setCaseTxNum(objs[1].toString());
                    }


    .......................
                        }
                    l.add(voObj);
            }
            return l;
    }

and my action call is :

List<CasePmt> CsList =       
             CasePmtBo.getCaseDao().findAllCasePmt();

Im getting error in line 68 which is “Object[] objs = (Object[]) it.next();” line.
Why am i getting this issue?

Any inputs..im revisiting this today and facing the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:44:42+00:00Added an answer on June 14, 2026 at 12:44 am

    I am assuming, you findAll query is to retrieve all CasePmt objects. In that case, I think you have the issue at line below:

     Object[] objs = (Object[]) it.next();
    

    as your iterator will return CasePmt object.

    Try casting it to CasePmt object as blow:

     CasePmt casePmt = (CasePmt)it.next();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following error Exception in thread main java.lang.ClassCastException: org.hibernate.impl.SessionFactoryImpl cannot be
I'm getting a class cast exception namely java.lang.ClassCastException: android.app.Application cannot be cast to greendroid.app.GDApplication
getting below error after i configure MQ connection factory. java.lang.ClassCastException: com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle incompatible with com.ibm.mq.jms.MQQueueConnectionFactory
I'm getting the following exception. Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Integer
I keep getting a ClassCastException Exception in thread main java.lang.ClassCastException: java.lang.String cannot be cast
I am getting the runtime error Exception in thread main java.lang.ClassCastException: m.compiler.datatypes.Int cannot be
I am getting the following exception: Exception in thread main java.lang.ClassCastException: javax.crypto.CipherInputStream cannot be
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String I am getting this exception in follwing
I'm getting this exception in MyBatis while trying to execute the update statement(UpdateUser): java.lang.ClassCastException:
I am getting this error: java.lang.ClassCastException: $Proxy0 cannot be cast to rmi.engine.Call at Main.main(Main.java:39)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.