resource not found error- Struts 2 (Struts2 in action- Manning)
Hi All, I'm a newbie to Struts2 ,and ive tried and deployed applications using eclipse before.But ,somehow i cant seem to deploy a struts2 application that i found in Manning's "Struts2 In action". I tried following the instruction at this link , but without any use. http://www.manning-sandbox.com/thread.jspa?threadID=27578 http://www.manning-sandbox.com/thread.jspa?threadID=27578 It throws the following error. HTTP 404-- The requested resource (/Struts2InAction/) is not available. Please Help. Thanks in advance. -- View this message in context: http://old.nabble.com/resource-not-found-error--Struts-2-%28Struts2-in-action--Manning%29-tp30676184p30676184.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
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: [email protected] For additional commands, e-mail: [email protected]
Re: Struts 2 Error:SEVERE: Could not find action or result
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: > > method="obtainData"> > /jsp/interface.jsp > /jsp/interfaceError.jsp > > > > 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: [email protected] For additional commands, e-mail: [email protected]
Re: Struts 2 Error:SEVERE: Could not find action or result
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: [email protected] For additional commands, e-mail: [email protected]
Re: Struts 2 Error:SEVERE: Could not find action or result
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: [email protected]
For additional commands, e-mail: [email protected]
Code Help:CRUD example
Hi All, This is in following to my previous message . I have developed a small CRUD example using struts 2 . But when I try to run the same it throws an error (Null pointer exception).. The exception stack trace is as follows. Inside AddDomain java.lang.NullPointerException at com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:92) at com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404) Could anyone please guide me as to where Im going wrong . Im attaching the source code of my action , dao class , xml files ad jsp here .Please help. http://old.nabble.com/file/p31124479/DomainAction1.txt DomainAction1.txt http://old.nabble.com/file/p31124479/DomainDAO.txt DomainDAO.txt -- View this message in context: http://old.nabble.com/Code-Help%3ACRUD-example-tp31124479p31124479.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: Code Help:CRUD example
The Jsp file to the same is as follows. http://old.nabble.com/file/p31124495/newjsp.txt newjsp.txt JavaNoobie wrote: > > Hi All, > This is in following to my previous message . > I have developed a small CRUD example using struts 2 . But when I try to > run the same it throws an error (Null pointer exception).. The exception > stack trace is as follows. > Inside AddDomain > java.lang.NullPointerException > at > com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:92) > at > com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:81) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404) > > Could anyone please guide me as to where Im going wrong . Im attaching the > source code of my action , dao class , xml files ad jsp here .Please help. > http://old.nabble.com/file/p31124479/DomainAction1.txt DomainAction1.txt > http://old.nabble.com/file/p31124479/DomainDAO.txt DomainDAO.txt > http://old.nabble.com/file/p31124479/strutsxml.txt strutsxml.txt > > -- View this message in context: http://old.nabble.com/Code-Help%3ACRUD-example-tp31124479p31124495.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

