Bootsfaces v1.1.1+JSF组件异常,添加OmniFaces类时提示找不到全限定类
Hey there! Let's work through this issue step by step—this error usually boils down to missing dependencies or version mismatches, so let's break it down:
1. Make sure OmniFaces is properly added to your project
Bootsfaces v1.1.1 relies on OmniFaces for resource handling, but it doesn't include OmniFaces automatically. You need to add it explicitly:
- If using Maven: Add this dependency to your
pom.xml(note: Bootsfaces v1.1.1 works best with OmniFaces 2.x versions—avoid 3.x+ since they target newer JSF versions):<dependency> <groupId>org.omnifaces</groupId> <artifactId>omnifaces</artifactId> <version>2.7</version> </dependency> - If using manual JARs: Download the correct OmniFaces 2.x JAR and drop it into your project's
WEB-INF/libfolder. Then right-click your project in Eclipse → Refresh to ensure Eclipse recognizes the new JAR.
2. Double-check your faces-config.xml configuration
Verify you've got the fully qualified class name spelled correctly—typos here are a common culprit. The correct entry should look like this:
<application> <resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler> </application>
Make sure there are no typos in the package or class name (case sensitivity matters too!).
3. Confirm version compatibility
Bootsfaces v1.1.1 is an older release, so it's critical to match it with compatible libraries:
- OmniFaces: Stick to 2.x versions (2.7 is a safe bet)
- JSF: Bootsfaces v1.1.1 supports JSF 2.0, 2.1, and 2.2—ensure your project's JSF implementation (Mojarra/MyFaces) matches one of these versions.
4. Clean and refresh your Eclipse project
Eclipse's cache can sometimes cause dependency recognition issues. Try these steps:
- Right-click your project → Maven → Update Project (if using Maven)
- Go to Project → Clean... and select your project to clear build artifacts
- Redeploy your application to the server to ensure the latest JARs are loaded
内容的提问来源于stack exchange,提问作者KontrCode

