qq_27481747 2015-04-27 08:20 采纳率: 0%
浏览 2122

java注入bean的相关问题,求大神帮我看看,感激不尽!急急急。。。。。。

启动tomcat后报错了
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminBean' defined in ServletContext resource [/WEB-INF/saiku-beans.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'repositoryDatasourceManager' of bean class [org.saiku.web.rest.resources.AdminResource]: Bean property 'repositoryDatasourceManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1427)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'repositoryDatasourceManager' of bean class [org.saiku.web.rest.resources.AdminResource]: Bean property 'repositoryDatasourceManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1042)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:902)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)
... 26 more

  • 写回答

2条回答 默认 最新

  • qq_27481747 2015-04-27 08:23
    关注

    这是saiku-bean.xml
    <?xml version="1.0" encoding="UTF-8" ?>

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">

    <!--    <bean id="classpathDsManager"
            class="org.saiku.service.datasource.ClassPathResourceDatasourceManager">
            <property name="path" value="res:saiku-datasources" />
        </bean>-->
    <bean id="repositoryDsManager" class="org.saiku.service.datasource.RepositoryDatasourceManager" init-method="load" destroy-method="unload">
        <property name="userService" ref="userServiceBean"/>
        <property name="configurationpath" value="E:/repository/configuration.xml"/>
        <property name="datadir" value="E:/repository/data"/>
        <property name="foodmartdir" value="E:/data"/>
        <property name="foodmartschema" value="E:/data/FoodMart4.xml"/>
        <property name="foodmarturl" value="jdbc:h2:E:/data/foodmart;MODE=MySQL"/>
    </bean>
    
    <!-- <property name="path" value="file:///var/saiku/saiku-datasources/"/> -->
    <bean id="h2database" class="org.saiku.database.Database" init-method="init">
        <property name="datasourceManager" ref="repositoryDsManager"/>
    </bean>
    
    <bean id="sessionService" class="org.saiku.web.service.SessionService">
        <property name="authenticationManager" ref="authenticationManager" />
    </bean>
    <bean id="securityContextPersistenceFilter" class="org.springframework.security.web.context.SecurityContextPersistenceFilter" />
    <bean class="org.saiku.datasources.connection.MondrianVFS" init-method="init" id="mondrianVFS">
        <property name="datasourceManager" ref="repositoryDsManager"/>
    </bean>
    <bean id="connectionManager" class="org.saiku.web.core.SecurityAwareConnectionManager" init-method="init"
          destroy-method="destroy" depends-on="mondrianVFS">
        <property name="dataSourceManager" ref="repositoryDsManager" />
        <property name="sessionService" ref="sessionService" />
    
    </bean>
    
    <bean id="datasourceServiceBean" class="org.saiku.service.datasource.DatasourceService">
        <property name="connectionManager" ref="connectionManager" />
    </bean>
    
    <bean id="customerDAO" class="org.saiku.database.JdbcUserDAO">
        <property name="dataSource" ref="dataSource" />
    </bean>
    
    <bean id="userServiceBean" class="org.saiku.service.user.UserService">
        <property name="jdbcUserDAO" ref="customerDAO"/>
        <property name="datasourceService" ref="datasourceServiceBean"/>
        <property name="iDatasourceManager" ref="repositoryDsManager"/>
        <property name="adminRoles">
            <list>
                <value>ROLE_ADMIN</value>
            </list>
        </property>
        <property name="sessionService" ref="sessionService"/>
    </bean>
    <bean id="adminBean" class="org.saiku.web.rest.resources.AdminResource">
        <property name="userService" ref="userServiceBean"/>
        <property name="datasourceService" ref="datasourceServiceBean"/>
        <property name="olapDiscoverService" ref="olapDiscoverServiceBean"/>
        <property name="repositoryDatasourceManager" ref="repositoryDsManager"/>
    </bean>
    
    <bean id="olapDiscoverServiceBean" class="org.saiku.service.olap.OlapDiscoverService">
        <property name="datasourceService" ref="datasourceServiceBean" />
    </bean>
    
    <bean id="olapQueryBean" scope="session" class="org.saiku.service.olap.OlapQueryService" destroy-method="destroy">
        <property name="olapDiscoverService" ref="olapDiscoverServiceBean" />
    </bean>
    
    
    <bean id="datasourceResourceBean" class="org.saiku.web.rest.resources.DataSourceResource">
        <property name="datasourceService" ref="datasourceServiceBean" />
    </bean>
    
    <bean id="olapDiscoverBean" scope="session"
          class="org.saiku.web.rest.resources.OlapDiscoverResource">
        <property name="olapDiscoverService" ref="olapDiscoverServiceBean" />
    </bean>
    
    
    <bean id="queryResource" scope="request"
          class="org.saiku.web.rest.resources.QueryResource">
        <property name="olapQueryService" ref="olapQueryBean" />
        <property name="olapDiscoverService" ref="olapDiscoverServiceBean" />
        <property name="repository" ref="repository2bean"/>
    </bean>
    
    <bean id="thinQueryBean" scope="session"
          class="org.saiku.service.olap.ThinQueryService">
        <property name="olapDiscoverService" ref="olapDiscoverServiceBean" />
    </bean>
    
    <bean id="platformBean" class="org.saiku.service.PlatformUtilsService">
        <property name="path" value="../webapps/ROOT/js/saiku/plugins/"/>
    </bean>
    
    <bean id="infoResource" class="org.saiku.web.rest.resources.InfoResource">
        <property name="platformUtilsService" ref="platformBean"/>
    </bean>
    
    <bean id="queryResource2" scope="request"
          class="org.saiku.web.rest.resources.Query2Resource">
        <property name="thinQueryService" ref="thinQueryBean" />
        <property name="repository" ref="repository2bean"/>
    </bean>
    
    <bean id="sessionResource" class="org.saiku.web.rest.resources.SessionResource">
        <property name="sessionService" ref="sessionService" />
        <property name="userService" ref ="userServiceBean"/>
    
    </bean>
    
    <bean id="repository2bean" scope="request"
          class="org.saiku.web.rest.resources.BasicRepositoryResource2">
        <property name="path" value="res:saiku-repository" />
        <property name="sessionService" ref="sessionService" />
        <property name="datasourceService" ref="datasourceServiceBean"/>
    </bean>
    <!-- <property name="path" value="file:///var/saiku/saiku-datasources/"/> -->
    
    <bean id="tagRepositoryBean" scope="request"
          class="org.saiku.web.rest.resources.BasicTagRepositoryResource">
        <property name="olapQueryService" ref="olapQueryBean" />
        <property name="path" value="res:saiku-repository" />
    </bean>
    
    <bean id="filterRepositoryBean" scope="session"
          class="org.saiku.web.rest.resources.FilterRepositoryResource">
        <property name="olapQueryService" ref="olapQueryBean" />
        <property name="path" value="res:saiku-repository" />
        <property name="sessionService" ref="sessionService"/>
    </bean>
    
    
    
    <bean id="exporterBean" scope="request"
          class="org.saiku.web.rest.resources.ExporterResource">
        <property name="repository" ref="repository2bean" />
        <property name="query2Resource" ref="queryResource2" />
    </bean>
    
    
    
    <bean id="statsBean" scope="singleton" class="org.saiku.web.rest.resources.StatisticsResource" />
    
    <bean id="startupBean" scope="singleton" class="org.saiku.web.rest.util.StartupResource"  init-method="init" />
    

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?