[WireBox 1.6.0] Wirebox standalone installation instruction

Hi,

I want test some application using wirebox as Dipendencies Injection.

I have downloaded wirebox standalone and placed it in the root of my webapp:

E:\railo\tomcat\webapps\myApp\wirebox

I have created an application.cfc very simple just to test installation:

component displayname="Application" output="true" hint="Handle the application." { function OnApplicationStart(){ wirebox = createObject("component","wirebox.system.ioc.Injector").init(); }; } }

if I dump application scope it shows my wirebox object.

Now I would like to make some test of DI, but when I try to inject I cannot access methods injected. This is my Client.cfc:

`

component displayname=“Client” accessors=“true” singleton
{

public function init(t){
return this;

}

public function lookup(){
string = LCase(object);
}
}

`

And this is my Whois.cfc:

`

component displayname=“Whois” accessors=“true” singleton
{
property name=“client” inject=“id:Client”;

function init(){
return this;

}

function query(object){
//do something…
}
}

`

If I dump a whois.cfc I got

Propertiesclient

Empty:null

What setting I’m missing?

How are you retrieving it

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Not sure what are you asking…I’ve never used wirebox standalone.

My application structure:

+myApp -Application.cfc -Whois.cfc +wirebox +Whois -Client.cfc

I have simply instantiate wirebox on onApplicationStart(). Really don’t know if I should use a Binder.cfc to make some settings…

I mean, how are you requesting for objects

signature0.jpg

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 have this simple code just to check if object is injected:

`

w = createObject(“component”,“Whois”);
w.init;
writeDump(w);

`

Well, that’s your problem.

You cannot use the CF create or new if you want DI. Remember you need to talk to WireBox now for objects.

application.wirebox.getInstance( “Whois” );

signature0.jpg

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 have tried also this approache, but when I try to execute:

`
whois = application.wirebox.getInstance(“whois”);

`

I got this error:

Railo 4.0.4.001 Error (Builder.DSLDependencyNotFoundException)MessageThe DSL Definition {ref={null}, scope={variables}, dsl={model}, argName={}, name={owner}, value={null}, javaCast={null}, required={false}} did not produce any resulting dependencyDetailThe target requesting the dependency is: 'whois.client’StacktraceThe Error Occurred in
E:\railo\tomcat\webapps\whois\wirebox\system\core\util\Util.cfc: line 164

162:
163:
164:
165:
166:

called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc: line 361
called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc: line 218
called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc: line 100
called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc: line 286
called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\scopes\Singleton.cfc: line 49
called fromE:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc: line 260
called fromE:\railo\tomcat\webapps\whois\index.cfm: line 11
Java StacktraceThe DSL Definition {ref={null}, scope={variables}, dsl={model}, argName={}, name={owner}, value={null}, javaCast={null}, required={false}} did not produce any resulting dependency
at railo.runtime.tag.Throw._doStartTag(Throw.java:189):189
at railo.runtime.tag.Throw.doStartTag(Throw.java:178):178
at wirebox.system.core.util.util_cfc$cf._1(E:\railo\tomcat\webapps\whois\wirebox\system\core\util\Util.cfc:164):164
at wirebox.system.core.util.util_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\core\util\Util.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:275):275
at railo.runtime.ComponentImpl._call(ComponentImpl.java:608):608
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1800):1800
at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:749):749
at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1521):1521
at wirebox.system.ioc.builder_cfc$cf._2(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc:361):361
at wirebox.system.ioc.builder_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:775):775
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at wirebox.system.ioc.builder_cfc$cf._1(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc:218):218
at wirebox.system.ioc.builder_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:775):775
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at wirebox.system.ioc.builder_cfc$cf._1(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc:100):100
at wirebox.system.ioc.builder_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Builder.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at wirebox.system.ioc.injector_cfc$cf._1(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc:286):286
at wirebox.system.ioc.injector_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at wirebox.system.ioc.scopes.singleton_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\scopes\Singleton.cfc:49):49
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at wirebox.system.ioc.injector_cfc$cf._1(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc:260):260
at wirebox.system.ioc.injector_cfc$cf.udfCall(E:\railo\tomcat\webapps\whois\wirebox\system\ioc\Injector.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at index_cfm$cf.call(E:\railo\tomcat\webapps\whois\index.cfm:11):11
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:802):802
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:754):754
at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:183):183
at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2255):2255
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2222):2222
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:315):315
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99
at mod_cfml.core.invoke(core.java:131):131
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936):936
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407):407
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004):1004
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source):-1
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1
at java.lang.Thread.run(Unknown Source):-1