Wildfly does not have visibility of annotated JSF classes

六眼飞鱼酱① 提交于 2020-01-25 06:50:29

问题


I'm trying to migrate an old Glassfish JEE app over to a recent LTS of Wildfly, but I've hit on a confusing issue.

The application implements JSF 2.0 and Primefaces 6, with the use of JSF/PF annotations for @ManagedBean etc.

Some of these annotated classes are in a shared dependency and include Beans, Converters, and general JSF components. Some of these are eager, or otherwise only have an access point in the JSF XHTML, usually for a conditional display or render.

With the application deployed as per the existing build (which is and has been fine on the old GF3), these sections of the page don't render and the break points in the dependencies aren't hit - in Java access points, Wildfly throws a class not found exception - it is basically as if the dependencies aren't scanned, or that they simply don't exist. They are in the deployed ear and exist in a Faces-specific JAR (separate to an EJB jar) within the lib subdirectory.

This problem can, as per investigations, be made to work (avoiding the phrase 'fixed') by any of:

  • Copying the bean into the base application from the dependency;
  • Extending the dependent class from a dummy class that exists within the base src, or;
  • Adding the classes to faces-config (either in the parent project or in the dependent JAR)

Some (one or two) of the classes only work with the 1st or 2nd option, but not the third.

Being pretty new to JBoss and Wildfly, does it sound like a configuration or module issue within my Wildfly domain? I'm using Standalone full, and have otherwise configured the rest of the application to deploy successfully - this seem to be limited to not being able to detect JSF dependencies within JARs.

The Faces JAR has an empty faces-config file within the META-INF folder to enable annotation scanning on the GF3 implementation, which is otherwise the common answer (and as per the above, it works if the config is explicitly set in the dependent faces-config, but not for scanning alone).

Does anyone have any advice - I've exhausted my testing/searches, possibly by not finding the right phrase to describe the issue!

来源:https://stackoverflow.com/questions/59742677/wildfly-does-not-have-visibility-of-annotated-jsf-classes

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