Search code examples
coldfusioncoldfusion-9coldspring

ColdSpring Error that a Bean Doesn't Exist when I'm not looking for one


I am working on a plugin for Mura CMS adding in my own beans, and just started getting an error that one doesn't exist. One of my beans has setters and getters for email, name, amount, etc. as well as some beans (ie. configBean, priceBean, teamBean).

When I try to load up the bean (called donationBean) I get an error that no bean exists with the ID email. Email is not supposed to be based off a bean. I haven't added any code besides the getter/setter for email and the error doesn't arise from any other properties. Here is the getter/setter section of the donation bean:

  public numeric function getAmount(){ return Variables.data['amount']; }
  public void function setAmount(numeric amount){ Variables.data['amount'] = Arguments.amount; }

  public any function getConfigBean(){ return Variables.configBean; }
  public void function setConfigBean(any configBean){ Variables.configBean = Arguments.configBean; }

  public string function getEmail(){ return Variables.data['email']; }
  public void function setEmail(string email){ Variables.data['email'] = Arguments.email; }

  public string function getId(){ return Variables.data['id']; }
  public void function setId(string id){ Variables.data['id'] = Arguments.id; }

  public string function getName(){ return Variables.data['name']; }
  public void function setName(string name){ Variables.data['name'] = Arguments.name; }

  public boolean function getPaid(){ return Variables.data['paid']; }
  public void function setPaid(boolean paid){ Variables.data['paid'] = Arguments.paid; }

  public any function getPriceBean(){ return Variables.priceBean; }
  public void function setPriceBean(any priceBean){ Variables.priceBean = Arguments.priceBean; }

  public numeric function getTeamId(){ return Variables.data['teamid']; }
  public void function setTeamId(numeric teamid){ Variables.data['teamid'] = Arguments.teamid; }

And here's my config.xml

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
  <bean id="registrationBean" class="[plugin]lib.registration" />
  <bean id="priceBean" class="[plugin]lib.price" />
  <bean id="donationBean" class="[plugin]lib.donation" />
</beans>

And finally my code to load up the bean (from within the bean itself):

  public any function createForTeamPayment(priceid, teamid, name, email){
    var price = getPriceBean().loadBy({priceid=Arguments.priceid});
    setAmount(price.getAmount());
    setTeamId(Arguments.teamid);
    setName(Arguments.name);
    setEmail(Arguments.email);
    save();
  }

Solution

  • I found that if I changed the email property to another name, in my case donorEmail, then everything started to work. I have no idea why, as there is no bean with ID email and it wasn't being called as a bean.