This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes The action name cannot be the same as the action suffix [Action] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The action name cannot be the same as the action suffix [Action]" Watch "The action name cannot be the same as the action suffix [Action]" New topic
Author

The action name cannot be the same as the action suffix [Action]

sanjay degala
Greenhorn

Joined: Aug 23, 2010
Posts: 4
Hello,

My struts 2 application doesn't start and is giving an the following error when I try to start it

SEVERE: Exception starting filter struts2
The action name cannot be the same as the action suffix [Action] - Class: org.apache.struts2.convention.SEOActionNameBuilder


anyideas why we get this error?
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
Is your action name Action?


"Eppur si muove!"
sanjay degala
Greenhorn

Joined: Aug 23, 2010
Posts: 4
No, my action name isn't action it is RequestSearchAction and it extends ActionSupport
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
sanjay degala wrote:No, my action name isn't action it is RequestSearchAction and it extends ActionSupport


Oh ok, have a look at this page does something ring a bell?
sanjay degala
Greenhorn

Joined: Aug 23, 2010
Posts: 4
Yeah.. That explains that error occurs if the name of the action is Action . But my action class name is different. I am still not understanding what's causing that error.
Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
sanjay degala wrote:Yeah.. That explains that error occurs if the name of the action is Action . But my action class name is different. I am still not understanding what's causing that error.


Of course, that's clear...but can you for example try to include the source jar containing SEOActionNameBuilder in your IDE
and debug it stepwise until you enter the method that throws the following exception?



You might see what's causing that error.
Atul Tewari
Greenhorn

Joined: Oct 13, 2010
Posts: 3
Did you get a resolution? I ran into the same problem upgrading from Struts 2.0.11 to Struts 2.2.1. I ran it in debug and the SEOActionNameBuilder class did receive an action name "action" But when I checked the entire codebase, I did not see any class called "action". On stack trace it does not give which package the "action" class is coming from.

Ideas, thoughts?

Could it be that struts.xml has the following with everything listed as list.action? etc.

<action name="*/*" class="com.company.i3.action.{1}Action" method="{2}">
<interceptor-ref name="companyStack"/>
<result name="redirect-list" type="redirect">/{1}/list.action</result>

Thanks in advance
Atul Tewari
Greenhorn

Joined: Oct 13, 2010
Posts: 3
It is org.apache.struts.action.Action. Why is it even looking at struts classes? How do I exclude them from the SEOActionNameBuilder match?

Is there an exclude parameter?

Thanks
Atul Tewari
Greenhorn

Joined: Oct 13, 2010
Posts: 3
The struts-plugin.xml for conventions is already using

struts.convention.exclude.packages org.apache.struts.*,
org.apache.struts2.*,
org.springframework.web.struts.*,
org.springframework.web.struts2.*,
org.hibernate.*

to exclude packages from org.apache.struts.*

At this point - not sure how to exclude these packages. Any help would be much appreciated.
Jerry Mahone
Greenhorn

Joined: Jun 19, 2008
Posts: 3
Was this ever satisfactorily resolved? I am having the same problem in my Struts 1 + Struts 2 + rest plugin environment.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

I had faced the same problem but my mistake is i had imported ActionSupport from spring not from struts.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Jerry Mahone
Greenhorn

Joined: Jun 19, 2008
Posts: 3
So, my issue was a configuration mistake. I went and read the FAQ, always a good idea, and saw that the struts.xml must be in the WEB-INF/classes directory. I had read that it should be in the src directory along with other resources; I took that literally and had it in my src/resources directory along with other property files. Anyway, being an optional file, everything was silently good, until I added the rest and convention plugin jars. Then I started seeing the action name error I previously posted. Having (now) read the FAQ, I moved the struts.xml to the WEB-INF/classes directory, and all is good.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The action name cannot be the same as the action suffix [Action]