I have web service:
@SchemaValidation
@WebService(endpointInterface = "myEndpoint",
portName = "myPort", serviceName = "myService")
public class MyEndpointImpl implements MyEndpoint {
injected by spring to jetty with CXF:
<jaxws:endpoint
id="myEndpoint"
implementor="MyEndpointImpl"
address="/myEndpoint"
publishedEndpointUrl="http://000.000.00.215/endpoint">
<jaxws:schemaLocations>
<jaxws:schemaLocation>classpath:MyRequests.xsd</jaxws:schemaLocation>
</jaxws:schemaLocations>
<jaxws:properties>
<entry key="schema-validation-enabled" value="true"/>
<entry key="ws-security.bst.validator" value="org.apache.ws.security.validate.NoOpValidator"/>
</jaxws:properties>
<jaxws:inInterceptors>
<ref bean="inbound-security"/>
<ref bean="cryptoCoverageChecker"/>
</jaxws:inInterceptors>
</jaxws:endpoint>
The xsd contains decimal
type, java classes were generated with current xjc
:
<xsd:element name="limitMin" type="xsd:decimal"/>
<xsd:element name="limitMax" type="xsd:decimal"/>
The service works, but I can see such log statements, which makes me nervous:
java.lang.InstantiationException: java.math.BigDecimal
Continuing ...
java.lang.RuntimeException: failed to evaluate: <unbound>=Class.new();
I googled some 10 years old Sun explanation and some workaround for JAXB:
PersistenceDelegate pd=encoder.getPersistenceDelegate(Integer.class);
encoder.setPersistenceDelegate(BigDecimal.class,pd );
But I cannot access it directly. What to do? Can I fix it somehow?