У меня есть .cfm
файл со следующим кодом:метод не был найден, ColdFusion 11, CreateObject
<cfset myObj=CreateObject("java", "Test")/>
<cfset a = myObj.init() >
<cfoutput>
#a.hello()#
</cfoutput>
<cfset b = a.testJava() >
<cfoutput>
#testJava()#
</cfoutput>
Это ссылается Java
файл класса: с
public class Test
{
private int x = 0;
public Test(int x) {
this.x = x;
}
public String testJava() {
return "Hello Java!!";
}
public int hello() {
return 5;
}
}
Я получаю ошибку:
The hello method was not found.
Either there are no methods with the specified method name and argument types or the hello method is overloaded with argument types that ColdFusion cannot decipher reliably.
ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
Я пробовал много разных способов и точно выполнил документацию, here. Файл .class
- в правильном месте, потому что при удалении файла возникает ошибка FNF.
Я также попытался использовать тег cfobject
аналогичным образом без везения. Ни один из методов не найден. Есть идеи?
Coldfusion 11, исправлениях 7
Это было долгое время, так как я сделал ColdFusion, но вам не нужно передать аргумент 'myObj.init() 'для удовлетворения параметра конструктора? –
Да, я бы попробовал и без параметра, и не повезло. Это было главным образом для тестирования. – theblindprophet