Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,492
Community Members
 
Community Events
176
Community Groups

xwork Actions in Bamboo

Edited

Hi,

 

I have setup a webitem in my atlassian-plugin.xml and defined an xwork action.

But when I try to call this action which will render a velocity template, Bamboo always says, that an action for package and contextpath is not defined and that the action is not allowed. See small stacktrace and error log beneath.

It is the only action I have defined therefor the package name is unique.

 

[INFO] [talledLocalContainer] 2018-02-01 18:42:35,210 ERROR [http-nio-6990-exec-7] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/plugins/secsign] and action name [ViewSecSignIDOptions] associated with context path [/bamboo].

[INFO] [talledLocalContainer] 2018-02-01 18:42:49,355 WARN [http-nio-6990-exec-7] [Dispatcher] Could not find action or result: /bamboo/plugins/secsign/ViewSecSignIDOptions!show.action

[INFO] [talledLocalContainer] Method show for action ViewSecSignIDOptions is not allowed! - [unknown location]

[INFO] [talledLocalContainer] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:200)

[INFO] [talledLocalContainer] at org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:63)

 

I'm using setter injection in the corresponding class which inherits from com.atlassian.bamboo.ww2.BambooActionSupport which extends com.opensymphony.xwork2.ActionSupport

 

I'm currently running Bamboo 6.0.0 build 60001. But the error is the same in 5.9.x and 5.10.x

 

And the definitions in my atlassian-plugin.xml look like:

 <xwork name="secsign-id-options" key="secsign-id-options">
        <description key="secsign-id-options">SecSign ID Options</description>
        <package name="secsign-id-options" extends="default" namespace="/plugins/secsign">
            <default-interceptor-ref name="defaultStack" />
            <action name="ViewSecSignIDOptions!show" class="com.secsign.bamboo.actions.SecSignIDPluginManagementAction" method="doShow">
                <result name="success" type="velocity">/templates/secsignid-options-and-users-page.vm
                </result>
                <result name="input" type="velocity">/templates/secsignid-options-and-users-page.vm
                </result>
                <result name="error" type="velocity">/templates/secsignid-options-and-users-page.vm
                </result>
                <result name="options" type="velocity">/templates/secsignid-options-page.vm
                </result>
                <result name="users" type="velocity">/templates/secsignid-users-page.vm
                </result>
            </action>

        </package>
    </xwork>

 

<web-item key="secsign_id_menu" name="SecSign ID top navigation menu" i18n-name-key="secsign_id_menu.title"  section="header.global.primary" weight="40">
        <label key="secsignid.menu.label">SecSign ID</label>
        <link linkId="secsignid_options">/plugins/secsign/ViewSecSignIDOptions!show.action</link>
        <!--<condition class="com.atlassian.bamboo.plugins.web.conditions.AdministerPlanPermissionCondition"/>-->
        <description key="secsignid.menu.description">Options and user mappings for SecSign ID</description>
        <tooltip key="secsignid.menu.tooltip">Options and user mappings for SecSign ID</tooltip>
    </web-item>

 

Cheers

Titus

 

1 answer

1 accepted

0 votes
Answer accepted

Try to remove "!show" from action name: 

<action name="ViewSecSignIDOptions" 
class="com.secsign.bamboo.actions.SecSignIDPluginManagementAction"
method="doShow">

and not use !show in link declaration, so leave it :

<link linkId="secsignid_options">/plugins/secsign/ViewSecSignIDOptions.action</link>. 


Correct method already declared in method attribute of action tag

Hi Alexey,

this worked pretty well. Thanks a lot. I probably should not be concerned whether my approach works in Confluence but not in Bamboo while both are using XWork actions.

 

But anyway after ficxing this problem Bamboo could not find the templates:

[INFO] [talledLocalContainer] 2018-02-05 18:51:16,446 INFO [http-nio-6990-exec-2] [VelocityManager] Initializing velocity using velocity.properties from classloader
[INFO] [talledLocalContainer] 2018-02-05 18:51:16,614 ERROR [http-nio-6990-exec-2] [VelocityResult] Unable to render velocity template: '/templates/secsignid-options-and-users-page.vm'
[INFO] [talledLocalContainer] org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/templates/secsignid-options-and-users-page.vm'
[INFO] [talledLocalContainer]     at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
[INFO] [talledLocalContainer]     at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
[INFO] [talledLocalContainer]     at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)

 

But I already started to shift everything from xwork actions to servlets which solved my problem as well. Except that it is not as convenient as xwork actions.

 

Cheers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events