weblogic springframework TypeMismatchException failed to convert

400 Views Asked by At

After Successful deployment of web project, I am getting the following error when I tried to access the web application from browser.

2011-12-17 17:37:52.887  AdminServer <consumerFaultTracking> [-] ERROR Context initialization failed : org.springframework.web.struts.ContextLoaderPlugIn-(228) 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.bt.custc.faulttracking.dao.FaultTrackingProfileAccountDAOImpl#e71be2' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.bt.custc.userdetails.service.UserdetailsServiceImpl] to required type [com.bt.custc.profileaccountservice.service.ProfileAccountService] for property 'profileAccountService']
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.bt.custc.userdetails.service.UserdetailsServiceImpl] to required type [com.bt.custc.profileaccountservice.service.ProfileAccountService] for property 'profileAccountService'
    at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:1103)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:848)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:733)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:890)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:917)    

action-servlet.xml content :

<property name="accountService">
    <bean class="com.bt.custc.faulttracking.service.FaultTrackingProfileAccountServiceImpl">
        <property name="profileAccountDAO">
            <bean class="com.bt.custc.faulttracking.dao.FaultTrackingProfileAccountDAOImpl">
                <property name="profileAccountService">
                    <ref bean="profileAccountServiceImplRefBean" />
                </property>
            </bean>
        </property>
    </bean>
</property>

Please let me know the resolution if anyone has faced the same issue earlier. I do not think I am allowed to make the code changes as this is supposedly working for other team members.

Is there anything which I might be missing from weblogic configuration point of view or may be duplicate jars etc... Please enlighten me if there would be any such possibilities which could lead to this error?

1

There are 1 best solutions below

3
On

There is nothing related to WebLogic in this exception. In your /WEB-INF/action-servlet.xml file, you're trying to set the property profileAccountService of a bean of type com.bt.custc.faulttracking.dao.FaultTrackingProfileAccountDAOImpl to an instance of com.bt.custc.userdetails.service.UserdetailsServiceImpl. The property is of type com.bt.custc.profileaccountservice.service.ProfileAccountService, and UserdetailsServiceImpl is not an implementation of ProfileAccountService.