Named object resource include not found - Omnifaces + JSF 2.2.12 - jsf-2.2

I have an issue with my JSF page since I've installed Mojorra version 2.2.12 (from 2.2.8): it throws an exception when the page is loaded. The exception is: Named object: org.omnifaces.component.output.ResourceInclude not found.
I have the exact same issue with the Mojorra version 2.2.11. I don't have any problem with the version 2.2.8, 2.2.9, and 2.2.10.
Environment: Tomcat 8 + omnifaces 1.11 + jsf 2.2.12 + richfaces 4.5.4.final.
My JSF page includes a JSP fragment through the o:resourceInclude tag (it's not a design choice but rather a technical constraint I have to bear with).
Did I miss something in the configuration of omnifaces so the resourceInclude faces component can be found?
Edit:
The following problems arise when I switch to JSF 2.2.12:
The named object resourceInclude cannot be found
The omnifaces.SelectItemsConverter converter cannot be found
When a binding attribute refers to a java bean with a view scope, the said java bean cannot been found
I have removed omnifaces from the WEB-INF/lib directory, but I still have the issue #3

Related

Upgrading to Springboot 3: 'org.springframework.hateoas.server.LinkRelationProvider' that could not be found

I am upgrading my springboot app from 2.7.x to 3.0.0, I have made required changes for jakartaEE. When starting my app I am getting the below error
{"#timestamp":"2023-01-03T15:28:01.149Z","#version":"1","message":"\r\n\r\n***************************\r\nAPPLICATION
FAILED TO
START\r\n***************************\r\n\r\nDescription:\r\n\r\nParameter
1 of method collectionModelContentConverter in
org.springdoc.core.configuration.SpringDocHateoasConfiguration
required a bean of type
'org.springframework.hateoas.server.LinkRelationProvider' that could
not be found.\r\n\r\n\r\nAction:\r\n\r\nConsider defining a bean of
type 'org.springframework.hateoas.server.LinkRelationProvider' in your
configuration.\r\n","logger_name":"org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter","thread_name":"main","level":"ERROR","level_value":40000}
I am using hateos lib for representation in my app, Also I am using springdoc-openapi-starter-webmvc-ui for swagger UI.
When I disable configuration for api-docs springdoc.api-docs.enabled=false the above error go away but my swagger page is also gone, which definitely means this is not the solution.
Could someone please guide me why this bean is not getting found with springboot 3 while it was all working before with springboot2.7.x and java-11.
here is my pom.xml https://gist.github.com/bruce2019/c93a16dc20f7edb7d922b1e284f39d15
Thanks in advance
You can use springdoc-openapi-starter-webmvc-ui with 2.0.2 version
Add "/v3/api-docs/**" to mvcMatchers in WebSecurityCustomizer

Performance issue migrating from Richfaces 3.3.x to PrimeFaces 10.0.0

I'm working migrating a legacy software that use a lot of cases like <ui:repeat var="area" value="#{areaList.getResultList()}">. Where getResultList() executes a DB query. One of the problems is that when an ajax call is made, JSF at the phaseId 2 (APPLY_REQUEST_VALUES) visit all UIViewRoot children, and executes this DB queries.
The question is, there is a way to avoid this? Is correct to think when the request is an ajax type, don't visit all children. Is a JSF / JSF 2 issue or Primefices issue? The migration also include JSF 1 to JSF 2 (Mojarra)
(I have zero chance to modify the way of value is retrived)
UPDATE:
I'm using Wildfly 25.0.0 (it comes with jsf 2.3 by def) and JSF 2.1 Mojarra_2.1.29. But if you observe the stack when de ui:repeat is being accessed:
PartialViewContextImpl belong to JSF 2.3 (not mojarra_2.1.29) and there is where the original problem is, I think.
The strange is when the app starts, the log says:
INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 85) Inicializando Mojarra 2.1.29
I followed the next doc to configure a new JSF implementation on Wildfly: Link
UPDATE
I've extended UIRepeat and then solved my problem:
Thanks!

validator-class references to "xxx" that does not extend javax.faces.validator.Validator

We're using JSF 1.2 / JBoss 4.2.3 GA/ IDE JBoss Developer Studio Version: 7.1.0.GA. I'm encountering a warning message when using a validator class declared as below in the faces-config.xml.
<validator>
<validator-id>emailValidator</validator-id>
<validator-class>com.afb.dda.relanceclient.jsf.bean.EmailValidator</validator-class>
</validator>
The warning message is:
validator-class references to "com.afb.dda.relanceclient.jsf.bean.EmailValidator" that does not extend javax.faces.validator.Validator
My issue is similar as this link
http://w3facility.org/question/validator-class-references-to-myvaidator-that-does-not-extend-javax-faces-validator-validator/ I tried the suggested solution but didn't work.

UnknownSessionException when using SessionScoped CDI managed beans with Shiro managed sessions

I am developing a JSF web based application that makes use of CDI managed beans and Shiro managed sessions. The problem I've got is when a JSF page that references an object annotated with #javax.enterprise.context.SessionScoped an UnknownSessionException is thrown. I have set the logging level to finest and looking through the application server log file I can see that when the user accesses the login page a new session is created along with a cookie that sets JSESSIONID to b2b69494-2236-467f-9e0b-3c262c74b7c4. When the user accesses the page that references the SessionScoped bean the cookie is updated to have a JSESSIONID set to 49253beaee601d4107cba4b61c77, at this point an UnknownSessionException is thrown. When accessing pages that reference a managed bean annotated with either #javax.enterprise.context.ApplicationScoped or #javax.faces.view.ViewScoped everything works fine.
It appears that when accessing a page that references a session scoped bean, the servlet container is creating a new session rather than allowing the Shiro managed session to be used. If I configure Shiro to use something other than JSESSIONID then the error isn't thrown but instead two sessions appear to be created, one managed by Shiro and the other managed by the servlet container.
The contents of my shiro.ini file is
[main]
authc.loginUrl = /login.xhtml
authc.usernameParam = login:username
authc.passwordParam = login:password
authc.rememberMeParam = login:rememberMe
user.loginUrl = /login.xhtml
authc.successUrl = /app/index.xhtml
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
[users]
admin = password
[urls]
/login.xhtml = authc
/app/** = user
My environment is using Glassfish 4.1, Java EE version 7, Mojarra version 2.2.7 for JSF, Weld version 2.2.2 for CDI, and Shiro version 1.2.3. I have also reproduced the same issue on Glassfish version 4.0 albeit with earlier versions of Mojarra and Weld.
I have uploaded the relevant portion of the application server log to PasteBin which can be accessed with the URL http://pastebin.com/2sPHfdTQ
I've also created an example Maven project to demonstrate the problem. The example project can be downloaded from https://www.dropbox.com/s/1x9pe2o9ja0q9jw/TestJavaEE-web.zip?dl=0 which contains the source code and the complied war file.
Is anyone else currently using CDI managed session scoped beans with Shiro managed sessions, and if so have you had any problems?
Is there a configuration setting I've missed either in Shiro or GlassFish or is this a bug?
Note: I have previously posted this question on the Shiro mailing list but I'm yet to find a solution and I'm hoping that there will be a wider audience on StackOverflow.

MyFaces NullPointerException: state after ajax request

weeks ago we are migrating our project from JSF 1.2 to JSF 2.0 and we are already comparing MyFaces and Mojarra implementations.
I've almost done a prototype on Mojarra 2.1.7 and it works quite well, but when trying to make it work with MyFaces impl (2.1.6) it doesn't (pom modified to not mix Mojarra and MF implementations).
The fact is that when I make an ajax request it rerenders the view, but when I try to make another action with request (ajax, navigation) it does nothing.
In FireBugs, after the second action it throws this error:
<partial-response>
<error>
<error-name>java.lang.IllegalStateException</error-name>
<error-message><![CDATA[java.lang.NullPointerException: state]]></error-message>
</error>
</partial-response>
My beans are ViewScoped and I'm using Primefaces components(if it helps...), so I don't know why is the state null after first ajax request.
Anyone knows the solution?
Thanks, Carlos

Resources