V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chaegumi
V2EX  ›  程序员

javax.sql.DataSource 这个 maven 仓库没有,怎么办

  •  
  •   chaegumi ·
    chaegumi · 2016-04-16 21:30:37 +08:00 · 6123 次点击
    这是一个创建于 3145 天前的主题,其中的信息可能已经有所发展或是发生改变。
    不是 java 程序员来配置 cas 好吃力,眼看就要成功了,配置到使用数据库认证时,报错,这个包 maven 仓库中又没有,搜索不到合适的文章,文章里边的方法都试了,没用
    7 条回复    2016-04-16 23:09:27 +08:00
    letitbesqzr
        1
    letitbesqzr  
       2016-04-16 21:50:24 +08:00   ❤️ 1
    这不是 jdk 里带的?
    chaegumi
        2
    chaegumi  
    OP
       2016-04-16 21:54:09 +08:00
    @letitbesqzr

    那这个是啥意思,求指点

    四月 16, 2016 9:30:06 下午 org.apache.catalina.core.StandardContext listenerStart
    严重: Exception sending context initialized event to listener instance of class org.jasig.cas.CasEnvironmentContextListener
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queryAndEncodeDatabaseAuthenticationHandler' defined in URL [jar:file:/E:/xampp/tomcat/webapps/cas-overlay-server-demo/WEB-INF/lib/cas-server-support-jdbc-4.2.1.jar!/org/jasig/cas/adaptors/jdbc/QueryAndEncodeDatabaseAuthenticationHandler.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [javax.sql.DataSource]: : No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=queryEncodeDatabaseDataSource)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=queryEncodeDatabaseDataSource)}
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1879)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=queryEncodeDatabaseDataSource)}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 28 more
    letitbesqzr
        3
    letitbesqzr  
       2016-04-16 22:00:45 +08:00   ❤️ 1
    @chaegumi 说的是 cas jdbc 包下的 queryAndEncodeDatabaseAuthenticationHandler 需要注入一个 javax.sql.DataSource 类型的对象。。 但是没找到任何 type 为 DataSource 的 bean 。 自己定义一个就可以
    chaegumi
        4
    chaegumi  
    OP
       2016-04-16 22:23:20 +08:00
    @letitbesqzr 难怪我都搜索不到答案,对懂 java 的人来说是小问题,因为我本身就理解错了 log ,听了你的解释后就懂了,就是不知道在哪里配置,我还得继续查资料, thanks 。
    letitbesqzr
        5
    letitbesqzr  
       2016-04-16 22:30:48 +08:00
    @chaegumi 目测是 jasig 的 cas ?
    chaegumi
        6
    chaegumi  
    OP
       2016-04-16 22:34:57 +08:00
    @letitbesqzr 是的
    tianice
        7
    tianice  
       2016-04-16 23:09:27 +08:00
    javax.sql.DataSource 是 jdk 自带的,这个是个接口,几乎所有连接池都会实现这个接口。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1627 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:53 · PVG 00:53 · LAX 08:53 · JFK 11:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.