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

  • SEARCH
  • Home
  • 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 6926113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:33+00:00 2026-05-27T10:52:33+00:00

I’m working in struts-config 1.2 application. In my struts-config, I have declaration entry for

  • 0

I’m working in struts-config 1.2 application. In my struts-config, I have declaration entry for a form and I used this form for some actions. I compiled this objects first with java 1.4 version. That time it was working fine. Now I modified as java version 1.6. I compiled all the objects. Now it is throwing error as my form class cannot be cast to my extend java class. I dont know this is may be due to version change.

Please give me a solution for this, I am struggling with this for 2 days.

My struct-config code is:

<form-bean name="xCustomerPortalForm" type="com.portal.form.XCustomerPortalForm" />
...
<action path="/editXPortalCustomerNew"
        type="com.xmportal.struts.X2AProcessBridgeAction"
        parameter=""
        name="xCustomerPortalForm"
        scope="request"
        validate="false">
  <forward name="success_en" path="/jsp/XMPortalCustomerRegistration.jsp" />
  <forward name="failure_en" path="/jsp/XMPortalCustomerRegistration.jsp" />
</action> 

This is my error message:

java.lang.ClassCastException: com.portal.form.XCustomerPortalForm cannot be cast to com.xmportal.struts.X2AFormBase
    at com.xmportal.struts.X2AProcessBridgeAction.exposeInScope(X2AProcessBridgeAction.java:205)
    at com.xmportal.struts.X2AProcessBridgeAction.checkDataSingle(X2AProcessBridgeAction.java:331)
    at com.xmportal.struts.X2AProcessBridgeAction.checkData(X2AProcessBridgeAction.java:361)
    at com.xmportal.struts.X2AProcessBridgeAction.checkOutcome(X2AProcessBridgeAction.java:618)
    at com.xmportal.struts.X2AProcessBridgeAction.executeLogic(X2AProcessBridgeAction.java:864)
    at org.apache.struts.scaffold.BaseHelperAction.executeLogic(Unknown Source)
    at com.xmportal.struts.X2AProcessBridgeAction.execute(X2AProcessBridgeAction.java:886)
    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:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    ...

I am getting error in this object only in X2AProcessBridgeAction

 try {
            X2AFormBase passedForm = (X2AFormBase) form;
            String loginKeyVal= passedForm.getLoginKey();           
                passedForm.set(bean);
            } catch (Exception e) {             
                e.printStackTrace();            

            }
  • 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-05-27T10:52:34+00:00Added an answer on May 27, 2026 at 10:52 am

    It’s simple really,

    In your struts-config.xml, your action (type com.xmportal.struts.X2AProcessBridgeAction) name is xCustomerPortalForm (which is typed to com.portal.form.XCustomerPortalForm). This means, when Struts (ActionServlet) will call your bean com.xmportal.struts.X2AProcessBridgeAction methods, the ActionForm form will always be of type com.portal.form.XCustomerPortalForm.

    So, this typecasting will always fail as it’s incompatible type:

    X2AFormBase passedForm = (X2AFormBase) form;
    

    Struts expects you to do this:

    XCustomerPortalForm xCustomPortalForm = (XCustomerPortalForm)form;
    

    I hope, this is clear. Your Action is mapped to only one Form Bean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have this code to decode numeric html entities to the UTF8 equivalent character.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small

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.