• 漫步云端

    书本SpringEL和资源调用这章的案例报了错,不知道为什么堵不了配置文件,有人知道吗
    `十月 13, 2019 9:15:40 下午 org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
    信息: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@439f5b3d: startup date [Sun Oct 13 21:15:40 CST 2019]; root of context hierarchy
    十月 13, 2019 9:15:40 下午 org.springframework.context.annotation.AnnotationConfigApplicationContext refresh
    警告: Exception encountered during context initialization - cancelling refresh attempt
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.wisely.highlight_spring4.ch2.el.ElConfig]; nested exception is j**a.io.FileNotFoundException: class path resource [com/wisely/highlight_spring4/ch2/el/test.properties] cannot be opened because it does not exist

    `

    漫步云端发表于 2019/10/13 21:27:48
    • 漫步云端

      已解决

      漫步云端发表于 2019/10/13 22:04:29
  • 漫步云端

    书本SpringEL和资源调用这章的案例报了错,不知道为什么堵不了配置文件,有人知道吗
    `十月 13, 2019 9:15:40 下午 org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
    信息: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@439f5b3d: startup date [Sun Oct 13 21:15:40 CST 2019]; root of context hierarchy
    十月 13, 2019 9:15:40 下午 org.springframework.context.annotation.AnnotationConfigApplicationContext refresh
    警告: Exception encountered during context initialization - cancelling refresh attempt
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.wisely.highlight_spring4.ch2.el.ElConfig]; nested exception is j**a.io.FileNotFoundException: class path resource [com/wisely/highlight_spring4/ch2/el/test.properties] cannot be opened because it does not exist

    `

    漫步云端发表于 2019/10/13 21:27:47
  • 菜鸟先飞

    老师好,萌新求救,这项目怎么跑起来highlight_springmvc4,用的sts,开始是自己在pom.xml加上
    ,在做第94页操作中,访问
    发现error.jsp是访问不到的,看配置是这样的

    而目录结构是这样

    这个要怎么改动才能正确运行呢?困扰许久,期望相助,不胜感谢

    菜鸟先飞发表于 2019/10/3 11:56:39
  • dengweiqiang

    第61页的WiselyConfiguration注解的value属性需要加上“@AliasFor(annotation = ComponentScan.class, attribute = “value”)”这一段才能覆盖ComponentScan注解上的字段。
    虽然按照书中代码执行无报错,但不报错原因是ComponentScan注解会自动扫描启动类当前包及其子包下面的类,而不是因为我们传输的value值。
    问题复现可以通过换一个启动类包下除外的其他包传入,会报类找不异常。@汪云飞老师

    dengweiqiang发表于 2019/10/1 18:11:55
  • 菜鸟先飞

    3.11项目运行时出错的

    九月 28, 2019 8:45:48 下午 org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
    信息: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1f17ae12: startup date [Sat Sep 28 20:45:48 CST 2019]; root of context hierarchy
    Exception in thread “main” org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wisely.highlight_spring4.ch3.aware.AwareService] is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.j**a:371)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.j**a:331)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.j**a:968)
    at com.wisely.highlight_spring4.ch3.aware.Main.main(Main.j**a:11)

    菜鸟先飞发表于 2019/9/28 20:50:47
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • ...
  • 14