Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sanjay degala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your action name Action?
 
sanjay degala
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, my action name isn't action it is RequestSearchAction and it extends ActionSupport
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had faced the same problem but my mistake is i had imported ActionSupport from spring not from struts.
 
Jerry Mahone
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic