由于jar 包冲突项目经常起不来,刚刚重新配置了jar包出现 异常。一上午了都没有解决。
哪位高手帮帮忙,在线等啊。nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
0 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@9ed927 via org.mortbay.log.Slf4jLog
328 [main] INFO org.mortbay.log - jetty 6.0.0rc0
609 [main] INFO / - Initializing Spring root WebApplicationContext
609 [main] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
656 [main] INFO org.springframework.web.context.support.XmlWebApplicationContext - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@120bf2c: display name [Root WebApplicationContext]; startup date [Mon Dec 28 11:15:35 CST 2009]; root of context hierarchy
750 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
968 [main] INFO org.springframework.web.context.support.XmlWebApplicationContext - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@120bf2c]: org.springframework.beans.factory.support.DefaultListableBeanFactory@491c4c
1250 [main] INFO org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from ServletContext resource [/WEB-INF/data-access.properties]
1312 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@491c4c: defining beans [emailEnterParameter,emailSender,propertyConfigurer,transactionManager,sessionFactory,dataSource,productDao,productCategoryDao,productClassDao,productBenefitDao,productUsageDao,productSalesDao,productCustomerCaseDao,newsDao,infoIndexDao,dataDao,introduceDao,faqDao,branchDao,comDataDao,jobDao,careerDao,messageBoardDao,sysusertbDao,syspurviewtbDao,asiaTourAwardDao,webStaticDao,environDao,almsdeedDao,managementTeamDao,bicycleDao,nutritionDao,sponsorshipDao,nutritionArticleDao,promotionDao,awardsDao,downloadDao,sqlDao,productManager,productCategoryManager,productClassManager,productBenefitManager,productUsageManager,productSalesManager,productCustomerCaseManager,newsManager,introduceManager,faqManager,branchManager,dataManager,infoIndexManager,comDataManager,jobManager,careerManager,messageBoardManager,sysusertbManager,syspurviewtbManager,asiaTourAwardManager,webStaticManager,environManager,almsdeedManager,managementTeamManager,bicycleManager,nutritionManager,sponsorshipManager,nutritionArticleManager,promotionManager,awardsManager,downloadManager,facade]; root of factory hierarchy
1937 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@491c4c: defining beans [emailEnterParameter,emailSender,propertyConfigurer,transactionManager,sessionFactory,dataSource,productDao,productCategoryDao,productClassDao,productBenefitDao,productUsageDao,productSalesDao,productCustomerCaseDao,newsDao,infoIndexDao,dataDao,introduceDao,faqDao,branchDao,comDataDao,jobDao,careerDao,messageBoardDao,sysusertbDao,syspurviewtbDao,asiaTourAwardDao,webStaticDao,environDao,almsdeedDao,managementTeamDao,bicycleDao,nutritionDao,sponsorshipDao,nutritionArticleDao,promotionDao,awardsDao,downloadDao,sqlDao,productManager,productCategoryManager,productClassManager,productBenefitManager,productUsageManager,productSalesManager,productCustomerCaseManager,newsManager,introduceManager,faqManager,branchManager,dataManager,infoIndexManager,comDataManager,jobManager,careerManager,messageBoardManager,sysusertbManager,syspurviewtbManager,asiaTourAwardManager,webStaticManager,environManager,almsdeedManager,managementTeamManager,bicycleManager,nutritionManager,sponsorshipManager,nutritionArticleManager,promotionManager,awardsManager,downloadManager,facade]; root of factory hierarchy
1937 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:83)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:320)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:304)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:192)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:835)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1073)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:835)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)

解决方案 »

  1.   

    我经常用的DOS指令:
    @echo off
    for /l %%i in (1,1,20) do @echo 正在清理asm-2.2.3.jar,请稍等......|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\asm-2.2.3.jar|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\asm.jar|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\asm-attrs.jar|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\asm-commons-2.2.3.jar|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\asm-util-2.2.3.jar|del /f /s /q  E:\edwin\.metadata\.me_tcat\webapps\edwin\WEB-INF\lib\cglib-2.1.3.jar|echo 清理asm-2.2.3.jar完成!|echo. & pause
      

  2.   

    ApplicationContext.xml  文件中的配置。 <bean id="emailSender" class="com.herbalife.email.SimpleEmailSender" autowire="byName"></bean> <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
    <list>
    <value>WEB-INF/data-access.properties</value>
    </list>
    </property>
    <property name="order" value="1" />
    </bean> <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean> <!-- =================================
    Hibernate
    ================================= -->
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configurationClass"
    value="${hibernate.configurationClass}" />
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingLocations"
    value="classpath:hbms/*.hbm.xml" />
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    ${hibernate.dialect}
    </prop>
    <prop key="hibernate.hbm2ddl.auto">
    ${hibernate.hbm2ddl.auto}
    </prop>
    <prop key="hibernate.show_sql">
    ${hibernate.show_sql}
    </prop>
    <prop key="hibernate.cache.use_query_cache">
    ${hibernate.cache.use_query_cache}
    </prop>
    <prop key="hibernate.cache.provider_class">
    ${hibernate.cache.provider_class}
    </prop>
    </props>
    </property> <property name="namingStrategy">
    <bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
    </property>
    </bean> <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName"
    value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
    </bean>
      

  3.   

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
    Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.springframework.core.io.Resource[]] for property 'mappingLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
    Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:hbms/*.hbm.xml]: class path resource [hbms/] cannot be resolved to URL because it does not exist
        at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor

      看这三个错误~~
      全部是配置文件出错的。
      

  4.   

      我标的你在看看。。
        我还没研究Spring
      

  5.   

    谢谢APOLLO_TS  是正解。那个好了 ,这个又来了。 servlet-api-2.4.jar 和jsp-api-2.0.jar 我都加进来了。可是还报错。java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
    at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:572)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:179)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:116)
    at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:335)
    at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
      

  6.   

    问题解决了,APOLLO_TS  是正解。 
    后来的java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
    是由于 jetty 引起的,myEclipse-->Project-->clean  就OK了。
      

  7.   

    TzSword  辛苦了。没有功劳也有苦劳。刚刚给分时没看清楚。