Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: No enum const class net.bull.javamelody.Parameter.SPRİNG_TRANSFORM_PATTERN #386

Closed
GoogleCodeExporter opened this issue Jun 21, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. we setup javamelody in tomcat 7.0.25, added two jars and configured web.xml 
as in user guide described. we add tomcat VM argument:
 -Duser.language=tr -Duser.country=TR
2. during startup of the tomcat with our application deployed (in Eclipse), we 
get the following exception:
java.lang.IllegalArgumentException: No enum const class 
net.bull.javamelody.Parameter.SPRİNG_TRANSFORM_PATTERN
    at java.lang.Enum.valueOf(Enum.java:196)
    at net.bull.javamelody.Parameter.valueOf(Parameter.java:27)
    at net.bull.javamelody.Parameter.valueOfIgnoreCase(Parameter.java:280)
    at net.bull.javamelody.FilterContext.setRequestTransformPatterns(FilterContext.java:171)
    at net.bull.javamelody.FilterContext.initCounters(FilterContext.java:146)
    at net.bull.javamelody.FilterContext.<init>(FilterContext.java:101)
    at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:111)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
3.

What is the expected output? What do you see instead?
when we do not use VM parameter, it starts and monitors as excepted.

What version of the product are you using? On what application server, JDK,
operating system?
we use javamelody 1.49.0
tomcat 7.0.25
sun java 1.6.0.32
windows 7

Please provide any additional information below.
It is because of Locale code in net.bull.javamelody.Parameter file:

    static Parameter valueOfIgnoreCase(String parameter) {
        return valueOf(parameter.toUpperCase(Locale.getDefault()).trim());
    }

should be just for English locale, because in turkish locale the uppercase of 
"spring-transform-pattern" is "SPRİNG_TRANSFORM_PATTERN". as you see i 
uppercase in turkish is İ
so i think code should like:

static Parameter valueOfIgnoreCase(String parameter) {
        return valueOf(parameter.toUpperCase(Locale.ENGLISH).trim());
    }

Original issue reported on code.google.com by erdem.yi...@gmail.com on 27 Feb 2014 at 8:04

@GoogleCodeExporter
Copy link
Author

This is fixed by revision 3690 in trunk. It's ready for the next release (1.50).
A snapshot build including the fix is available at:
https://javamelody.ci.cloudbees.com/job/javamelody/net.bull.javamelody$javamelod
y-core/
Thanks for the issue.

Original comment by evernat@free.fr on 28 Feb 2014 at 10:12

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

thanks for the quick response and fix. i ll try with the snapshot version. 
regards.

Original comment by erdem.yi...@gmail.com on 1 Mar 2014 at 7:59

@GoogleCodeExporter
Copy link
Author

FindBugs will warn about no-arg toUpperCase(), by the way, but if you 
explicitly specified Locale.getDefault() you are on your own.

Original comment by jgl...@cloudbees.com on 16 Apr 2014 at 7:07

@GoogleCodeExporter
Copy link
Author

@jglick
Glad to see you here.
Yes, I know Findbugs. Findbugs, PMD and Checkstyle violations are displayed 
using Jenkins @ CloudBees:
https://javamelody.ci.cloudbees.com/job/javamelody/

Sonar @ CloudBees would also display that violation. (But Sonar @ CloudBees is 
currently not free for opensource projects.)

That's why, I used Locale.getDefault() in this case.
And so, the thing to know is that it is not enough and the upper case of "-" is 
"_" in Turkish.

Original comment by evernat@free.fr on 16 Apr 2014 at 7:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant