AnsweredAssumed Answered

Obscure error message with own JSP page

Question asked by alr on Nov 20, 2008
Latest reply on Nov 27, 2008 by alr
Hello

again with a problem, I do not understand. Not a good day today I guess :-)

First I try to explain my szenario again:
1. Wrote an own JSP Page, which only outputs the name property of a nodeID along with the content of a certain node
2. put it under the /jsp/ directory (which means you have to login anyway to access, if I got the navigation cases right)

Now when I access the JSP page and only output the name property, everything runs fine. If I add the part where I output the content of a node, I get the following error

This is basically my JSP


<f:view>

<h:outputText value="#{EditMediaDetailBean.name}" />

and

<h:outputText value="#{EditMediaDetailBean.defaultLanguage}" />

</f:view>

If  I comment out the last line it works, otherwise this is my error message:


javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/comnos/editMediaDetail.jsp][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp1]}
caused by:
org.apache.jasper.JasperException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/comnos/editMediaDetail.jsp][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp1]}
caused by:
javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/comnos/editMediaDetail.jsp][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp1]}
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{EditMediaDetailBean.defaultLanguage}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property defaultLanguage of base of type : com.comnos.alfresco.web.bean.EditMediaDetailBean
caused by:
javax.faces.el.EvaluationException: Bean: com.comnos.alfresco.web.bean.EditMediaDetailBean, property: defaultLanguage
caused by:
java.lang.reflect.InvocationTargetException
caused by:
org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required: Thread[http-8080-Processor22,5,main]

The relevant code, which causes this exception is the following (nothing special)
ContentReader reader = contentService.getReader(nodeRef, ContentModel.PROP_CONTENT)

This all leaves me with the conclusion, that I have missed something far before the transaction based code. However I have no idea right now, what it might be:


   <managed-bean>
      <description>Bean that manages media detail GUI</description>
      <managed-bean-name>EditMediaDetailBean</managed-bean-name>
      <managed-bean-class>com.comnos.alfresco.web.bean.EditMediaDetailBean</managed-bean-class>
      <!– <managed-bean-scope>request</managed-bean-scope> –>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
         <property-name>sessionBean</property-name>
         <value>#{SessionBean}</value>
      </managed-property>
    </managed-bean>

My SessionBean included some services like nodeService, searchService, permissionService, versionService, contentService, copyService, authenticationService, transactionService - but mostly to test if they were missing, I only need five of them actually.

So anyone has an idea what I've not looked consciously enough at?


Regards, Alexander

Outcomes