Missed Team ’24? Catch up on announcements here.

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

Stuck with Page Not Found when developing a XWork Action

Rodolfo Perottoni September 7, 2014

Problem: Im trying to develop a Confluence plugin for the first time in my life. I need to create a configuration screen for my plugin in the system administration screen. I already have created the Web Section and the Web-Item for it, as follows:

 

<web-section name="Archive" i18n-name-key="archive.name" key="archive" location="system.admin" weight="10">
	<description key="archive.description">The Archive Plugin</description>
	<label key="archive.label" />
</web-section>
	
<web-item name="Manage Revisions" section="system.admin/archive" weight="500" key="manage_revisions">
	<description>Configuration</description>
	<label key="archive.section.revisions" />
	<link linkId="manage-revisions">/admin/plugins/archive/view.action</link>
</web-item>

 

Also, i already have created the Xwork/action element, as follows:

<xwork name="archiveaction" key="archiveaction">
	<package name="archive" extends="default" namespace="/admin/plugins/archive/">
		<default-interceptor-ref name="defaultStack"/>
		<action name="view" class="com.grendene.plugin.xwork.ArchiveAction" method="view">
	    	<result name="success" type="velocity">/templates/archiveaction.vm</result>
	    </action>
	</package>
</xwork>

The problem is that when i try to access the web-item, an error shows up telling that the page was not found. I spent almost 2 days trying to solve this problem, but i just cant find where i'm missing something, because i copied the skeleton from an Confluence Plugin that is already in the Marketplace and works.

Also, the packaging of my JAR seems to be alright (every file that should be in the jar IS in the jar).

Could somebody help me with this ?

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Chii
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 9, 2014

There's a couple of things you'll want to check 

  1. is the xwork module loaded in the plugin? You can check this by going to the Manage Addon admin screen (https://localhost:1990/plugins/servlet/upm), and search for your plugin, and expand the modules. 
    1. if it's not loaded, then theres probably some problem with the plugin's startup - trawl through your startup logs and see if there's any obvious problem
    2. if it is loaded, then continue
  2. is there another xwork module with the same package namespace? You cannot have two different xwork module with the same package namespace - one or the other will not get loaded.
  3. If all else fails, you can try debugging com.atlassian.confluence.plugin.descriptor.XWorkModuleDescriptor, and see if you can spot the module in your plugin loading (you might have to re-install the plugin after putting in the breakpoint in the init() method). 

 

Rodolfo Perottoni September 9, 2014

The module is working, and i've managed to access a blank page that i THINK is my .vm with the following address: http://gra_dti_035335n:1990/admin/archive/view.action (removed the "/confluence/" after the first slash). Also, it is being shown full-screened, and i want the .vm content to appear on the right side of the admin console. How i manage to do that ?

Rodolfo Perottoni September 9, 2014

Problem Solved! Looked through the startup of tomcat and found that the webwork class was not implementing Action. Thanks for the help :)

0 votes
Matt_Henslee February 25, 2019

Hello!

I found this post after scratching my head for a while on the same issue. It turns out the  package name="archive-page" element and the action name="archive-page" need to be unique from other xwork entries and be named the same within the same xwork plugin.

Hopefully this helps someone out down the line.

0 votes
tousifs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2014

Hi Rodolfo,

developing UI related modules is little trickey as your targeting Dev and Confluence instance.

i would suggest below points.

1)  check your web-work action is loded into the plugin area from anaged plugins you should see plugin module details.

once you find the plugin module is updated it means problem with accessing url only.

Accessing web-work URL goes through 2 cycles

 

       * )  Accessing URL From Dev Enviornent :localhost:1990  it is little diffrent from accessing url on 8090 confluence instance.  you should avoid base url. 

http://localhost:1990/admin/archive/view.action


         *) Accessing URL From Confluence Instance after installing plugin should go as : http://localhost:8090/confluence/admin/archive/view.action : 

 

all the best.

Tousif Shaikh.

Rodolfo Perottoni September 9, 2014

Hello Tousif. The module is enabled. I've tried to access the page with the link you provided (without "/confluence/") and i've got a white screen. I don't know if this means it worked, because i expected to see a "Hello world" (that's what my .vm has atm). Also, how do i make my page appear in the right side of the admin console panel? I don't want it to appear without the admin options on the left. Thanks!!!

0 votes
Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2014

Ok and whats the URL you type in the browser to call the action and thereby get a page not found?

Rodolfo Perottoni September 8, 2014

When i click my web-item in the administration console it redirects me to http://localhost:1990/confluence/admin/archive/view.action

Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2014

Ok, one thing to try out and one thing to check: 1) In the xml file, change key="manage_revisions" to key="manage-revisions" 2) If the above doesnt work, check if your VM file is in place. Based on whats there in the descriptor, it should be under resources/templates folder - confirm if it is.

Rodolfo Perottoni September 9, 2014

1) changed the key but still not working 2) it was in the older src/main/java/templates. Changed to src/main/resources/templates but still no deal... :(

Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2014

Ok, 2 things - can you show me how your vm looks like? And when you moved your vm to the right directory, did you do make sure that you are using the newly built jar?

Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2014

Oh and yes, when you do a new build , make sure that you clear the browser cache as well ....

0 votes
Rodolfo Perottoni September 8, 2014

Hello and thanks for replying Yagnesh.

I've removed the last "/" from the namespace but i still got the problem. Here is how my code looks like after changing that

 

<web-section name="Archive" i18n-name-key="archive.name" key="archive" location="system.admin" weight="10">
	<description key="archive.description">The Archive Plugin</description>
	<label key="archive.label" />
</web-section>
<web-item name="Manage Revisions" section="system.admin/archive" weight="500" 		key="manage_revisions">
	<description>Configuration</description>
	<label key="archive.section.revisions" />
	<link linkId="manage-revisions">/admin/archive/view.action</link>
</web-item>
<xwork name="archiveaction" key="archiveaction">
	<package name="archive" extends="default" namespace="/admin/archive">
		<default-interceptor-ref name="validatingStack" />
		<action name="view" class="com.grendene.plugin.xwork.ArchiveAction">
			<result name="success" type="velocity">/templates/archiveaction.vm</result>
		</action>
	</package>
</xwork>

 

 

 

 

 

0 votes
Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2014

Whats the URL you are using to access the web-item? My first attempt to fix this would be to remove the last "/" from here :


namespace="/admin/plugins/archive/"

 

Try this too and let me know - we can take it on from there.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events