You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yee CN <ye...@streamyx.com> on 2006/04/06 17:25:08 UTC

addMessage(...SEVERITY_ERROR...) cause hibernate lazy initialization error???

Hi,

 

I have a jsf page that with a simple action as follows:

 

public String myAction() {

            try {

                        myService.doSomething();

            } catch (Exception e) {

                        String msg = e.getMessage();

FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_ERROR, msg,msg));

            }

            Return ResultPage;

 }

 

 

I find that when an exception did actually occurs, the ResultPage will raise
an hibernate initialization error.

However if I change FacesMessage.SEVERITY_ERROR to
FacesMessages.SEVERITY_WARN, the page will display OK.

 

I am using last night's build of MyFaces 1.1.3 snapshot plus Tomahawk 1.1.2
Snapshot.

 

I only noticed this problem after changing to Facelets, so I do not rule out
Facelets as a culprit.

 

Does anybody noticed this behaviour? What is the explanation for the
difference in behavior? 

This is something that is bugging me big time, so I would appreciate any
help.

 

Many thanks in advance.

 

Yee