2013-11-04 19 views
8

Tôi đang theo dõi video hướng dẫn tuyệt vời của Mike Kelly nhưng tôi đã bị bối rối bởi vấn đề sau. Nó xảy ra khi tôi thêm một lớp miền mới. Tôi đã thử sao lưu các thay đổi và thêm DomainClass với một tên khác, khởi động lại IDE, v.v. Chỉ với một Lớp Miền tôi không có lỗi, nếu tôi thêm một lỗi xuất hiện.Quá tải phương thức mơ hồ cho phương pháp grails.spring.BeanBuilder # registerBeans

Tôi đang làm việc với ggts 3.4.0, Grail 2.3.1, JDK 1.7.0_45.

| Error 2013-11-04 21:56:37,442 [Thread-8] ERROR plugins.AbstractGrailsPluginManager - Plugin [domainClass:2.3.1] could not reload changes to file [C:\Grails\ProjectTracker\grails-app\domain\projecttracker\EndUser.groovy]: Ambiguous method overloading for method grails.spring.BeanBuilder#registerBeans. 
Cannot resolve which method to invoke for [null] due to overlapping prototypes between: 
    [interface org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration] 
    [interface org.springframework.beans.factory.support.BeanDefinitionRegistry] 
Message: Ambiguous method overloading for method grails.spring.BeanBuilder#registerBeans. 
Cannot resolve which method to invoke for [null] due to overlapping prototypes between: 
    [interface org.codehaus.groovy.grails.commons.spring.RuntimeSpringConfiguration] 
    [interface org.springframework.beans.factory.support.BeanDefinitionRegistry] 
    Line | Method 
->> 2980 | chooseMostSpecificParams  in groovy.lang.MetaClassImpl 

Trả lời

0

Bạn có thể ghi đè lên các phương pháp mơ hồ khi đi qua null để tham số của nó

MyClass.metaClass.myAmbiguousMethod = {def param -> 
    if(param != null){ 
     myAmbiguousMethod(param) 
    } else{ 
     null 
    } 
} 
-1

tôi có thể tái sản xuất này trong grails 3.2.4 bằng cách cung cấp một tuyên bố render invalidVariable. Đối số không hợp lệ cho render có thể gây ra điều này từ những gì tôi có thể nói

+0

Bạn có thể giải thích câu trả lời của mình không? Điều này trông giống như một bình luận về câu hỏi không phải là câu trả lời. – soundslikeodd

Các vấn đề liên quan