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
>
> On Wed, Mar 21, 2012 at 10:42 AM, s t <[email protected]> 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(DefaultMB
> > eanServerInterceptor.java:856) at
> > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBean
> > Exception(DefaultMBeanServerInterceptor.java:869) at
> > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBe
> > anServerInterceptor.java:838) at
> > com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
> > at
> > javax.management.remote.generic.ServerIntermediary.handleRequest(Server
> > Intermediary.java:280) at
> > javax.management.remote.generic.ServerIntermediary$PrivilegedRequestJob
> > .run(ServerIntermediary.java:951) at
> > java.security.AccessController.doPrivileged(Native Method) at
> > javax.management.remote.generic.ServerIntermediary$RequestHandler.handl
> > eMBSReqMessage(ServerIntermediary.java:727) at
> > javax.management.remote.generic.ServerIntermediary$RequestHandler.execu
> > te(ServerIntermediary.java:629) at
> > com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$RemoteJob
> > .run(ServerSynchroMessageConnectionImpl.java:266) at
> > com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadSe
> > rvice.java:208) at
> > com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)Caused
> > by: java.lang.IllegalArgumentException: No enum const class
> > org.apache.ws.commons.schema.XmlSchemaForm.QUALİFİED at
> > java.lang.Enum.valueOf(Enum.java:196) at
> > org.apache.ws.commons.schema.EnumUtil.valueOf(EnumUtil.java:31) at
> > org.apache.ws.commons.schema.XmlSchemaForm.schemaValueOf(XmlSchemaForm.
> > java:32) at
> > org.apache.ws.commons.schema.SchemaBuilder.getFormDefault(SchemaBuilder
> > .java:181) at
> > org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementBasics(Sc
> > hemaBuilder.java:1489) at
> > org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(Schem
> > aBuilder.java:649) at
> > org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollecti
> > on.java:542) at
> > org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.
> > java:129) at
> > org.apache.cxf.wsdl11.SchemaUtil.extractSchema(SchemaUtil.java:133)
> > at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:73)
> > at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:65)
> > at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:60)
> > at
> > org.apache.cxf.wsdl11.WSDLServiceBuilder.getSchemas(WSDLServiceBuilder.
> > java:372) at
> > org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuild
> > er.java:339) at
> > org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuild
> > er.java:196) at
> > org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuild
> > er.java:172) at
> > org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java
> > :119) at
> > org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dynam
> > icClientFactory.java:294) at
> > org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dynam
> > icClientFactory.java:234) at
> > org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dynam
> > icClientFactory.java:227) at
> > org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dynam
> > icClientFactory.java:182) at
> > com.likya.tlossw.jmx.beans.WebServiceOperator.getWsOperationList(WebSer
> > viceOperator.java:68) at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
> > va:39) at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
> > rImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> > com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBea
> > nIntrospector.java:93) at
> > com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBea
> > nIntrospector.java:27) at
> > com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.jav
> > a:208) at
> > com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
> > at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
> > at
> > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBe
> > anServerInterceptor.java:836) ... 9 more
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com