Friday, July 25, 2014

WSO2 DSS in Windows - accessing Oracle 11g requires the orai18n.jar

Okay, I should preface this post with the fact that I've seen as many connection strings and ways of connecting to Oracle as there are DB clients.  I don't think there is anything unusual about having trouble connecting to Oracle on a new application, and I expect connection methods may change with future oracle versions.

The Symptoms

You are attemting to connect to Oracle 11g R2 using the WSO2 DSS server running on Windows.  When attempting to add a datasource, you see an unusual error:

TID: [0] [DSS] [2014-07-24 17:47:05,125] ERROR {org.apache.axis2.rpc.receivers.RPCMessageReceiver} -  oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter; {org.apache.axis2.rpc.receivers.RPCMessageReceiver}
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
...
Caused by: java.lang.NoSuchMethodError: oracle.i18n.text.converter.CharacterConverterOGS.getInstance(I)Loracle/i18n/text/converter/CharacterConverter;
 

The Solution

Just like the stack dump indicates, there may be a missing method.  This appears to have something to do with Oracle 11g jdbc in Windows environments.  Oracle offers an additional jar for this scenario, namely orai18n.jar.  This file is needed in addition to the jdbc6 driver.  I found it offered on the same Oracle 11g site that offered the jdbc6 driver for that version.  Adding the orail18n.jar along with the driver should take care of the missing method, and allow you to connect to Oracle 11g.

Or, you could try running WSO2 DSS from *nix instead... Works like a charm there.

Cheers, Y'all!

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi, i'm getting the next error starting wso2server:
    [2015-05-13 12:09:29,734] INFO - AgentDS Successfully deployed Agent Client
    [2015-05-13 12:09:31,690] ERROR - Activator Cannot start User Manager Core bundl
    e
    java.lang.LinkageError: loader constraint violation: loader (instance of org/ecl
    ipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading
    for a different type with name "oracle/sql/converter/CharacterConverters"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(
    DefaultClassLoader.java:188)
    I have configured master-datasource to use with oracle, and copied to [wso2esb home]\repository\components\lib the drive for oracle11:
    i tried with ojdbc6.jar and ojdbc14.jar + orai18n.jar..but i continue getting the same error.
    Colud you help me?

    ReplyDelete