oracle.jdbc.driver.T4CConnection cannot be cast to oracle.jdbc.OracleConnection

前端 未结 1 1716
滥情空心
滥情空心 2020-12-18 10:54
WrappedConnectionJDK6 wrapped = (WrappedConnectionJDK6) dbStrategy.getConnection();
            Connection underlyingConn = wrapped.getUnderlyingConnection();
               


        
相关标签:
1条回答
  • 2020-12-18 11:27

    AFAIK T4CConnection should implement oracle.jdbc.OracleConnection. IMHO you have 2 driver implementation, one on the app server and one in your project dependencies, there must be a classloading issue as the retrieved driver implementation is loaded by the shared class loader and you try to cast it to a class loaded by the webApp class loader.

    You can ensure that your web-app dependency is the same than the server provided implementation or just exclude the dependency from the web app when packaging it.

    If you're using maven just set the scope to provided.

    0 讨论(0)
提交回复
热议问题