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

这是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" />

这是repositoryDatasourceManager.java

/*

  • Copyright 2014 OSBI Ltd *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License. */

package org.saiku.service.datasource;

import org.saiku.database.dto.MondrianSchema;
import org.saiku.datasources.connection.RepositoryFile;
import org.saiku.datasources.datasource.SaikuDatasource;
import org.saiku.repository.*;
import org.saiku.service.importer.LegacyImporter;
import org.saiku.service.importer.LegacyImporterImpl;
import org.saiku.service.user.UserService;
import org.saiku.service.util.exception.SaikuServiceException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.*;

import javax.jcr.Node;
import javax.jcr.RepositoryException;

/**

  • A Datasource Manager for the Saiku Repository API layer.
    */
    public class RepositoryDatasourceManager implements IDatasourceManager {
    private Map datasources =
    Collections.synchronizedMap(new HashMap());
    private UserService userService;
    private static final Logger log = LoggerFactory.getLogger(RepositoryDatasourceManager.class);
    private String configurationpath;
    private String datadir;
    IRepositoryManager irm;
    private String foodmartdir;
    private String foodmartschema;
    private String foodmarturl;

    public void load() {
    irm = JackRabbitRepositoryManager.getJackRabbitRepositoryManager(configurationpath, datadir);
    try {
    irm.start(userService);
    } catch (RepositoryException e) {
    log.error("Could not start repo", e);
    }
    datasources.clear();
    try {

        List<DataSource> exporteddatasources = null;
        try {
            exporteddatasources = irm.getAllDataSources();
        } catch (RepositoryException e1) {
            log.error("Could not export data sources", e1);
        }
    
        if (exporteddatasources != null) {
            for (DataSource file : exporteddatasources) {
                if (file.getName() != null && file.getType() != null) {
                    Properties props = new Properties();
                    props.put("driver", file.getDriver());
                    props.put("location", file.getLocation());
                    props.put("username", file.getUsername());
                    props.put("password", file.getPassword());
                    props.put("path", file.getPath());
                    props.put("id", file.getId());
                    if(file.getSecurityenabled()!=null) {
                      props.put("security.enabled", file.getSecurityenabled());
                    }
                    if(file.getSecuritytype()!=null) {
                      props.put("security.type", file.getSecuritytype());
                    }
                    if(file.getSecuritymapping()!=null) {
                      props.put("security.mapping", file.getSecuritymapping());
                    }
                    if(file.getAdvanced()!=null){
                      props.put("advanced", file.getAdvanced());
                    }
                    SaikuDatasource.Type t = SaikuDatasource.Type.valueOf(file.getType().toUpperCase());
                    SaikuDatasource ds = new SaikuDatasource(file.getName(), t, props);
                    datasources.put(file.getName(), ds);
                }
            }
        }
    
    } catch (Exception e) {
        throw new SaikuServiceException(e.getMessage(), e);
    }
    

    }

    public void unload() {
    irm.shutdown();
    }

    public SaikuDatasource addDatasource(SaikuDatasource datasource) throws Exception {
    DataSource ds = new DataSource(datasource);

        irm.saveDataSource(ds, "/datasources/" + ds.getName() + ".sds", "fixme");
        datasources.put(datasource.getName(), datasource);
    
    return datasource;
    

    }

    public SaikuDatasource setDatasource(SaikuDatasource datasource) throws Exception {
    return addDatasource(datasource);
    }

    public List addDatasources(List dsources) {
    for (SaikuDatasource datasource : dsources) {
    DataSource ds = new DataSource(datasource);

        try {
            irm.saveDataSource(ds, "/datasources/" + ds.getName() + ".sds", "fixme");
            datasources.put(datasource.getName(), datasource);
    
        } catch (RepositoryException e) {
            log.error("Could not add data source"+ datasource.getName(), e);
        }
    
    }
    return dsources;
    

    }

    public boolean removeDatasource(String datasourceId) {
    List ds = null;
    try {
    ds = irm.getAllDataSources();
    } catch (RepositoryException e) {
    log.error("Could not get all data sources");
    }

    if (ds != null) {
        for(DataSource data : ds){
            if(data.getId().equals(datasourceId)){
                datasources.remove(data.getName());
                irm.deleteFile(data.getPath());
                return true;
            }
        }
    }
    return false;
    

    }

    public boolean removeSchema(String schemaName) {
    List s = null;
    try {
    s = irm.getAllSchema();
    } catch (RepositoryException e) {
    log.error("Could not get All Schema", e);
    }

    if (s != null) {
        for(MondrianSchema data : s){
            if(data.getName().equals(schemaName)){
                irm.deleteFile(data.getPath());
                break;
            }
        }
        return true;
    }
    else{
        return false;
    }
    

    }

    public Map getDatasources() {
    return datasources;
    }

    public SaikuDatasource getDatasource(String datasourceName) {
    return datasources.get(datasourceName);
    }

    public void addSchema(String file, String path, String name) throws Exception {
    irm.saveInternalFile(file, path, "nt:mondrianschema");

    }

    public List getMondrianSchema() {
    try {
    return irm.getAllSchema();
    } catch (RepositoryException e) {
    log.error("Could not get all Schema", e);
    }
    return null;
    }

    public MondrianSchema getMondrianSchema(String catalog) {
    //return irm.getMondrianSchema();
    return null;
    }

    public RepositoryFile getFile(String file) {
    return irm.getFile(file);
    }

    public String getFileData(String file, String username, List roles) {
    try {
    return irm.getFile(file, username, roles);
    } catch (RepositoryException e) {
    log.error("Could not get file "+file, e);
    }
    return null;
    }

    public String getInternalFileData(String file) throws RepositoryException {

        return irm.getInternalFile(file);
    

    }

    public String saveFile(String path, String content, String user, List roles) {
    try {
    irm.saveFile(content, path, user, "nt:saikufiles", roles);
    return "Save Okay";
    } catch (RepositoryException e) {
    log.error("Save Failed",e );
    return "Save Failed: " + e.getLocalizedMessage();
    }
    }

    public String removeFile(String path, String user, List roles) {
    try {
    irm.removeFile(path, user, roles);
    return "Remove Okay";
    } catch (RepositoryException e) {
    log.error("Save Failed", e);
    return "Save Failed: " + e.getLocalizedMessage();
    }
    }

    public String moveFile(String source, String target, String user, List roles) {
    try {
    irm.moveFile(source, target, user, roles);
    return "Move Okay";
    } catch (RepositoryException e) {
    log.error("Move Failed", e);
    return "Move Failed: " + e.getLocalizedMessage();
    }
    }

    public String saveInternalFile(String path, String content, String type) {
    try {
    irm.saveInternalFile(content, path, type);
    return "Save Okay";
    } catch (RepositoryException e) {
    e.printStackTrace();
    return "Save Failed: " + e.getLocalizedMessage();
    }
    }

    public void removeInternalFile(String filePath) {
    try{
    irm.removeInternalFile(filePath);
    } catch(RepositoryException e) {
    log.error("Remove file failed: " + filePath);
    e.printStackTrace();
    }
    }

    public List getFiles(String type, String username, List roles) {
    try {
    return irm.getAllFiles(type, username, roles);
    } catch (RepositoryException e) {
    log.error("Get failed", e);
    }
    return null;
    }

    public void createUser(String username){
    try {
    irm.createUser(username);
    } catch (RepositoryException e) {
    log.error("Create User Failed", e);
    }
    }

    public void deleteFolder(String folder) {
    try {
    irm.deleteFolder(folder);
    } catch (RepositoryException e) {
    log.error("Delete User Failed", e);
    }
    }

    public AclEntry getACL(String object, String username, List roles) {
    return irm.getACL(object, username, roles);
    }

    public void setACL(String object, String acl, String username, List roles) {
    try {
    irm.setACL(object, acl, username, roles);
    } catch (RepositoryException e) {
    log.error("Set ACL Failed", e);
    }
    }

    public void setUserService(UserService userService) {
    this.userService = userService;
    }

    public List getInternalFilesOfFileType(String type){
    try {
    return irm.getInternalFilesOfFileType(type);
    } catch (RepositoryException e) {
    log.error("Get internal file failed", e);
    }
    return null;
    }

    public void createFileMixin(String type) throws RepositoryException {
    irm.createFileMixin(type);
    }

    public byte[] exportRepository(){
    try {
    return irm.exportRepository();

    } catch (RepositoryException e) {
        log.error("could not export repository", e);
    } catch (IOException e) {
        log.error("could not export repository IO issue", e);
    }
    return null;
    

    }

    public void restoreRepository(byte[] data) {
    try {
    irm.restoreRepository(data);
    }
    catch (Exception e){
    log.error("Could not restore export", e);
    }
    }

    public boolean hasHomeDirectory(String name) {
    try{
    Node eturn = irm.getHomeFolder(name);
    if (eturn!=null){
    return true;
    }
    return false;
    } catch (RepositoryException e) {
    log.error("could not get home directory");
    }
    return false;
    }

    public void restoreLegacyFiles(byte[] data) {
    LegacyImporter l = new LegacyImporterImpl(null);
    l.importLegacyReports(irm, data);
    }

    public Object getRepository() {
    return irm.getRepositoryObject();
    }

    public void setConfigurationpath(String configurationpath) {
    this.configurationpath = configurationpath;
    }

    public String getConfigurationpath() {
    return configurationpath;
    }

    public void setDatadir(String datadir) {
    this.datadir = datadir;
    }

    public String getDatadir() {
    return datadir;
    }

    public void setFoodmartdir(String foodmartdir) {
    this.foodmartdir = foodmartdir;
    }

    public String getFoodmartdir() {
    return foodmartdir;
    }

    public void setFoodmartschema(String foodmartschema) {
    this.foodmartschema = foodmartschema;
    }

    public String getFoodmartschema() {
    return foodmartschema;
    }

    public void setFoodmarturl(String foodmarturl) {
    this.foodmarturl = foodmarturl;
    }

    public String getFoodmarturl() {
    return foodmarturl;
    }
    }