You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/01/25 18:07:08 UTC

DO NOT REPLY [Bug 50650] New: Connector#setProperty(String, String) does not set explicit property values

https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

           Summary: Connector#setProperty(String, String) does not set
                    explicit property values
           Product: Tomcat 6
           Version: 6.0.29
          Platform: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Connectors
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: apache@lonbinder.com


When calling the setProperty(String, String) method in Connector.java (line 316
in 6.0.29), the explicit property values are not set.

For instance, if I call connector.setProperty("proxyName", "my.host.com") then
check connector.getProxyName() it does not return "my.host.com".  I've also
tested "proxyPort" / getProxyPort -- same issue.

Looking at the code, setProperty sets replacements hashmap and the value in the
protocolhandler.  Individual explicit property setter methods, e.g.
setProxyName(String) set both the individual field value (this.proxyName) AND
invoke setProperty.

However, looking at the getters for the individual properties, shows they only
check the individual fields and not the replacements hashmap or the protocol
handler value.  Therefore the above series (call to setProperty("proxyName"...)
and then getProxyName()) fails.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

--- Comment #4 from Lon Binder <ap...@lonbinder.com> 2011-01-25 17:50:30 EST ---
In order to work around this for my situation (using OFBiz) I wrote a patch to
their code that essentially does the same as IntrospectionUtils: it uses
reflection to find the the appropriate setter by name and type and sets in the
value.  This (or IntrospectionUtils or something else available) could be set
in place.  I don't have a tomcat dev environment set up, but I could get it
going and put the patch together.

Btw, I don't think the existing of explicit getter/setters and a generalized
getProperty/setProperty is redundant.  The generalized method is useful for
setting from an XML file while the explicit comply with the stronger typing for
java.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2011-01-25 12:21:43 EST ---
That is by design. setProperty(String, String) is the method that is called
when explicit property setter is not available.

See org.apache.tomcat.util.IntrospectionUtils.setProperty(Object, String,
String, boolean)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

--- Comment #5 from Mark Thomas <ma...@apache.org> 2011-01-26 11:14:12 EST ---
Agree with Konstantin, this is a WONTFIX.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

Lon Binder <ap...@lonbinder.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache@lonbinder.com
         OS/Version|                            |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

Lon Binder <ap...@lonbinder.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |

--- Comment #2 from Lon Binder <ap...@lonbinder.com> 2011-01-25 15:42:12 EST ---
Konstantin - I respectfully disagree, the design is fatally flawed.  It should
not be the case that setProperty("proxyName", String) behaves differently than
setProxyName(String).  

Most specifically, if the user calls setProperty("proxyName", String) it should
be expected that the getProxyName returns the same value.

If this is by design, the API docs need a lot of work, and I've already seen at
least one major application (ofbiz) that expects that to work.

If you won't change the code, please at least make this really clear in the API
and in the tomcat properties pages (non javadoc).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50650] Connector#setProperty(String, String) does not set explicit property values

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50650

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> 2011-01-25 16:49:42 EST ---
> and I've already seen at least one major application (ofbiz) that expects that to work

That never worked. Why are they expecting something?

> Most specifically, if the user calls setProperty("proxyName", String) it should
be expected that the getProxyName returns the same value.

No, I would expect that getProperty("proxyName") would return the value, from
symmetry.  There is no need in a class to provide two sets of API to the same
underlying features. It is caller's responsibility to call the correct API.

Note, that besides Connector there are also a lot of other classes in Tomcat
that have setProperty(..)/getProperty(..) methods and behave in the same way.
If anybody would like to propose a patch we may talk further, but I see no bug
here.

I will leave this open for a while, if anyone else wants to comment.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org