You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Sarat Pediredla (JIRA)" <ji...@apache.org> on 2008/02/27 18:20:07 UTC
[jira] Commented: (WW-2506) ControllerClasspathPackageProvider
causes duplicate package error
[ https://issues.apache.org/struts/browse/WW-2506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43412#action_43412 ]
Sarat Pediredla commented on WW-2506:
-------------------------------------
We actually have an app that is being built using 2.1.1-SNAPSHOT and I reckon the second path would be good from our perspective too.
Could it not happen (excuse my meagre Struts 2 knowledge) that the ControllerClasspathPackageProvider check if the parent package has already been configured by Codebehind and skip it or else configure it?
> ControllerClasspathPackageProvider causes duplicate package error
> -----------------------------------------------------------------
>
> Key: WW-2506
> URL: https://issues.apache.org/struts/browse/WW-2506
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - REST
> Affects Versions: 2.1.0
> Reporter: Jeromy Evans
>
> If a REST Controller (aka action) implements Action or is annotated with @Action, the CodeBehind PackageProvider and the REST PackageProvider both attempt to create the parent package. This results in a duplicate package error while building the configuration:
> ...
> Caused by: The package name 'mypackage.actions.parent' at location null is already been used by another package at location null
> The reason is that CodeBehind's ClasspathPackageProvider detects the action and configures the parent package, and the ControllerClasspathPackageProvider (re)detects the Controller and configures the parent package.
> As it exists, this will be a common error as uses may tend to extend ActionSupport to access ValidationAwareSupport and TextProviderSupport within a Controller.
> Possible resolutions:
> - REST plugin does not configure Controllers that are also Actions; or
> - REST plugin provides unique names for the parent packages it creates (currently it uses the java package name)
> I prefer the latter but aren't sure of the implications. The change would also impact the CodeBehind.
> I believe this only affects 2.1.1+ due to the strict configuration. It can be replicated by changing the rest-showcase Controller to extend ActionSupport rather than ValidationAwareSupport.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.