Managed Bean Property Missing - java

type: Exception report
message: description The server encountered an internal error () that prevented it from fulfilling this request.
exception: javax.servlet.ServletException: /SSCPageMapping.jsp(39,5) '#{UpdateSSCPageMap.pageMap}' Property 'pageMap' not found UpdateSSCPageMap
javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root: cause org.apache.jasper.el.JspPropertyNotFoundException: /SSCPageMapping.jsp(39,5) '#{UpdateSSCPageMap.pageMap}' Property 'pageMap' not found on type UpdateSSCPageMap
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:104)
javax.faces.component.UIData.getValue(UIData.java:614)
javax.faces.component.UIData.getDataModel(UIData.java:1129)
javax.faces.component.UIData.setRowIndex(UIData.java:451)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:77)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
javax.faces.component.UIData.encodeBegin(UIData.java:967)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:266)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:197)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
This is the HTTP 500 Error I received. A collegue and I spent about an hour troubleshooting the unmapped managed bean property that can't be found although the following is confirmed:
Verified bean property names; renamed; and verified again
faces-config.xml has proper definitions including the manage bean properties
The Java code has been checked, double checked, triple checked.
Neither of us could determine the root cause preventing the bean class from being registered with the jsp page. The jsp page was verified and it appears there is something very minor that was missed.
Within the faces-config.xml file it has highlighted that the bean properties can't be found. How is this possible?
If you can suggest any place to look for further verification I would appreciate it.

Related

HstSiteConfigurer: ComponentManager initialization failed

I'm working on One Hippo CMS, when I run the Tomcat server I'm getting this error
5.02.2019 18:23:45 ERROR main [DefaultHstSiteConfigurer.initializeComponentManager:264] HstSiteConfigurer: ComponentManager initialization failed.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.hippoecm.hst.content.beans.manager.ObjectConverter' defined in class path resource [org/hippoecm/hst/site/container/SpringComponentManager-content-beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Annotated class 'org.example.myproject.beans.Urldemo' for primarytype 'myproject:urldemo' is a duplicate of already registered class 'org.example.myproject.beans.Simple'. You might have configured a bean that does not have a annotation for the jcrType and inherits the jcrType from the bean it extends, resulting in 2 beans with the same jcrType. Correct your beans.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.1.RELEASE.jar:5.1.1.RELEASE]
Check the annotations on:
org.example.myproject.beans.Urldemo
org.example.myproject.beans.Simple
They should each have an annotation similar to:
#Node(jcrType = "project:doctype")
Each needs a unique jcrType value.

No bean named but bean is defined

I'm working on an update version of grail-oauth-plugin that support last spring-oauth
My plugin version works good and I have implemented a workin oauth2 server.
But now I want to add a custom-grant defined like this
def doWithSpring = {
myTokenGranter(MyTokenGranter)
xmlns oauth:"http://www.springframework.org/schema/security/oauth2"
oauth.'authorization-server'( /* ... many definitions here ... */){
/* ... many definitions here ... */
oauth.'custom-grant'('token-granter-ref': "myTokenGranter")
}
}
But I get an exception telling me:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'myTokenGranter'
But the bean myTokenGranter is defined as you can see. And If I remove the custom-grant definition the project starts and I can access the myTokenGranter bean.
Looking to a fullstack trace I see that the exception occur in the spring oatuh2 server bean definition parse AuthorizationServerBeanDefinitionParser.java in the line where it try to find my bean
parserContext.getRegistry().getBeanDefinition(customGranterRef);
where customGranterRef = "myTokenGranter"
so I suspect there is a bug in Spring Ouath or in Grails BeanBuilder that does not let my "myTokenGranter" to be visible in the server parser. Or making some error in grails bean definition DSL.
Thank you for your interest.
Debugging the app more deeply I have found that the problem probably is in how grails BeanBuilder work in translating namespaced spring DSL.
If I debug the point where my bean is checked (in AuthorizationServerBeanDefinitionParser.java)
at row
parserContext.getRegistry().getBeanDefinition(customGranterRef);
if I check che result of
parserContext.getRegistry().getBeanDefinitionNames()
it show me only this beans
[org.springframework.context.annotation.internalConfigurationAnnotationProcessor
org.springframework.context.annotation.internalAutowiredAnnotationProcessor
org.springframework.context.annotation.internalRequiredAnnotationProcessor
org.springframework.context.annotation.internalCommonAnnotationProcessor
org.springframework.context.annotation.internalPersistenceAnnotationProcessor
org.springframework.aop.config.internalAutoProxyCreator
org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0
org.springframework.transaction.interceptor.TransactionInterceptor#0
org.springframework.transaction.config.internalTransactionAdvisor
oauth2TokenGranter
oauth2AuthorizationCodeServices
oauth2AuthorizationRequestManager]
And not all other decleared beans...
The problem exist even if I move the ouath server declaration inside resources.xml, keeping my custom token granter bean declaration inside resources.groovy.
But the problem solves if I move the custom token bean declaration inside resources.xml.
I don't really know how the BeanBuilder DSL works, but it seems like the problem is there if there is a problem (your example works just fine in XML). Can you do it in two steps, so the bean definition for myTokenGranter is definitely available when the OAuth2 namepsace is handled?
Solved hacking Spring Security Oauth
see this commit

Spring Security LDAP Configuration BeanCreationException on app server startup

I'm trying to hook up my Spring 3.1 app to my in-house Zimbra LDAP server. I'm doing something likely very stupid and I cannot see the problem. I'm certain there could be issues with the group and user base and filter terms I defined, but that shouldn't be causing a BeanCreationException on app server startup, should it? I could use another pair of eyes...
The short version of the exception:
"Can't convert an LdapAuthenticationProvider to required type AuthenticationProvider for property providers[0]"
The full exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.config.authentication.AuthenticationManagerFactoryBean] while setting bean property 'parent'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#16': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.List' for property 'providers'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.ldap.authentication.LdapAuthenticationProvider] to required type [org.springframework.security.authentication.AuthenticationProvider] for property 'providers[0]': no matching editors or conversion strategy found
The relevant Spring configuration file entry:
<security:authentication-manager>
<security:ldap-authentication-provider
group-search-filter="member={0}"
group-search-base="ou=groups"
user-search-base="ou=people"
user-search-filter="uid={0}"
/>
</security:authentication-manager>
<security:ldap-server url="ldap://<correct IP and port>" manager-dn="uid=zimbra,cn=admins,cn=zimbra" manager-password="<private>" />
Thanks for any insights you can provide!
This looks like it is a mismatch between your included Spring libraries.
You need to make sure your Spring Security LDAP libraries match your other Spring Security library versions.
For instance:
spring-security-web-3.1.0.RELEASE.jar
spring-security-core-3.1.0.RELEASE.jar
spring-security-config-3.1.0.RELEASE.jar
spring-security-ldap-3.1.0.RELEASE.jar

Spring WebFlow Configuration problem with Validator

I am using webflow for the first time and I am trying to set up JSR-303 Bean Validation. According to the documentation:
http://static.springsource.org/spring-webflow/docs/2.3.x/reference/htmlsingle/spring-webflow-reference.html#view-validate
I need to add a validator to my flow-builder-services.
I do this and I get the following error in my source:
cvc-complex-type.3.2.2: Attribute 'validator' is not allowed to appear in element 'webflow:flow-builder-services'.
When I run the app I get the following error:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [webflowContext.xml]
Offending resource: class path resource [spring-servlet.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from class path resource [webflowContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'validator' is not allowed to appear in element 'webflow:flow-builder-services'.
It seems the flow config is set up correctly I can navigate from my welcome page to my second page in my flow just fine.
I am using Spring-3.0.5, Spring-Webflow-2.3.0
Any help would be much appreciated.
Thanks
Found the answer to this myself.
Make sure to use
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
in the declaration statement.
The manual and the ebooks I was using showed
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
Hope that helps someone.

spring #autowired

to use #autowired. in xml, i only need to included
<context:annotation-config /> ?
is there any other tag i need to put ? need to put componenet-scan ?
weird, i get error below
ERROR - ContextLoader.initWebApplicationContext(203) | Context initialization fa
iled
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'org.springframework.context.annotation.internalRequiredAnnotationProcess
or': Initialization of bean failed; nested exception is org.springframework.bean
s.InvalidPropertyException: Invalid property 'order' of bean class [org.springfr
amework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor]: No proper
ty 'order' found
Caused by:
org.springframework.beans.InvalidPropertyException: Invalid property 'order' of
bean class [org.springframework.beans.factory.annotation.RequiredAnnotationBeanP
ostProcessor]: No property 'order' found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrap
perImpl.java:376)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1105)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
The <context:annotation-config /> option was introduced in Spring 2.5. Under the covers, this creates and configures a RequiredAnnotationBeanPostProcessor, and uses the order property of that. In Spring 2.0, RequiredAnnotationBeanPostProcessor exists, but has no order property.
My guess is that you have both Spring 2.5 and 2.0 on your classpath. The copy of 2.5 would have allowed you to use <context:annotation-config />, but then it used the 2.0 copy for RequiredAnnotationBeanPostProcessor.
This looks like a class path issue. Do you mix incompatible versions of different Spring jars, or are there multiple RequiredAnnotationBeanPostProcessor classes on your classpath?
Earlier versions of that class (up to 2.0.x) did not have an order property.

Categories