Spring beans not getting created as required by myfaces

落爺英雄遲暮 提交于 2019-12-25 01:48:55

问题


We are migrating application from weblogic to jboss,

In this Spring Myfaces applications, in jboss, while loading xhtml page managed bean defined in spring and faces config xmls are not creating the beans which results in null pointer exception while application is trying to load xhtml page.

In spring applicationcontext config xml, following entry is there to scan the packages

<context:component-scan base-package="com.thehartford.pi.sales.web.controller.auto.*" >
                            <context:include-filter type="annotation" expression="com.thehartford.pi.sales.web.common.annotations.Controller"/>
            </context:component-scan>
            <context:component-scan base-package="com.thehartford.pi.sales.web.controller.home.*" >
                            <context:include-filter type="annotation" expression="com.thehartford.pi.sales.web.common.annotations.Controller"/>
            </context:component-scan>

com.thehartford.pi.sales.web.common.annotations.Controller => This controller has following annotations

 @Component
@Scope("request")
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Controller {

    public static final String EMPTY_STRING = "";

    String value() default EMPTY_STRING;
}

In Weblogic, this include is helping to create beans required by myfaces config xml available in following packages

<context:include-filter type="annotation" expression="com.thehartford.pi.sales.web.common.annotations.Controller"/>

whereas in jboss these annotations are not getting ingested to controller available in those packages causing null pointer exception. This is getting resolved on explicitly including these annotations in all class defined in those packages.

Please help me understand why following filter is not working in jboss

<context:include-filter type="annotation" expression="com.thehartford.pi.sales.web.common.annotations.Controller"/>

来源:https://stackoverflow.com/questions/53947922/spring-beans-not-getting-created-as-required-by-myfaces

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