> -----Original Message----- > From: Wes Wannemacher [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 05, 2008 7:11 PM > To: Struts Users Mailing List > Subject: RE: Simple helloworld test fails with "Could not > find action orresult" > > David, > > This has been bugging me since my first response... Although > it may not explain why it's not working, try adding > 'namespace="/"' to your package declaration. I was reading > through the docs, and I don't think it indicates that it is > necessary. But, just for testing sake, see if that fixes it.
Weird. The good news is that fixes it. Can someone tell me why? Perhaps this is a good thing to write a validation for (that is, should the lack of a namespace attribute be an error?)? The sort of bad news is that it just fails at a later point (I stepped through the code and saw it pass by the previous point it was throwing an exception). It now does this: Mar 5, 2008 7:20:18 PM org.apache.jasper.runtime.JspFactoryImpl internalGetPageContext SEVERE: Exception initializing page context java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm not including the entire stack trace, because after googling this, I found the following internet-ancient reference to this: http://www.mail-archive.com/user@struts.apache.org/msg54986.html In short, once I turned off devmode, it worked. I checked JIRA for issues involving devmode, and all of them appeared to be resolved. In any case, I'm moving forward now. Thanks for the help. > > -Wes > > On Wed, 2008-03-05 at 18:53 -0800, Karr, David wrote: > > Oh, and if it helps, this is the output on my browser when > executing > > with "debug=xml": > > > > <debug> > > <parameters/> > > <context> > > <struts.actionMapping> > > <class>class > > org.apache.struts2.dispatcher.mapper.ActionMapping</class> > > <name>main</name> > > <namespace>/</namespace> > > </struts.actionMapping> > > <attr/> > > <report.conversion.errors>false</report.conversion.errors> > > </context> > > <request/> > > <session/> > > <valueStack> > > <value> > > <actionErrors/> > > <actionMessages/> > > <class>class com.wamu.struts.helloworld.MainAction</class> > > <errorMessages/> > > <errors/> > > <fieldErrors/> > > <locale> > > <ISO3Country>USA</ISO3Country> > > <ISO3Language>eng</ISO3Language> > > <class>class java.util.Locale</class> > > <country>US</country> > > <displayCountry>United States</displayCountry> > > <displayLanguage>English</displayLanguage> > > <displayName>English (United States)</displayName> > <displayVariant/> > > <language>en</language> <variant/> </locale> <tabs> <value> > > <class>class com.wamu.struts.helloworld.MainAction$TabInfo</class> > > <label>ABC</label> > > <name>abc</name> > > </value> > > <value> > > <class>class com.wamu.struts.helloworld.MainAction$TabInfo</class> > > <label>DEF</label> > > <name>def</name> > > </value> > > </tabs> > > </value> > > <value> > > <class>class com.opensymphony.xwork2.DefaultTextProvider</class> > > </value> > > </valueStack> > > </debug> > > > > > -----Original Message----- > > > From: Martin Gainty [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, March 05, 2008 6:07 PM > > > To: Struts Users Mailing List > > > Subject: Re: Simple helloworld test fails with "Could not find > > > action or result" > > > > > > Jeromy is correct > > > At the very least we'll need to see the configuration > files located > > > in /WEB-INF such as > > > > > > web.xml > > > struts-xml > > > struts-config.xml > > > validation.xml > > > web.xml > > > struts-tags.xml > > > validation.xml > > > struts-tags.xml > > > struts-actionchaining.xml > > > struts-integration.xml > > > struts-jsf.xml > > > > > > These configuration files will give us of the > layout/design you're > > > using > > > > > > Martin > > > ----- Original Message ----- > > > From: "Karr, David" <[EMAIL PROTECTED]> > > > To: "Struts Users Mailing List" <user@struts.apache.org> > > > Sent: Wednesday, March 05, 2008 7:37 PM > > > Subject: RE: Simple helloworld test fails with "Could not find > > > action or result" > > > > > > > > > > -----Original Message----- > > > > From: Othon Reyes Sanchez [mailto:[EMAIL PROTECTED] > > > > Sent: Wednesday, March 05, 2008 4:24 PM > > > > To: Struts Users Mailing List > > > > Subject: Re: Simple helloworld test fails with "Could not > > > find action > > > > or result" > > > > > > > > Maybe it sounds dumb but where is lyour struts.xml located? > > > > > > In my Eclipse project, it's at the root of my "src" > > > directory. In the WAR file, it goes into WEB-INF/classes. > > > If it wasn't found, I would be seeing more serious errors. > > > > > > > In your struts.xml your action named "main2" has no class. > > > > > > Take that back :) . > > > > > > Yes, I know that. That's the point. "main2" has no > Action class, > > > but "main" does, and "main" fails for no obvious reason. > > > > > > > can you post more of your code? > > > > > > What else would you want to see? There's really nothing else. > > > > > > > On Wed, Mar 5, 2008 at 6:04 PM, Karr, David > <[EMAIL PROTECTED]> > > > > wrote: > > > > > > > > > > -----Original Message----- > > > > > > From: Jeromy Evans [mailto:[EMAIL PROTECTED] > > > > > > Sent: Wednesday, March 05, 2008 3:11 PM > > > > > > To: Struts Users Mailing List > > > > > > Subject: Re: Simple helloworld test fails with > "Could not find > > > > > > action or result" > > > > > > > > > > > > I don't see anything wrong with it, provided MainAction > > > > > > returns "success" (MainAction.java wasn't attached). > > > > > > > > > > Cute. I guess my company decided that java is unsafe, so > > > > they removed > > > > > it from the attachments :) . I'll reattach it with a > fake extent. > > > > > I'll also attach my JSP. Perhaps that's relevant. > > > > > > > > > > The Action implementation extends ActionSupport, and it's > > > using the > > > > > SUCCESS constant. > > > > > > > > > > > Is it possible you have a conflicting struts.xml > > > deployed in the > > > > > > webapp, or any plugin jars deployed? The only other time > > > > I've seen > > > > > > the response you're returning the correct result code > > > is when the > > > > > > Result implementation has encountered an error (not > using the > > > > > > CodeBehind plugin are you?) > > > > > > > > > > I have the following jars in WEB-INF/lib: > > > > > > > > > > spring-context-2.0.5.jar > > > > > spring-core-2.0.5.jar > > > > > commons-logging-1.0.4.jar > > > > > spring-web-2.0.5.jar > > > > > freemarker-2.3.8.jar > > > > > struts2-core-2.0.11.jar > > > > > ognl-2.6.11.jar > > > > > struts2-spring-plugin-2.0.11.jar spring-beans-2.0.5.jar > > > > > xwork-2.0.4.jar > > > > > > > > > > I do have the Spring plugin in there. Could that be an > > > issue? I'm > > > > > going to want to use that soon, but I'm not really > using it yet. > > > > > > > > > > I tried exporting my WAR and verifying I only have my single > > > > > struts.xml in it. > > > > > > > > > > > What happen if your go directly to /main.action and > > > /main2.action? > > > > > > > > > > That's what I've been doing. When I go to "/main.action", > > > > I get the > > > > > error I described. > > > > > > > > > > > You have setup two actions: > > > > > > main - implemented by MainAction, with a forward for > > > > "success" to > > > > > > /main.jsp > > > > > > main2 - implemented by ActionSupport, with a forward for > > > > "success" > > > > > > to /main.jsp and you're using the default > interceptors. It is > > > > > > configured correctly. > > > > > > > > > > > > Karr, David wrote: > > > > > > > I'm sure I have a simple error here, but I don't see it. > > > > > > > > > > > > > > I'm trying to construct a simple "hello, world" app with > > > > > > v2.0.11. I > > > > > > > have an "index.jsp" that redirects to "main.action". > > > I started > > > > > > > out with the "main" action just having a result > > > > > > (name="success") going to > > > > > > > "/main.jsp". That appears to work. I then cloned the > > > > action (and > > > > > > > changing the name), adding a "class" attribute > referring to > > > > > > a simple > > > > > > > Action class. The Action class' execute method just > > > > > > returns SUCCESS. > > > > > > > I would have thought this would do the same thing as > > > the action > > > > > > > without the Action class, but it instead fails with "No > > > > > > result defined > > > > > > > for action com.wamu.struts.helloworld.MainAction > and result > > > > > > success". > > > > > > > > > > > > > > I'll attach my struts.xml, web.xml, and > MainAction.java files. > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------ > > > > -- > > > > > > -- > > > > > > > -- > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------ > > > > -- > > > > > > - > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------ > > > > -- > > > > > > -- > > > > > > > -- > > > > > > > > > > > > > > No virus found in this incoming message. > > > > > > > Checked by AVG Free Edition. > > > > > > > Version: 7.5.516 / Virus Database: 269.21.5/1314 - > > > Release Date: > > > > > > > 5/03/2008 6:38 PM > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------ > > > > -- > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > > > - > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -------------------------------------------------------------------- > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]