Uploaded image for project: 'Lucee Development'
  1. LDEV-823

Adding datasource with class "com.microsoft.jdbc.sqlserver.SQLServerDriver" results in lucee.commons.lang.ClassException error

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.235
    • Fix Version/s: 5.0.0.242
    • Labels:
      None

      Description

      In Lucee 4.x you could add an MSSQL datasource with the class name "com.microsoft.jdbc.sqlserver.SQLServerDriver" using <cfapplication> and it would automatically get resolved into the intended class. In Lucee 5.x though lucee.commons.lang.ClassException error gets thrown.

      The proper fix for this is for developers to ensure the correct class name, com.microsoft.sqlserver.jdbc.SQLServerDriver is used, and NOT com.microsoft.jdbc.sqlserver.SQLServerDriver

      However a workaround to allow Lucee 4.5 -> 5.0 compatibility could be desirable

      Stack trace as follows

      [
      lucee.runtime.exp.NativeException: cannot load class through its string name, because no definition for the class with the specified name [com.microsoft.jdbc.sqlserver.SQLServerDriver] could be found, 
      	at lucee.commons.lang.ClassUtil.loadClass(ClassUtil.java:179), 
      	at lucee.transformer.library.ClassDefinitionImpl.getClazz(ClassDefinitionImpl.java:71), 
      	at lucee.runtime.db.DataSourceSupport._initializeDriver(DataSourceSupport.java:131), 
      	at lucee.runtime.db.DataSourceSupport.initialize(DataSourceSupport.java:110), 
      	at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:87), 
      	at lucee.runtime.db.DatasourceConnectionPool.loadDatasourceConnection(DatasourceConnectionPool.java:89), 
      	at lucee.runtime.db.DatasourceConnectionPool.getDatasourceConnection(DatasourceConnectionPool.java:83), 
      	at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:76), 
      	at lucee.runtime.tag.Query.executeDatasoure(Query.java:803), 
      	at lucee.runtime.tag.Query.doEndTag(Query.java:583), 
      	at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:81), 
      	at cfc.login.isams_cfc$cf.udfCall(/opt/mso_parent_portal/cfc/login/isams.cfc:48), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698), 
      	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:580), 
      	at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1919), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at defaulttemplate.data.login_cfm$cf.call(/opt/mso_parent_portal/defaultTemplate/data/login.cfm:32), 
      	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:907), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:822), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:808), 
      	at cfc.templater_cfc$cf.udfCall(/opt/mso_parent_portal/cfc/templater.cfc:15), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.type.EnvUDF.callWithNamedValues(EnvUDF.java:71), 
      	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:779), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at cfc.templater_cfc$cf.udfCall(/opt/mso_parent_portal/cfc/templater.cfc:44), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:779), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at defaulttemplate.items.login_cfm$cf.call(/opt/mso_parent_portal/defaultTemplate/items/login.cfm:2), 
      	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:907), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:822), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:808), 
      	at cfc.templater_cfc$cf.udfCall(/opt/mso_parent_portal/cfc/templater.cfc:15), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.type.EnvUDF.callWithNamedValues(EnvUDF.java:71), 
      	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:779), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at cfc.templater_cfc$cf.udfCall(/opt/mso_parent_portal/cfc/templater.cfc:44), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:779), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at router_cfm$cf.udfCall(/opt/mso_parent_portal/router.cfm:236), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:210), 
      	at lucee.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:779), 
      	at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:793), 
      	at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1594), 
      	at router_cfm$cf.call(/opt/mso_parent_portal/router.cfm:54), 
      	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:907), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:822), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817), 
      	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:808), 
      	at _application_cfc$cf.udfCall1(/opt/mso_parent_portal/_Application.cfc:84), 
      	at _application_cfc$cf.udfCall(/opt/mso_parent_portal/_Application.cfc), 
      	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:105), 
      	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:337), 
      	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224), 
      	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:697), 
      	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:580), 
      	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1902), 
      	at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:422), 
      	at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:224), 
      	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43), 
      	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2266), 
      	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2258), 
      	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2226), 
      	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:837), 
      	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102), 
      	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62), 
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729), 
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292), 
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207), 
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52), 
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240), 
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207), 
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212), 
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106), 
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502), 
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141), 
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79), 
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616), 
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88), 
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676), 
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522), 
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095), 
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672), 
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500), 
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456), 
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), 
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), 
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61), 
      	at java.lang.Thread.run(Thread.java:745), 
      Caused by: lucee.commons.lang.ClassException: cannot load class through its string name, because no definition for the class with the specified name [com.microsoft.jdbc.sqlserver.SQLServerDriver] could be found, 
      	... 112 more
      ]
      

        Attachments

          Activity

            People

            • Assignee:
              SimonHooker Simon Hooker
              Reporter:
              SimonHooker Simon Hooker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: