This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2 - Json issue, InvocationTargetException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 - Json issue, InvocationTargetException" Watch "Struts2 - Json issue, InvocationTargetException" New topic

Struts2 - Json issue, InvocationTargetException

anil kumar mullapudi

Joined: Oct 25, 2011
Posts: 8
i have a ArrayList "objUsersList" in my Action class. That contains the following data.

objUsersList has setters and getters in my Action class.

[User [Nuser_id=1, strUser_FirstName=anil, strUser_LastName=mullapudi, strUser_Name=anil, strUser_Password=root, strUser_gender=M],
User [Nuser_id=2, strUser_FirstName=Ramesh, strUser_LastName=gubbala, strUser_Name=ramesh, strUser_Password=root, strUser_gender=M],
User [Nuser_id=3, strUser_FirstName=anil, strUser_LastName=vatti, strUser_Name=anilv, strUser_Password=root, strUser_gender=M],
User [Nuser_id=4, strUser_FirstName=ram, strUser_LastName=m, strUser_Name=ram, strUser_Password=root, strUser_gender=M],
User [Nuser_id=5, strUser_FirstName=tarun, strUser_LastName=k, strUser_Name=tarun, strUser_Password=root, strUser_gender=m]]

I am using the following code in my jsp.
java script:
function viewUsers() {

var url = 'view_users.action';

var myAjax = new Ajax.Request(
method: 'post',
onComplete: fetchUsers


function fetchUsers(originalRequest) {
var result = originalRequest.responseText.evalJSON(); // the execution stops here

How to populate my ArrayList in my jsp page. Please help me.

I changed the above code to

function fetchUsers(originalRequest) {

Then i got the following execption in alert message

<html><head><title>Apache Tomcat/6.0.10 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;} {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: com.googlecode.jsonplugin.JSONException: java.lang.reflect.InvocationTargetException

Thanks in advance.
Anil (
anil kumar mullapudi

Joined: Oct 25, 2011
Posts: 8
Problem solved when i remove the setters in my Action class which are injected from spring configuration file.
Instead of setter injection i used constructor injection, Now everything works fine, But my action class method executes two times for a single request. I am unable to stop this second time execution.
rocket mass heater kickstarter
subject: Struts2 - Json issue, InvocationTargetException