1

I am attempting to convert some session scoped beans to conversation scope. When I try to access a method in one of the beans from my menu.xhtml page, I get the following error:

javax.servlet.ServletException: /menu.xhtml @23,94 actionListener="#{report.reset()}": JBWEB006003: Cannot convert conversation of type class java.lang.String to interface java.util.Map

Here is the stack trace:

12:49:16,720 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-/0.0.0.0:8080-2) JSF1073: javax.faces.event.AbortProcessingException caught during processing of APPLY_REQUEST_VALUES 2 : UIComponent-ClientId=myForm:menuItemLink2, Message=/menu.xhtml @23,94 actionListener="#{report.reset()}": JBWEB006003: Cannot convert conversation of type class java.lang.String to interface java.util.Map
12:49:16,730 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-/0.0.0.0:8080-2) /menu.xhtml @23,94 actionListener="#{report.reset()}": JBWEB006003: Cannot convert conversation of type class java.lang.String to interface java.util.Map: javax.faces.event.AbortProcessingException: /menu.xhtml @23,94 actionListener="#{report.reset()}": JBWEB006003: Cannot convert conversation of type class java.lang.String to interface java.util.Map
    at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:182) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:927) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at de.rainer_klute.jsf.UploadFilter.doFilter(UploadFilter.java:97) [FileUploader.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]
Caused by: javax.el.ELException: /menu.xhtml @23,94 actionListener="#{report.reset()}": JBWEB006003: Cannot convert conversation of type class java.lang.String to interface java.util.Map
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111) [jsf-impl-2.1.28.redhat-8.jar:2.1.28.redhat-8]
    at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]

How is this caused and how can I solve it?

Bob Powell
  • 11
  • 5
  • 1
    Which JSF impl/version? Which CDI impl/version? (Weld, I guess?) Stil, full stack trace would be helpful in understand the cause. – BalusC Dec 16 '15 at 21:03
  • As well as container version. It looks like you might be on AS6... – John Ament Dec 18 '15 at 03:48
  • If you have an example complying [MCVE](http://stackoverflow.com/help/mcve), it may help potential readers understand the actual cause more closely. Please turn the last block quote to a code block. It is quite difficult to follow without proper syntax highlighting and formatting which can only be provided by a code block. It cannot be accomplished by other potential editors without having the actual stack-trace. – Tiny Jan 11 '16 at 21:07
  • @BalusC: JSF implementation version is 2.2.12 (located in C:\jboss-eap-6.2\modules\system\layers\base\javax\faces\api\main). I think the CDI implementation I'm using is Weld. I downloaded cdi-api.jar from java2s.com and put it in my WEB-INF\lib folder. In its MANIFEST.MF it lists the Implementation-URL as http://www.seamframework.org/Weld. I have added the full stack trace to the post. – Bob Powell Jan 11 '16 at 21:20
  • @John Ament: I am running JBoss-EAP-6.2. – Bob Powell Jan 11 '16 at 21:22
  • *"I downloaded cdi-api.jar from java2s.com and put it in my WEB-INF\lib folder."*, this is not right. Get rid of it and retry. JBoss itself as being a Java EE server lready bundles CDI out the box (like JSF). – BalusC Jan 12 '16 at 07:11
  • @BalusC: Thank you for pointing that out. I removed cdi-api.jar from WEB-INF\lib, but am still getting the same error message. – Bob Powell Jan 13 '16 at 18:17
  • @BalusC: I upgraded to JBoss-EAP-6.4, and am still getting the same error message, but the stack trace looks different now. I updated the stack trace above to reflect the new one. – Bob Powell Jan 14 '16 at 20:08
  • Did you modify the server? Which JARs are in webapp's /WEB-INF/lib? Can you ensure that none of those are already provided by server itself (e.g. Java EE, JSF, CDI, etc)? – BalusC Jan 14 '16 at 20:10
  • are you by accident overriding a 'reserved keyword' in EL somewhere? Like `conversation`? – Kukeltje Jan 14 '16 at 20:22
  • All: I was able to get past this error by removing the managed-bean declarations from faces-config.xml, and adding the necessary annotations to the beans themselves. Thanks everyone for your input! – Bob Powell Jan 15 '16 at 18:26

0 Answers0