s t | 21 Mar 15:42 2012
Picon

FW: capitalization of chracters in turkish locale causes a problem of service creation










Hi,
while generating a service from a wsdl, we are facing to problem of having turkish locale.
The generator capitalizes the variable 
class org.apache.ws.commons.schema.XmlSchemaForm.qualified
as
class org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED.
I am not sure how i can solve the issue without changing the locale of whole VM. May be the root of the couse
should be somewhere in schema parsing library of apache. 
You can find the details of the exception below. 

              
javax.management.RuntimeMBeanException: java.lang.IllegalArgumentException: No enum const class
org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED      at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:856)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:869)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:838)
     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)      at
javax.management.remote.generic.ServerIntermediary.handleRequest(ServerIntermediary.java:280)
     at
(Continue reading)

Benson Margulies | 21 Mar 17:15 2012
Picon

Re: FW: capitalization of chracters in turkish locale causes a problem of service creation

This is clearly a bug, it shouldn't be using the thread default
locale. I'm not sure where the bug will turn out to be; it could be
JAXB.

On Wed, Mar 21, 2012 at 10:42 AM, s t <serkan_tas@...> wrote:
>
>
>
>
>
>
>
>
>
> Hi,
> while generating a service from a wsdl, we are facing to problem of having turkish locale.
> The generator capitalizes the variable
> class org.apache.ws.commons.schema.XmlSchemaForm.qualified
> as
> class org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED.
> I am not sure how i can solve the issue without changing the locale of whole VM. May be the root of the couse
should be somewhere in schema parsing library of apache.
> You can find the details of the exception below.
>
>
> javax.management.RuntimeMBeanException: java.lang.IllegalArgumentException: No enum const
class org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED      at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:856)
     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:869)
(Continue reading)

Daniel Kulp | 22 Mar 21:58 2012
Picon

Re: FW: capitalization of chracters in turkish locale causes a problem of service creation

On Wednesday, March 21, 2012 12:15:28 PM Benson Margulies wrote:
> This is clearly a bug, it shouldn't be using the thread default
> locale. I'm not sure where the bug will turn out to be; it could be
> JAXB.

No, this is in XmlSchema.  If you you look there in XmlSchemaForm, you see:

    public static XmlSchemaForm schemaValueOf(String name) {
        return EnumUtil.valueOf(XmlSchemaForm.class, name);
    }

and then in EnumUtil:

    static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name) {
        return Enum.valueOf(enumClass, name.toUpperCase());
    }

the toUpperCase call would use the local Local.   I wonder if that should be 
something more like:

.toUpperCase(Locale.ENGLISH);

to force english usage for that or just put a pure valueOf on XmlSchemaForm 
that handle the three values directly.  

In anycase, a fix would need to be done down there.   Patches are welcome. 
:-)

Dan

(Continue reading)

Daniel Kulp | 22 Mar 22:05 2012
Picon

Re: FW: capitalization of chracters in turkish locale causes a problem of service creation


Created:

https://issues.apache.org/jira/browse/XMLSCHEMA-22

to make sure it's not lost.

Dan

On Thursday, March 22, 2012 04:58:42 PM Daniel Kulp wrote:
> On Wednesday, March 21, 2012 12:15:28 PM Benson Margulies wrote:
> > This is clearly a bug, it shouldn't be using the thread default
> > locale. I'm not sure where the bug will turn out to be; it could be
> > JAXB.
> 
> No, this is in XmlSchema.  If you you look there in XmlSchemaForm, you
> see:
> 
> 
>     public static XmlSchemaForm schemaValueOf(String name) {
>         return EnumUtil.valueOf(XmlSchemaForm.class, name);
>     }
> 
> 
> and then in EnumUtil:
> 
>     static <T extends Enum<T>> T valueOf(Class<T> enumClass, String name)
> { return Enum.valueOf(enumClass, name.toUpperCase());
>     }
> 
(Continue reading)

Aki Yoshida | 23 Mar 10:41 2012

Re: FW: capitalization of chracters in turkish locale causes a problem of service creation

Hi,
I was wondering f any complex java application can be running reliably
on the Turkish locale. A while ago, I learned this Turkish locale
problem and did a code scan on various libraries using toLowerCase().
And there were quite a lot of them (even in JDK) using the default
locale provided the input is a pure ascii Latin alphabet string.

I think it is unfortunate that the Turkish locale defines its own
mapping within the ascii range instead of using higher range
characters as the Greek locale does. But this is probably a political
topic and does not belong to this mailing list. So, I will stop it
here.

However, don't you think it is broken if the following assertion is
not satisfied ?

assertEquals("i".toUpperCase().charAt(0),  Character.toUpperCase('i'));

regards, aki

2012/3/22 Daniel Kulp <dkulp@...>:
>
> Created:
>
> https://issues.apache.org/jira/browse/XMLSCHEMA-22
>
> to make sure it's not lost.
>
> Dan
>
(Continue reading)

Serkan Taş | 23 Mar 13:14 2012
Picon

Re: capitalization of chracters in turkish locale causes a problem of service creation

Hi,

You are completely right Aki. I am pretty sure with weblogic and Jaxb are the prefect samples for the
stutation and last night i added the eXist database to the list.

I am not going to discuss the political side of the defect :)

But it is needed to add another line also for lowercase.

"I".lowerCase() is equal "ı"

regards,

serkan

23 Mar 2012 tarihinde 11:41 saatinde, Aki Yoshida şunları yazdı:

> Hi,
> I was wondering f any complex java application can be running reliably
> on the Turkish locale. A while ago, I learned this Turkish locale
> problem and did a code scan on various libraries using toLowerCase().
> And there were quite a lot of them (even in JDK) using the default
> locale provided the input is a pure ascii Latin alphabet string.
> 
> I think it is unfortunate that the Turkish locale defines its own
> mapping within the ascii range instead of using higher range
> characters as the Greek locale does. But this is probably a political
> topic and does not belong to this mailing list. So, I will stop it
> here.
> 
(Continue reading)


Gmane