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 2019/09/27 19:09:10 UTC
[Bug 63778] New: Jre7Compat cannot find getPseudoColumns with zero
parameters
https://bz.apache.org/bugzilla/show_bug.cgi?id=63778
Bug ID: 63778
Summary: Jre7Compat cannot find getPseudoColumns with zero
parameters
Product: Tomcat 7
Version: 7.0.94
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: annih.apache.org@annih.net
Target Milestone: ---
The class org.apache.tomcat.util.compat.Jre7Compat fails to find the method
java.sql.DatabaseMetaData.getPseudoColumns() with zero parameters in it's
static initializer which leads to the remaining methods like
ResultSet.getObject() not being looked up and referenced at all. This causes
NullPointerExceptions which are especially hard to diagnose because exceptions
in all the JreCompat classes are just thrown into the nether.
The method Jre7Compat is trying to find expects 4 String parameters.
The actual call to the looked up method in
org.apache.tomcat.util.compat.Jre7Compat.getPseudoColumns(...) is done
correctly with all 4 String parameters provided.
What I feel should be done about this:
1. Replace
m9 = DatabaseMetaData.class.getMethod("getPseudoColumns");
with
m9 =
DatabaseMetaData.class.getMethod("getPseudoColumns",String.class,String.class,String.class,String.class);
2. Never simply ignore and void exceptions! I understand that there should not
be tons of error messages every time you start up tomcat with an older version
of Java but there has to be another way.
We noticed this problem with 7.0.94 but the code looks identical in the current
git branch.
--
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
[Bug 63778] Jre7Compat cannot find getPseudoColumns with zero
parameters
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63778
lgxbslgx@gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from lgxbslgx@gmail.com ---
Catching the exception without handling them is not a good habit. It could hide
some problem such as this bug.
I submit a PR to solve the bug. https://github.com/apache/tomcat/pull/209
Hope it could help.
--
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
[Bug 63778] Jre7Compat cannot find getPseudoColumns with zero
parameters
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63778
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.
The original issue has been fixed in 7.0.x and I have added some logging to the
JreCompat classes that should detect if further bugs like this creep in in the
future.
The fix will be in 7.0.97 onwards
--
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