You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JavaNoobie <vi...@enzentech.com> on 2011/03/10 08:04:54 UTC

Struts 2 Error:SEVERE: Could not find action or result

Hi All,
I'm a newbie to Struts 2 , and have tried to create my application using
references off the internet .However currently  I'm faced with an error
while trying to run the program , and i cant figure out where my mistake is
:(. Please help me find out what I'm missing .
I've attached a screen shot of my error log and source code . 

The error that I get is-

SEVERE: Could not find action or result
No result defined for action com.vivek.struts2.action.DomainAction1 and
result error - action -
file:/C:/Program%20Files/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2DomMasBAck/WEB-INF/classes/struts.xml:25:101
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:350)
	at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
	at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
	at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)...........................

http://old.nabble.com/file/p31112825/DomainAction1.java DomainAction1.java 
http://old.nabble.com/file/p31112825/DomainDAO.java DomainDAO.java 
http://old.nabble.com/file/p31112825/interface.jsp interface.jsp 
http://old.nabble.com/file/p31112825/strutsxml.txt strutsxml.txt 
-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31112825.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by Johannes Geppert <jo...@apache.org>.
I can't see any reference to the listbean property in your JSP.
And also in the Action I can't see any initialization of listbean.

Johannes


JavaNoobie wrote:
> 
> I have made the necessary changes , and have got rid of the error.Now ,I'm
> being able to access the addupDomain function .However , I guess I'm
> missing something fundamental as I'm not being able to insert into the
> database, as the control is being passed to the ERROR page each time and
> there is no value being inserted .
> I found that that the bean --"listbean" being created in the addupDomain
> function of action(DomainAction1.java) class is being set with a null
> value and as a result the ERROR page is being executed .Please help as to
> how i can overcome this issue . Thanks 
> 
> 
> Johannes Geppert wrote:
>> 
>> You return an result of type ERROR in your DomainAction1 action.
>> The problem is, this result is not defined in your struts.xml.
>> 
>> Example:
>> 
>> <action name="obtainData" class="com.vivek.struts2.action.DomainAction1"
>> method="obtainData">
>>   <result name="success">/jsp/interface.jsp</result> 
>>   <result name="error">/jsp/interfaceError.jsp</result> 
>> </action>
>> 
>> 
>> Johannes
>> 
>> 
> 
> 


-----
--- 
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113208.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Could you provide your exception stacktrace?

On 10 March 2011 09:51, JavaNoobie <vi...@enzentech.com> wrote:
>
>
> I have made the necessary changes , and have got rid of the error.Now ,I'm
> being able to access the addupDomain function .However , I guess I'm missing
> something fundamental as I'm not being able to insert into the database, as
> the control is being passed to the ERROR page each time and there is no
> value being inserted .Please help
>
>
> Johannes Geppert wrote:
>>
>> You return an result of type ERROR in your DomainAction1 action.
>> The problem is, this result is not defined in your struts.xml.
>>
>> Example:
>>
>> <action name="obtainData" class="com.vivek.struts2.action.DomainAction1"
>> method="obtainData">
>>   <result name="success">/jsp/interface.jsp</result>
>>   <result name="error">/jsp/interfaceError.jsp</result>
>> </action>
>>
>>
>> Johannes
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113198.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by JavaNoobie <vi...@enzentech.com>.
Hi,
I have corrected my jsp page, (not sure whether this is correct ) , and have
attached it below . But I have already initialized listbean in the action
class , whose code snippet im pasting below. 

-----
private DomainBean listbean;
-------
public String addupDomain(){
		String result= SUCCESS;	
		System.out.println("Inside AddDomain");
		if(listbean!=null){
			try {
				if(DomainDAO.addupDomain(listbean)){
					result= SUCCESS;
					System.out.println("Adding a tuple");
				}
				
					else {
						result=ERROR;
					}
				}
			catch (Exception e) {
				
				result= null;
				listbean=null;
				System.out.println("Adddomain isnt working.");
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else{
			result=INPUT;
			
		}
		//listDomain(dt_oid);
		return result;
	}
-------
public DomainBean getListbean() {
		return listbean;
	}

	public void setListbean(DomainBean listbean) {
		this.listbean = listbean;
	}

The newjsp is attached .Please have a look.
http://old.nabble.com/file/p31113210/newjsp.txt newjsp.txt 


Johannes Geppert wrote:
> 
> I can't see any reference to the listbean property in your JSP.
> And also in the Action I can't see any initialization of listbean.
> 
> Johannes
> 

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113210.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by Johannes Geppert <jo...@apache.org>.
I can't see any reference to the listbean property in your JSP.
And also in the Action I can't see any initialization of listbean.

Johannes


JavaNoobie wrote:
> 
> I have made the necessary changes , and have got rid of the error.Now ,I'm
> being able to access the addupDomain function .However , I guess I'm
> missing something fundamental as I'm not being able to insert into the
> database, as the control is being passed to the ERROR page each time and
> there is no value being inserted .
> I found that that the bean --"listbean" being created in the addupDomain
> function of action(DomainAction1.java) class is being set with a null
> value and as a result the ERROR page is being executed .Please help as to
> how i can overcome this issue . Thanks 
> 
> 
> Johannes Geppert wrote:
>> 
>> You return an result of type ERROR in your DomainAction1 action.
>> The problem is, this result is not defined in your struts.xml.
>> 
>> Example:
>> 
>> <action name="obtainData" class="com.vivek.struts2.action.DomainAction1"
>> method="obtainData">
>>   <result name="success">/jsp/interface.jsp</result> 
>>   <result name="error">/jsp/interfaceError.jsp</result> 
>> </action>
>> 
>> 
>> Johannes
>> 
>> 
> 
> 


-----
--- 
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113207.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by JavaNoobie <vi...@enzentech.com>.
Hi, I found that that the bean --"listbean" being created in the
action(DomainAction1.java) class is being set with a null value and as a
result the ERROR page is being executed .Please help as to how i can
overcome this issue . Thanks

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113206.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by JavaNoobie <vi...@enzentech.com>.

I have made the necessary changes , and have got rid of the error.Now ,I'm
being able to access the addupDomain function .However , I guess I'm missing
something fundamental as I'm not being able to insert into the database, as
the control is being passed to the ERROR page each time and there is no
value being inserted .Please help  


Johannes Geppert wrote:
> 
> You return an result of type ERROR in your DomainAction1 action.
> The problem is, this result is not defined in your struts.xml.
> 
> Example:
> 
> <action name="obtainData" class="com.vivek.struts2.action.DomainAction1"
> method="obtainData">
>   <result name="success">/jsp/interface.jsp</result> 
>   <result name="error">/jsp/interfaceError.jsp</result> 
> </action>
> 
> 
> Johannes
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31113198.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Error:SEVERE: Could not find action or result

Posted by Johannes Geppert <jo...@apache.org>.
You return an result of type ERROR in your DomainAction1 action.
The problem is, this result is not defined in your struts.xml.

Example:

<action name="obtainData" class="com.vivek.struts2.action.DomainAction1"
method="obtainData">
  <result name="success">/jsp/interface.jsp</result> 
  <result name="error">/jsp/interfaceError.jsp</result> 
</action>


Johannes


JavaNoobie wrote:
> 
> Hi All,
> I'm a newbie to Struts 2 , and have tried to create my application using
> references off the internet .However currently  I'm faced with an error
> while trying to run the program , and i cant figure out where my mistake
> is :(. Please help me find out what I'm missing .
> I've attached a screen shot of my error log and source code . 
> 
> The error that I get is-
> 
> SEVERE: Could not find action or result
> No result defined for action com.vivek.struts2.action.DomainAction1 and
> result error - action -
> file:/C:/Program%20Files/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Struts2DomMasBAck/WEB-INF/classes/struts.xml:25:101
> at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:350)
> 	at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
> 	at
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
> 	at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)...........................
> 
>  http://old.nabble.com/file/p31112825/DomainAction1.java
> DomainAction1.java 
>  http://old.nabble.com/file/p31112825/DomainDAO.java DomainDAO.java 
>  http://old.nabble.com/file/p31112825/interface.jsp interface.jsp 
>  http://old.nabble.com/file/p31112825/strutsxml.txt strutsxml.txt 
> 


-----
--- 
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

-- 
View this message in context: http://old.nabble.com/Struts-2-Error%3ASEVERE%3A-Could-not-find-action-or-result-tp31112825p31112826.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org