Autowiring fails, when jars are loaded as per skinny war concept where classes involved have default accessors

荒凉一梦 提交于 2019-12-25 07:58:34

问题


Our application is based on skinny war concept( http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html ).

 .
 |-- META-INF
 |   `-- application.xml
 |-- lib
 |    -- core application jars
 |    -- spring jars
 |    -- common jar
 |-- war1-1.0.0.war
 |     --war1-jar1-1.0.0.jar
 `-- war2-1.0.0.war
 |     --war2-jar1-1.0.0.jar

We have spring jars and other core application jars loaded at application level. The common jar and the core application jars have their own applicationContext.xml. Also the wars have their own web-jars that have applicationContext.xml specific to each war. We noticed, that autowiring(in core application jar classes) failed at the application startup and we see errors as given in the logs files attached herewith.

Following are the observations:

  1. Autowiring works fine, if all the jars loaded at application level, are moved to individual wars(WEB-INF/lib).
  2. Autowiring works fine, if the classes in the core application jars have public accessors, which is default for security and encapsulation purposes.

We have to follow the skinny war concept and the core application jars cannot be modified.

来源:https://stackoverflow.com/questions/9394745/autowiring-fails-when-jars-are-loaded-as-per-skinny-war-concept-where-classes-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!