Error message

I getting the error message when try to run the function. the init method does exists

Error Messages: The init method was not found.
Either there are no methods with the specified method name and argument types or the init 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.

Why do you not provide an example of how your using this along with the stack trace, sounds like user error or bad code to me.

here is my stack trace

coldfusion.runtime.java.MethodSelectionException: The init method was not found.
	at coldfusion.runtime.java.ObjectHandler.findMethodUsingCFMLRules(ObjectHandler.java:383)
	at coldfusion.runtime.StructBean.invoke(StructBean.java:524)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393)
	at cfehStdGroup2ecfc1699648177$funcDSPCREATERELATIONSHIPFILTER.runFunction(C:\ColdFusion9\wwwroot\handlers\ehStd.cfc:1973)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
	at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:389)
	at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2723)
	at cfController2ecfc2098540281$funcINVOKER.runFunction(C:\ColdFusion9\wwwroot\demo\coldbox\system\web\Controller.cfc:699)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
	at cfController2ecfc2098540281$funcRUNEVENT.runFunction(C:\ColdFusion9\wwwroot\demo\coldbox\system\web\Controller.cfc:584)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
	at cfColdbox2ecfc178485846$funcPROCESSCOLDBOXREQUEST.runFunction(C:\ColdFusion9\wwwroot\demo\coldbox\system\Coldbox.cfc:236)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
	at cfApplication2ecfc750003693$funcONREQUESTSTART.runFunction(C:\ColdFusion9\wwwroot\demo\Application.cfc:80)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
	at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88)
	at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:258)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:349)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
	at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
	at coldfusion.CfmServlet.service(CfmServlet.java:200)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
	at jrun.servlet.FilterChain.service(FilterChain.java:101)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
	at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
	at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
	at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

And here how am using it

rc.bean = stdDefinition.init();

See user error!!!

When you do

The component is instantiated and stored into the variable stdDefinition, now if you have an init method that passes arguments then you will need to bind / map this into wirebox so that it is correctly handled.

And why anyone would after instantiation call the init method again is beyond me, what is you reasoning or what are you trying to achieve by doing that?

in my wirebox I do the wiring like this mapDirectory(“shared.model”); Besides that all other handlers working just fine

if rigth away i do fwreinit it works just fine and when i come back to this page i get the same error again

Any updates on this issue

Is this the code:

rc.bean = stdDefinition.init();

Where is the init() method being done?
Also, the model does the constructor for you, so not sure what you are trying to accomplish

it done right here rc.bean = stdDefinition.init();

All i am trying to do is to initialize the Bean

I understand, but where are you trying to do this?

When you inject an object, the object is constructed by the DI framework and it calls the constructor for you. What you need is more of a transient object instead of injection.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I ma trying to do this in the handler

Erik, it has been made perfectly clear to you that you DO NOT NEED TO DO THIS

rc.bean = stdDefinition.init();

That line of code is saying you want to initialise this and create it, but when you do this

It is initiated and created…

WHAT PART OF THIS DO YOU NOT UNDERSTAND?

If you can’t be bothered to read emails or do the most basic debugging to figure it out, you are going to find yourself in your own world where people are going to ignore you.

Now if you don’t understand what is being said SAY SOMETHING, we will not bite… But we will bight if you ignore our advice and continue asking sill questions when the fault is clearly how your approaching your problem.

If you don’t understand the DI or wireBox now is the time to put your hand and say something, or go back to the docs where you had been pointed once in another thread.

I’ve read the whole email and i do understand the wirebox it just if i want to assign the bean to the variable and have multiple assignments to the same bean i want to use variable . besides that i have about 20 different handlers and they all working that way and no problem it only this causing an issue

Then you don’t understand wirebox, because if you did then you would understand what you you just stated.

Now when you say multiple assignments, what do you mean by that?

By asking that question, you may understand the solution you required to do to get this to work. But by calling the init() method is obviously your problem. Either your component doesn’t have an init() method or it does but you are not passing the required arguments.

Which brings me back to your original problem, user error.

here is my function . the bean stdDefinition have init function

var rc = event.getCollection();

rc.bean = stdDefinition.init();

if (structkeyExists(rc,“stdID”) && len(rc. stdID)) {

stdGroupRelationship = stdGateway.getByAttributes( stdID = rc. stdID );

rc.bean.setstdGroupRelationshipDefinitionID(stdGroupRelationship. stdRID );
rc.bean.setstdGroupID(stdGroupRelationship. stdID );
rc.bean.setisPrimary(stdGroupRelationship.isPrimary);
rc.bean.setrelationshipDefinitionID(stdGroupRelationship.relationshipDefinitionID);
rc.bean.setrelationshipRule(stdGroupRelationship.relationshipRule);
rc.bean.setlogicRule(stdGroupRelationship.logicRule);
rc.bean.setincludeRule(stdGroupRelationship.includeRule);

}

Erik it is very clear what the error message is…

rc.bean = stdDefinition.init();

The above line is extremely bad code on your part because you don’t understand the difference between transient and singleton, again if you insist on ignoring us then I am not going to answer any more of your emails from this point on.

What you need is a transient object, but it sounds like this is what you have.

As you have not given us the stdDefinition we are still left to wonder if you have arguments for your init, because that is what your error message is telling you, that is basic 101 ColdFusion error message that is not ColdBox or WireBox related.

So be warned, Luis even told you that you need transient objects for your wirebox, I have told what more do you want us to do?

Please remove your stdDefinition.init() have a think about what wireBox does and how it works for you, and then think about having a transient object that will do what you need it to do.

If however your object is in a state that needs to be loaded each and every time then, for what reason I can’t think of any good enough reason where a transient object would not surfice, unless your component is badly written to begin with.

Then you might need to remove the DI property and just use the new operator or createobject, and go back to old school.

But as we are trying to help you with your original question, I made it very clear that either you have not init function or your init function requires arguments, that is what your original error message is telling you, and basic debugging on your part would have solved that for you.

The init method does exists

variables.stdGroupRelationshipDefinitionID = ""; variables.stdGroupID = ""; variables.isPrimary = ""; variables.relationshipDefinitionID = ""; variables.relationshipRule = ""; variables.logicRule = ""; variables.includeRule = ""; setstdGroupRelationshipDefinitionID(arguments.astdGroupRelationshipDefinitionID); setstdGroupID(arguments.astdGroupID); setisPrimary(arguments.aisPrimary); setrelationshipDefinitionID(arguments.arelationshipDefinitionID); setrelationshipRule(arguments.arelationshipRule); setlogicRule(arguments.alogicRule); setincludeRule(arguments.aincludeRule);

Erik…

Consider this my last message to you, I will no longer provide help to you any more… I have told you what the problem is, not once, not twice but three times. By submitting the code you have confirmed everything that I have told you.

You have refused to listen to or even read what I have told you. So no more, I am not going to get into a long debate of back and forth of messages, when you have been told numerous times what the problem is.

SO FOR THE LAST TIME THE ERROR MESSAGE IS A SIMPLE COLDFUSION ERROR MESSAGE WHERE YOU ARE TRYING TO CALL A NON EXISTENT METHOD OR THE METHOD REQUIRES ARGUMENTS TO BE PASSED… WHAT PART OF THAT DO YOU NOT UNDERSTAND?

Hi Andrew I understand your frustration , but believe me I am frustrated as much as you do. I do have the init function but keep throwing me that error message