rohitghatol / spring-roo-addon-typical-security

Automatically exported from code.google.com/p/spring-roo-addon-typical-security
2 stars 0 forks source link

Getting forgotPasswordController Error #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello Rohit,

Thanks again for the good plugin. I am new to Spring ACL and thought this could 
help me learn new things. I modified the clinic.roo (attached to this post) 
sample file that comes with roo distribution and modified it with the plugin 
settings for your plugin, and also changed the database to MySql

I am getting following error messages,

1) In the generated code for UserModel.java, it was missing the variable 
"activationDate". So the file SignUpController.java was giving error. Added 
following variable to UserModel.java

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date activationDate; 

2) After running the code, i am getting following error,

HTTP Status 500 -
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'forgotPasswordController': Injection of autowired dependencies 
failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Could not autowire 
field: private transient org.springframework.mail.SimpleMailMessage 
com.petstore1.web.ForgotPasswordController.simpleMailMessage; 

Attached is the complete error log. Please let me know if i am doing something 
wrong. 

Thanks again for your help in advance.

Thanks

Original issue reported on code.google.com by msophia1...@gmail.com on 19 Jan 2011 at 4:53

Attachments:

GoogleCodeExporter commented 9 years ago
Hi There, I am having the same problem here

Original comment by manuel.d...@gmail.com on 24 Jan 2011 at 6:35

GoogleCodeExporter commented 9 years ago
Problem is SimpleMailMessage dont hava setup in applicationContext.xml

Fix it let comment like that

//@Autowired
private transient SimpleMailMessage simpleMailMessage;

and modify function sendMessage 

    public void sendMessage(String mailTo, String message) {
        //Add line
        simpleMailMessage = new SimpleMailMessage();
        simpleMailMessage.setTo(mailTo);
        simpleMailMessage.setText(message);
        mailSender.send(simpleMailMessage);
    }

Original comment by tk1c...@gmail.com on 28 Jan 2011 at 5:04

GoogleCodeExporter commented 9 years ago
Fixed in 0.1.4

Original comment by wa...@digitalface.ca on 24 Feb 2011 at 9:30