cancel
Showing results for 
Search instead for 
Did you mean: 

Hybris Upgrade 1808 to 2011 issue

pritika_gupta26
Explorer
0 Kudos

Getting the below issue while upgrading from Hybris 1808 to 2011 version.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#2': Cannot resolve reference to bean 'metadataGeneratorFilter' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metadataGeneratorFilter' defined in ServletContext resource [/WEB-INF/security/spring-security-config.xml]: Cannot create inner bean 'org.springframework.security.saml.metadata.MetadataGenerator#76048930' of type [org.springframework.security.saml.metadata.MetadataGenerator] while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.saml.metadata.MetadataGenerator#76048930': Unsatisfied dependency expressed through method 'setSamlEntryPoint' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'samlEntryPoint': Unsatisfied dependency expressed through method 'setMetadata' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'metadata' defined in ServletContext resource [/WEB-INF/security/spring-security-config.xml]: Cannot create inner bean 'org.springframework.security.saml.metadata.ExtendedMetadataDelegate#719a2d6c' of type [org.springframework.security.saml.metadata.ExtendedMetadataDelegate] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.saml.metadata.ExtendedMetadataDelegate#719a2d6c' defined in ServletContext resource [/WEB-INF/security/spring-security-config.xml]: Cannot create inner bean 'org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider#3d6a4f43' of type [org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider#3d6a4f43' defined in ServletContext resource [/WEB-INF/security/spring-security-config.xml]: Error converting typed String value for constructor argument; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.io.File'; nested exception is java.lang.IllegalArgumentException: Could not retrieve file for class path resource [security/metadata-non_prod.xml]: class path resource [security/metadata-non_prod.xml] cannot be resolved to URL because it does not exist

Slava
Advisor
Advisor

I don't think security/metadata-non_prod.xml is a Hybris file. Has customer customized the spring-security-config.xml? Search 1808 for metadata-non_prod.xml, see where it's present. Analyze whether it's a custom file or not. Double-check upgrade steps for all version in between 1808 and 2011 to make sure nothing is missed.

View Entire Topic
amitpanwar
Advisor
Advisor
0 Kudos

Hi Pritika,

With an upgrade the attribute definition for the metadata file is changed from the string path to the reference of the file object. This is explained from the logs you posted as:

Failed to convert value of type 'java.lang.String' to required type 'java.io.File

I would advise you to find the property or place where you are referring to the path security/metadata-non_prod.xml

Then you can look for it's bean configuration in the respective spring-security-config.xml file this should have a value something like:

<value>${sso.metadata.location:./WEB-INF/security/metadata.xml}</value>

you should change it to something like this:
<value type="java.io.File">${sso.metadata.location:./WEB-INF/security/metadata.xml}</value>