weblogic springframework TypeMismatchException 转换失败

发布于 2024-12-21 11:55:20 字数 2468 浏览 3 评论 0原文

成功部署 Web 项目后,当我尝试从浏览器访问 Web 应用程序时,出现以下错误。

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 内容:

<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>

如果有人之前遇到过同样的问题,请告诉我解决方案。我认为我不被允许更改代码,因为这应该适用于其他团队成员。

从 weblogic 配置的角度来看,我是否可能缺少任何东西,或者可能是重复的 jar 等...请告诉我是否有任何可能导致此错误的可能性?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-12-28 11:55:20

此异常中没有任何与 WebLogic 相关的内容。在您的 /WEB-INF/action-servlet.xml 文件中,您尝试设置 com.bt.custc 类型的 bean 的属性 profileAccountService .faulttracking.dao.FaultTrackingProfileAccountDAOImplcom.bt.custc.userdetails.service.UserdetailsS​​erviceImpl 的实例。该属性的类型为 com.bt.custc.profileaccountservice.service.ProfileAccountService,并且 UserdetailsS​​erviceImpl 不是 ProfileAccountService 的实现。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文