reset password
Author Message
alomo
Posts: 70
Posted 17:23 Jun 03, 2010 |

I am stack with a problem of adding attachments when edit a page.

Here is a fragment of the log:

2010-06-03 17:04:56,102 ERROR ExceptionResolver: Exception caused by user i0001
2010-06-03 17:04:56,102 ERROR ExceptionResolver:
2010-06-03 17:04:56,102 ERROR ExceptionResolver: java.lang.NullPointerException
    at csns.spring.controller.AbstractMessageController.processMessage(AbstractMessageController.java:58) - [ at this line: fileDao.saveFile( file ); file is not NULL ]
    at csns.spring.controller.wiki.EditPageController.onSubmit(EditPageController.java:78) - [ at this line: processMessage( revision, user, request ); none of those arguments is NULL  ]

Any suggestion on what object may cause this NullPointerException?

Last edited by alomo at 17:23 Jun 03, 2010.
sunaina
Posts: 14
Posted 17:44 Jun 03, 2010 |

It may sound too basic, but make sure that you have your fileDao registered in spring-servlet.xml.

 

I have faced the same kind of problem with wikiDao.

 

Good luck!

Last edited by sunaina at 17:45 Jun 03, 2010.
alomo
Posts: 70
Posted 18:07 Jun 03, 2010 |
sunaina wrote:

It may sound too basic, but make sure that you have your fileDao registered in spring-servlet.xml.

I have faced the same kind of problem with wikiDao.

Good luck!

 

Sunaina, thank you for reply.

This EditPageController extends another controller AbstractMessageController which has all required dao's registered. So in my EditPageController I don't need it.

In fact, the program will not start at all because of that attempt to define same property more than one time.

Last edited by alomo at 18:08 Jun 03, 2010.
cysun
Posts: 2935
Posted 19:34 Jun 03, 2010 |
alomo wrote:

[...]

This EditPageController extends another controller AbstractMessageController which has all required dao's registered. So in my EditPageController I don't need it.

[...]

Wrong. The class may inherit from another class, but it doesn't mean the bean definition will inherit from that bean definition. See the bean definition of CreateTopicController, which also inherits from AbstractMessageController.

alomo
Posts: 70
Posted 20:01 Jun 03, 2010 |
cysun wrote:
alomo wrote:

[...]

This EditPageController extends another controller AbstractMessageController which has all required dao's registered. So in my EditPageController I don't need it.

[...]

Wrong. The class may inherit from another class, but it doesn't mean the bean definition will inherit from that bean definition. See the bean definition of CreateTopicController, which also inherits from AbstractMessageController.

The CreatePageController I have extends AbstractMessageController and there is no fileDao in the csns-servlet.xml configuration file. Same is done for EditPageController. With that configuration, new pages are created with files attached.

(wrong log posted)

 

Sunaina, thanks again!

Last edited by alomo at 20:10 Jun 03, 2010.