Grails, Constructor Injection, and Spring Bean Builders

Had a run-in with Grails and trying to wire up some custom beans using Grails’s Spring Bean Builder DSL mechanism. I was wiring up an instance of the Apache HttpClient object, which can be constructed with HttpClientParams and/or HttpConnectionManager. Now the Grails BB syntax expects the first argument to be the type you’re wiring, followed by the parameters to pass into the constructor. Something like this:
httpClient(org.apache.commons.httpclient.HttpClient, defaultGlobalHttpConnectionManager)

Where httpClient is the bean name/id, org.apache.commons.httpclient.HttpClient is the type we’re wiring, and defaultGlobalHttpConnectionManager is some custom implementation of the HttpConnectionManager.

When using this Bean Builder syntax, Grails gets consfused about the argument ordering and is unable to create its Grails Application Context. I also tried the following which didn’t work either.
httpClient(org.apache.commons.httpclient.HttpClient, null,
defaultGlobalHttpConnectionManager)

I don’t know if you can explicitly set the arguments the same way you can in the standard XML wiring approach. My solution was then to use the tried and true method.

<bean id="defaultGlobalHttpConnectionManager"
class="com.site.commons.http.GlobalHttpConnectionManager"
destroy-method="shutDown" lazy-init="default" autowire="default"
dependency-check="default">
<property name="soTimeout">
<value>20000</value>
</property>
<property name="connectionTimeout">
<value>20000</value >
</property>
</bean>


<bean id="httpClient"
class="org.apache.commons.httpclient.HttpClient" lazy-init="default"
autowire="default"
dependency-check="default">
<constructor-arg ref="defaultGlobalHttpConnectionManager" />
</bean>

Resources:
http://grails.org/doc/1.0.x/
http://hc.apache.org/httpclient-3.x/apidocs/index.html

Tags: ,

186 Responses to “Grails, Constructor Injection, and Spring Bean Builders”

  1. THEODORE Says:


    MedicamentSpot.com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. High quality drugs. Buy pills online

    Buy:Viagra.Cialis Soft Tabs.Levitra.Soma.Super Active ED Pack.Viagra Super Active+.Propecia.Viagra Professional.Cialis Professional.Cialis.Zithromax.VPXL.Tramadol.Cialis Super Active+.Maxaman.Viagra Soft Tabs.Viagra Super Force….

  2. atx26t Says:

    AT&T http://shewlettozipasb.05KIAPARTS.US/tag/AT&T+Help+atx26t+tilt/ : AT&T…

    tilt…

  3. DARYL Says:


    CheapTabletsOnline.Com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. No prescription drugs. Buy pills online

    Buy:Viagra Super Force.Viagra Professional.Cialis Professional.Viagra Soft Tabs.Cialis Soft Tabs.Soma.Super Active ED Pack.VPXL.Propecia.Cialis Super Active+.Viagra.Maxaman.Tramadol.Levitra.Zithromax.Cialis.Viagra Super Active+….

  4. HECTOR Says:


    NEW FASHION store. Original designers collection at low prices!!! 20 % TO 70 % OFF. END OF SEASON SALE!!!

    BUY FASHION. TOP BRANDS: GUCCI, DOLCE&GABBANA, BURBERRY, DIESEL, ICEBERG, ROBERTO CAVALLI, EMPORIO ARMANI, VERSACE…

  5. EVAN Says:

    ████████►BUY VIAGRA◀███████…

    ████████▲▲▲▲▲▲▲▲▲████████…

  6. JESUS Says:

    ████████►BUY VIAGRA◀███████…

    ████████▲▲▲▲▲▲▲▲▲████████…

  7. CHARLIE Says:

    ████████►BUY CIALIS◀████████…

    ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲…

  8. RICARDO Says:

    fosamax@actonel.now” rel=”nofollow”>.

    Buynow…

  9. RALPH Says:

    Aleve@official.site” rel=”nofollow”>..

    Buyit now…

  10. CHRISTIAN Says:

    Avelox@official.site” rel=”nofollow”>…

    Buyno prescription…

  11. BRETT Says:

    Buynow it…

  12. RONALD Says:

    Depakote@official.site” rel=”nofollow”>.

    Buygeneric drugs…

  13. DENNIS Says:

    Depakote@official.site” rel=”nofollow”>.

    Buygeneric drugs…

  14. EDWARD Says:

    zyban pill

    Buywithout prescription…

  15. ROLAND Says:

    xeloda information.gov

    Buyit now…

  16. ARTHUR Says:

    other names for trazodone

    Buyno prescription…

  17. VIRGIL Says:

    Zetia

    Buyno prescription…

  18. NICHOLAS Says:

    Zelnorm

    Buygeneric pills…

  19. LONNIE Says:

    quinapril

    Buyit now…

  20. NEIL Says:

    Zocor

    Buygeneric drugs…

  21. KARL Says:

    Vitamin B

    Buydrugs without prescription…

  22. REX Says:

    Lexapro

    Buygeneric drugs…

  23. ALEX Says:

    arthritis orlistat

    Buyno prescription…

  24. RAFAEL Says:

    Eye Drops

    Buynow…

  25. STEVEN Says:

    Risperdal

    Buygeneric meds…

  26. ELMER Says:

    Rogaine

    Buygeneric meds…

  27. RICARDO Says:

    Seroquel

    Buygeneric drugs…

  28. OTIS Says:

    how much benadryl to take with zyrtec

    Buydrugs without prescription…

  29. CHARLIE Says:

    lamictal with pamelor

    Buygeneric pills…

  30. CLIFTON Says:

    Paxil

    Buygeneric drugs…

  31. JONATHAN Says:

    Pulmicort@Pulmicort.Pulmicort” rel=”nofollow”>.

    Buynow it…

  32. JULIO Says:

    Synthroid@Synthroid.Synthroid” rel=”nofollow”>.

    Buynow it…

  33. WARREN Says:

    Purim@Purim.Purim” rel=”nofollow”>..

    Buynow…

  34. JULIAN Says:

    SleepWell@SleepWell.SleepWell” rel=”nofollow”>…

    Buynow…

  35. PAUL Says:

    symbicort@official.us.website” rel=”nofollow”>…

    Buygeneric drugs…

  36. RICKY Says:

    Seroquel@Seroquel.Seroquel” rel=”nofollow”>..

    Buynow it…

  37. WILLIE Says:

    Coumadin@Coumadin.Coumadin” rel=”nofollow”>.

    Buyno prescription…

  38. MORRIS Says:

    Synthroid@Synthroid.Synthroid” rel=”nofollow”>.

    Buynow…

  39. WILLARD Says:

    Seroquel@Seroquel.Seroquel” rel=”nofollow”>..

    Buywithout prescription…

  40. FRANKLIN Says:

    .

    Buygeneric pills…

  41. JORDAN Says:

    .

    Buynow…

  42. DONALD Says:

    Buywithout prescription…

  43. RAFAEL Says:

    pyridium@can.cause.low.blood.sugar” rel=”nofollow”>.

    Buygeneric drugs…

  44. LEE Says:

    reglan@black.box” rel=”nofollow”>…

    Buydrugs without prescription…

  45. ARNOLD Says:

    cipro@causes.problems” rel=”nofollow”>.

    Buygeneric drugs…

  46. GEORGE Says:

    .

    Buyno prescription…

  47. EVERETT Says:

    otc@nasonex.alternative” rel=”nofollow”>…

    Buynow…

  48. STANLEY Says:

    what@is.arcoxia.” rel=”nofollow”>..

    Buygeneric drugs…

  49. HARVEY Says:

    flexeril@gain.weight” rel=”nofollow”>.

    Buygeneric drugs…

  50. JAIME Says:

    Buygeneric drugs…

  51. Alexander1 Says:

    buy@aloe.vera.gel” rel=”nofollow”>…

    Need cheap generic VIAGRA?…

  52. Alexander7 Says:

    buy@generic.LEVITRA” rel=”nofollow”>…

    Need cheap generic LEVITRA?…

  53. SETH Says:

    Order@Cheap.Coral.Calcium” rel=”nofollow”>..

    Buygeneric pills…

  54. BRANDON Says:

    Order@Discount.Coral.Calcium” rel=”nofollow”>..

    Buyno prescription…

  55. LEWIS Says:

    Order@Cheap.Abana” rel=”nofollow”>..

    Buynow it…

  56. PERRY Says:

    Purchase@Discount.Abana” rel=”nofollow”>…

    Buywithout prescription…

  57. SALVADOR Says:

    Buy@Abilify.Online” rel=”nofollow”>..

    Buygeneric meds…

  58. RONNIE Says:

    Buy@Cheap.Abilify” rel=”nofollow”>..

    Buynow it…

  59. EDUARDO Says:

    Purchase@Generic.Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>.

    Buynow it…

  60. GUY Says:

    Buy@Acai.Online” rel=”nofollow”>.

    Buywithout prescription…

  61. RUSSELL Says:

    Order@Generic.Acai” rel=”nofollow”>..

    Buywithout prescription…

  62. RENE Says:

    Buy@Coral.Calcium.Online” rel=”nofollow”>.…

    Buygeneric drugs…

  63. TERRENCE Says:

    coral@calcium.is.it.safe” rel=”nofollow”>..

    Buyit now…

  64. JAMES Says:

    Purchase@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric meds…

  65. PERRY Says:

    Purchase@Discount.Coral.Calcium” rel=”nofollow”>…

    Buygeneric pills…

  66. ROY Says:

    Get@Coral.Calcium.Online” rel=”nofollow”>…

    Buywithout prescription…

  67. TRACY Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buywithout prescription…

  68. SAMUEL Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  69. RALPH Says:

    Buy@Discount.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  70. JEFFREY Says:

    Order@Acai.Online” rel=”nofollow”>…

    Buynow it…

  71. DONALD Says:

    Order@Acai.Online” rel=”nofollow”>…

    Buyit now…

  72. FELIX Says:

    Purchase@Cheap.Acai” rel=”nofollow”>…

    Buyit now…

  73. KELLY Says:

    Cheap@Acai.Online” rel=”nofollow”>.

    Buygeneric meds…

  74. PERRY Says:

    Cheap@Acai.Online” rel=”nofollow”>…

    Buynow…

  75. RUBEN Says:

    Buy@Cheap.Accupril” rel=”nofollow”>.…

    Buygeneric meds…

  76. BILLY Says:

    Purchase@Accupril.Online” rel=”nofollow”>.…

    Buygeneric drugs…

  77. MATHEW Says:

    Order@Discount.Accutane” rel=”nofollow”>.…

    Buyno prescription…

  78. KENNY Says:

    Purchase@Cheap.Accutane” rel=”nofollow”>.…

    Buynow it…

  79. SAM Says:

    Generic@Accutane.10mg.20mg.Without.Prescription” rel=”nofollow”>.…

    Buynow it…

  80. CARL Says:

    Buy@Cheap.Aciphex” rel=”nofollow”>.…

    Buygeneric meds…

  81. WILLIAM Says:

    Get@Aciphex.Online” rel=”nofollow”>.…

    Buygeneric pills…

  82. BOB Says:

    Order@Generic.Aciphex” rel=”nofollow”>.…

    Buygeneric drugs…

  83. NATHAN Says:

    Purchase@Generic.Aciphex.20mg” rel=”nofollow”>.…

    Buynow it…

  84. JONATHAN Says:

    Purchase@Generic.Actonel” rel=”nofollow”>.

    Buygeneric meds vbg…

  85. MARCUS Says:

    Purchase@Actonel.Without.Prescription” rel=”nofollow”>..

    Buynow it vhx…

  86. ROY Says:

    Cheap@Actonel.Without.Prescription” rel=”nofollow”>…

    Buynow it mou…

  87. DARYL Says:

    Purchase@Discount.Actoplus.Met” rel=”nofollow”>..

    Buygeneric drugs krg…

  88. CLIFTON Says:

    Buy@Discount.Actos” rel=”nofollow”>..

    Buygeneric meds qmo…

  89. VICTOR Says:

    Purchase@Cheap.Actos” rel=”nofollow”>..

    Buygeneric pills zdg…

  90. RAY Says:

    Order@Discount.Acular” rel=”nofollow”>.

    Buygeneric drugs zfk…

  91. RODNEY Says:

    Order@Cheap.Adalat” rel=”nofollow”>..

    Buygeneric drugs lzt…

  92. LAWRENCE Says:

    Cheap@Adalat.Online” rel=”nofollow”>..

    Buywithout prescription dyo…

  93. LLOYD Says:

    Buy@Cheap.Coral.Calcium” rel=”nofollow”>…

    Buywithout prescription xiu…

  94. MITCHELL Says:

    Generic@Abilify.5mg.10mg.15mg.20mg.30mg.Without.Prescription” rel=”nofollow”>..

    Buydrugs without prescription faj…

  95. LEWIS Says:

    Buy@Discount.Acai” rel=”nofollow”>.

    Buygeneric drugs axm…

  96. BRYAN Says:

    Order@Discount.Acai” rel=”nofollow”>.

    Buygeneric drugs nih…

  97. VINCENT Says:

    Purchase@Acai.Online” rel=”nofollow”>.

    Buyit now ojb…

  98. MARION Says:

    Buy@Generic.Acai” rel=”nofollow”>.

    Buygeneric drugs mby…

  99. JERRY Says:

    Cheap@Generic.Acai” rel=”nofollow”>…

    Buydrugs without prescription vrg…

  100. JOEL Says:

    Order@Cheap.Energy.Boost” rel=”nofollow”>..

    Buyno prescription wkp…

  101. MARION Says:

    Order@Discount.Energy.Boost” rel=”nofollow”>..

    Buyno prescription gdt…

  102. GLENN Says:

    Order@Accupril.Online” rel=”nofollow”>..

    Buyno prescription tao…

  103. WESLEY Says:

    Purchase@Accupril.Online” rel=”nofollow”>.

    Buywithout prescription yyn…

  104. HOMER Says:

    Purchase@Cheap.Accupril” rel=”nofollow”>..

    Buyit now irl…

  105. PHILIP Says:

    Purchase@Discount.Accupril” rel=”nofollow”>…

    Buygeneric meds svb…

  106. BRUCE Says:

    Buy@Accutane.Online” rel=”nofollow”>..

    Buyno prescription jui…

  107. MARVIN Says:

    Cheap@Accutane.Online” rel=”nofollow”>.

    Buynow it lmg…

  108. RONALD Says:

    Purchase@Generic.Accutane.10mg.20mg” rel=”nofollow”>.

    Buygeneric drugs itj…

  109. BRUCE Says:

    Cheap@Generic.Aciphex.20mg” rel=”nofollow”>…

    Buynow it zdg…

  110. CHRIS Says:

    Cheap@Acomplia.Online” rel=”nofollow”>..

    Buygeneric drugs nvr…

  111. JEREMIAH Says:

    Get@Acomplia.Online” rel=”nofollow”>..

    Buynow it tly…

  112. MILTON Says:

    Buy@Actonel.Online” rel=”nofollow”>..

    Buydrugs without prescription hak…

  113. CARLOS Says:

    Purchase@Actonel.Online” rel=”nofollow”>…

    Buygeneric drugs vbr…

  114. VINCENT Says:

    Purchase@Cheap.Actonel” rel=”nofollow”>.

    Buydrugs without prescription xab…

  115. BILLY Says:

    Get@Aggrenox.Online” rel=”nofollow”>…

    Buynow fjl…

  116. RENE Says:

    Order@Cheap.Albenza” rel=”nofollow”>…

    Buynow it sxk…

  117. BRENT Says:

    abilify@and.weight.gain” rel=”nofollow”>…

    Buyno prescription…

  118. WENDELL Says:

    hair@growth.and.accutane” rel=”nofollow”>..

    Buygeneric drugs…

  119. MICHAEL Says:

    altace@cough.buy” rel=”nofollow”>..

    Buynow…

  120. BARRY Says:

    risperdal@vs.abilify” rel=”nofollow”>.

    Buygeneric drugs…

  121. RICHARD Says:

    allegra@generic.purchase” rel=”nofollow”>…

    Buynow…

  122. OLIVER Says:

    phamacokinetic@of.amikacin” rel=”nofollow”>..

    Buygeneric drugs…

  123. MARTIN Says:

    ampicillin@500.mg” rel=”nofollow”>.

    Buydrugs without prescription…

  124. gerard Says:

    Search music now US Charts…

  125. JEFFERY Says:

    sleep aids and half-life

    Buy_it now…

  126. MARION Says:

    adhd drugs causing hallucinations

    Buy_generic meds…

  127. LESTER Says:

    methotrexate and tricyclerides side effects

    Buy_generic pills…

  128. JOHNNY Says:

    antidepressant drugs for cats

    Buy_generic drugs…

  129. LUIS Says:

    cancer tattoos

    Buy_without prescription…

  130. MILTON Says:

    drug detection testing

    Buy_generic meds…

  131. RONNIE Says:

    number of obese in this generation

    Buy_generic meds…

  132. GREG Says:

    aspirin pain relief dog

    Buy_drugs without prescription…

  133. ALEXANDER Says:

    drug alcohol prevention resilience

    Buy_it now…

  134. LESLIE Says:

    best life diet

    Buy_no prescription…

  135. AUSTIN Says:

    obesity children summer

    Buy_it now…

  136. NICK Says:

    prostate cancer injection treatment

    Buy_now it…

  137. DON Says:

    medication for ibs

    Buy_generic drugs…

  138. ALFRED Says:

    green nerf ds lite armour

    Buy_generic pills…

  139. IVAN Says:

    research being done to treat hiv

    Buy_generic pills…

  140. PERRY Says:

    bmi chart for kids

    Buy_generic drugs…

  141. NICHOLAS Says:

    buy cheap clomid

    Buy_it now…

  142. ENRIQUE Says:

    effects of bulimia only sometimes

    Buy_generic meds…

  143. ANDRE Says:

    serotonin natural sources

    Buy_generic meds…

  144. JESSIE Says:

    boniva price

    Buy_drugs without prescription…

  145. DERRICK Says:

    nursing drug study website

    Buy_drugs without prescription…

  146. COREY Says:

    australia clinical research resume

    Buy_generic drugs…

  147. WADE Says:

    planar warts

    Buy_drugs without prescription…

  148. GEORGE Says:

    what is valtrex used for

    Buy_generic drugs…

  149. KENT Says:

    tests for assessing anxiety

    Buy_now it…

  150. GERALD Says:

    thyroid scan image

    Buy_generic pills…

  151. JACOB Says:

    side effects of luvox

    Buy_now…

  152. MILTON Says:

    deadliest type of cancer

    Buy_generic pills…

  153. STEPHEN Says:

    genie francis weight loss

    Buy_now…

  154. TED Says:

    tylenol without codeine related constipation

    Buy_it now…

  155. EDWIN Says:

    zyrtec and drug tests

    Buy_generic meds…

  156. KYLE Says:

    stop smoking phlegm

    Buy_drugs without prescription…

  157. WAYNE Says:

    advantage of skin cancer

    Buy_generic drugs…

  158. WALLACE Says:

    persistent nausea and stomach pain

    Buy_generic meds…

  159. ELMER Says:

    household chemicals that kill fleas

    Buy_now it…

  160. NELSON Says:

    respiratory infection humidity dry antibiotics avelox

    Buy_generic pills…

  161. JUSTIN Says:

    find clomid cheap in us

    Buy_now…

  162. BYRON Says:

    what foods anorexia eat

    Buy_drugs without prescription…

  163. JOEY Says:

    atkins diet first week foods

    Buy_without prescription…

  164. GUY Says:

    fungi amazing facts

    Buy_drugs without prescription…

  165. LUKE Says:

    dog hives and what causes them

    Buy_drugs without prescription…

  166. CLIFTON Says:

    nexium pepsin ac

    Buy_generic drugs…

  167. HARVEY Says:

    acne scar and pit lamp

    Buy_generic drugs…

  168. NATHAN Says:

    synephrine hcl diet pills

    Buy_generic pills…

  169. ANDRE Says:

    neurontin and mood lability

    Buy_generic meds…

  170. TROY Says:

    menses while on birth control pills

    Buy_generic drugs…

  171. ALFRED Says:

    new birth control pill

    Buy_now it…

  172. FRED Says:

    terry abbot

    Buy_generic drugs…

  173. MILTON Says:

    zocor orange juice effects

    Buy_no prescription…

  174. FREDDIE Says:

    childrens ibuprofen diabetes

    Buy_without prescription…

  175. AARON Says:

    benicar hct and norvasc

    Buy_it now…

  176. ARTURO Says:

    macon georgia drug court

    Buy_without prescription…

  177. LAWRENCE Says:

    can iodine help thyroid function

    Buy_generic drugs…

  178. DONALD Says:

    tsa drug dogs for adoptino

    Buy_generic drugs…

  179. JOSHUA Says:

    breven medication for add

    Buy_generic drugs…

  180. NELSON Says:

    information about treatment for leg edema

    Buy_generic drugs…

  181. JIMMY Says:

    barbecue interactions with drugs

    Buy_generic meds…

  182. LANCE Says:

    dogs to detect cancer

    Buy_generic drugs…

  183. STANLEY Says:

    green@mountain.coffee.cafe.club” rel=”nofollow”>…

    Buygeneric meds…

  184. JOHN Says:

    protonix@experience.buy” rel=”nofollow”>…

    Buygeneric meds…

  185. BRETT Says:

    indications@for.use.of.atrovent” rel=”nofollow”>…

    Buygeneric meds…

  186. Tom Says:

    advair diskus…

    advair diskus…

Leave a Reply