Categories
Software & Development

Oracle & Java error “locale not recognized”

If you are using rather exotic Windows regional settings you might get the following error:

Locale not recognized

The solution is simple as mentioned here. Just set the JAVA_TOOL_OPTIONS environment variable to this:

-Dfile.encoding=UTF8 -Duser.language=en -Duser.region=US -Duser.country=US

JDBC won’t use regional setting to determine locale to be used (and probably unsupported at the moment) anymore .

Categories
Software & Development

AXIS SOAPFaultBuilder throws DOMException WRONG_DOCUMENT_ERR

Did you try to use Axis to connect to a remote web service? Do you get “SOAPFaultBuilder throws DOMException WRONG_DOCUMENT_ERR” error?

Well, it’s a well known bug that’s been fixed. However, the fix has not been included in any released version (that’s since 2006). You have to download the sources, add one line, change the next one and then build it on your own (the error is received when xml node was added to document node before it’s been imported into the DOM). So far so good.

The issue is that Axis is written in Java 1.4. Java 1.6 (current JDK 1.6) insists on using 1.6 version of abstract classes (e.g. javax.xml.soap.SOAPMessage) even if you specify -source 1.4 switch (if you wonder if the switch is not just ignored then you’re wrong – it isn’t, because you won’t get as many warning as for 1.6 value).

So, you have to use JDK 1.4, but where to get it? You can download it from Sun’s site, but wait – oops, you can’t anymore, because it’s reached the end of service life (ESL).

I found the old JDK 1.4 somewhere on my harddrive and compiled the fixed version for you. If you want it, you can grab it here. Source can be found here. To see the changes check SOAPFaultBuilder.java on lines 304-306.