mybatis / old-google-code-issues

Automatically exported from code.google.com/p/mybatis
2 stars 4 forks source link

Aliases not working in Turkish systems #748

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
My batis with sonar 3.2 included

Please describe the problem.  Unit tests are best!
Problem occurs on Turkish language systems.       
String key = string.toLowerCase(); does not work in turkish like in english 
Ingeter does not become integer after lowercasing. 

What is the expected output? What do you see instead?

Can you provide stack trace, logs, error messages that are displayed?
onar:sonar-maven-plugin:3.2:sonar failed: Error resolving class . Cause: org.apa
che.ibatis.type.TypeException: Could not resolve type alias 'Integer'.  Cause: j
ava.lang.ClassNotFoundException: Cannot find class: Integer -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project Blackjac
k3: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sona
r failed: Error resolving class . Cause: org.apache.ibatis.type.TypeException: C
ould not resolve type alias 'Integer'.  Cause: java.lang.ClassNotFoundException:
 Cannot find class: Integer
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:225)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
li of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar failed: Error resolvi
ng class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type a
lias 'Integer'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Int
eger
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        ... 19 more
Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class . C
ause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Intege
r'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Integer
        at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:9
4)
        at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(
XMLStatementBuilder.java:83)
        at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromCont
ext(XMLMapperBuilder.java:128)
        at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromCont
ext(XMLMapperBuilder.java:121)
        at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(X
MLMapperBuilder.java:111)
        at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder
.java:88)
        at org.sonar.core.persistence.MyBatis.loadMapper(MyBatis.java:177)
        at org.sonar.core.persistence.MyBatis.loadMappers(MyBatis.java:154)
        at org.sonar.core.persistence.MyBatis.start(MyBatis.java:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(
ReflectionLifecycleStrategy.java:110)
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(Reflect
ionLifecycleStrategy.java:89)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter
.start(AbstractInjectionFactory.java:84)
        at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.j
ava:169)
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Store
d.java:132)
        at org.picocontainer.behaviors.Stored.start(Stored.java:110)
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(Defaul
tPicoContainer.java:1009)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoConta
iner.java:1002)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.jav
a:760)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentCo
ntainer.java:70)
        at org.sonar.batch.bootstrap.Module.start(Module.java:82)
        at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:73)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:60)
        at org.sonar.maven.SonarMojo.execute(SonarMojo.java:150)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
        ... 20 more
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'I
nteger'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Integer
        at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegist
ry.java:109)
        at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:1
15)
        at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:9
2)
        ... 47 more
Caused by: java.lang.ClassNotFoundException: Cannot find class: Integer
        at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapp
er.java:188)
        at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapp
er.java:87)
        at org.apache.ibatis.io.Resources.classForName(Resources.java:250)
        at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegist
ry.java:105)

Please provide any additional information below.
You may want to support multi language systems and write safer code like not 
using lowercase for key value mapping.

Original issue reported on code.google.com by ekremu...@gmail.com on 4 Jan 2013 at 9:37

GoogleCodeExporter commented 9 years ago
Hi. Thanks for the report. 

Could you please try the snapshot to see if the fix worked as expected?

Thanks in advance!

Original comment by eduardo.macarron on 5 Jan 2013 at 8:38

GoogleCodeExporter commented 9 years ago
Forgot to include the revision. It is r5569

Original comment by eduardo.macarron on 5 Jan 2013 at 8:47