[ 
https://issues.apache.org/jira/browse/WW-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13871810#comment-13871810
 ] 

Hudson commented on WW-4244:
----------------------------

SUCCESS: Integrated in Struts2-JDK6 #874 (See 
[https://builds.apache.org/job/Struts2-JDK6/874/])
WW-4244 Uses ObjectFactory to instantiate action in config-browser 
(lukaszlenart: rev 750d68009cfebd50bbfd4cf32f9ba7a29143262a)
* 
plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConfigAction.java


> ShowConfigAction.execute() throws InstantiationException when the Action has 
> NO nullary constructor
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WW-4244
>                 URL: https://issues.apache.org/jira/browse/WW-4244
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Config Browser
>    Affects Versions: 2.3.15.3
>            Reporter: Harry Chan
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.17
>
>         Attachments: WW4244.patch
>
>
> In my case, I use Guice for DI and constructor injection is used in many 
> Actions.
> When I enable the Config Browser feature and click the Action in the Action 
> information page, it shows the error message
> {quote}Unable to execute 
> org.apache.struts2.config_browser.ShowConfigAction{quote}
> After a brief code tracing, I found that in the *ShowConfigAction.execute()*, 
> it uses *clazz.newInstance()* for creating the action instance. And the 
> java-doc of the *newInstance()* claims that *it would throw the 
> InstantiationException if the class has no nullary constructor*.
> I think one of the quick fix would be added default-constructor into those 
> Actions(I have tested it and it works). However, I think it would not be a 
> good solution as the extra constructor is a redundancy to me and would 
> increase the maintenance cost. 
> I am wondering if the ShowConfigAction could use *ObjectFactory.buildBean()* 
> for creating the action instance.
> P.S: Please correct me if I use the Config Browser Plugin in the wrong way.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to