[JBoss Portal] - java.lang.ClassCastException in ContextImpl
by FredF
I am trying to retrieve a context for the portalobjectcontainer
public class PortalService {
|
| private PortalObject po;
| private org.jboss.portal.core.model.portal.Context ctx;
| private org.jboss.portal.core.model.portal.PortalObjectContainer container;
| public PortalService(){
| try{
| MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
| container = (PortalObjectContainer)MBeanProxy.get(PortalObjectContainer.class, new ObjectName("portal:container=PortalObject"), mbeanServer);
| System.out.println("container=" + container);
| ctx = container.getContext();
| }catch ( Exception ex ) {
| ex.printStackTrace();
| }
| }
| }
but the line
ctx = container.getContext();
gives me an
java.lang.ClassCastException: org.jboss.portal.core.impl.model.portal.ContextImpl
I got this code from a post in this forum some time ago and have made it work but when I tried it again in new class this happens.
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033157#4033157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033157
17Â years, 9Â months
[JBoss Seam] - duplicated in the faces tree
by tony.herstellï¼ gmail.com
| <!-- Firstname -->
| <h:outputLabel for="firstname" value="#{messages.label_firstname}" style="align:right"/>
| <s:decorate>
| <s:fragment rendered="#{!usedForFilter}">
| <h:inputText id="firstname" value="#{user.firstname}"
| required="true" title="#{messages.hint_firstname}"/>
| </s:fragment>
| <s:fragment rendered="#{usedForFilter}">
| <h:inputText id="firstname" value="#{userSearchCriteria.firstname}" title="#{messages.hint_firstname}" />
| </s:fragment>
| </s:decorate>
| <s:fragment rendered="#{!usedForFilter}">
| <h:outputText value="#{messages.tag_mandatory}" styleClass="mandatory"/>
| </s:fragment>
| <s:fragment rendered="#{usedForFilter}">
| <h:outputText value=""/>
| </s:fragment>
| <h:outputText value="" />
| <s:message errorClass="error" for="firstname" style="align:left"/>
| <h:outputText value="" />
|
gives
anonymous wrote :
| Client-id : firstname is duplicated in the faces tree. Component : firstname, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /pages/user/userRegistration.xhtml][Class: org.jboss.seam.ui.UIValidateAll,Id: _id20][Class: org.jboss.seam.ui.UIDecorate,Id: _id24][Class: org.jboss.seam.ui.UIFragment,Id: _id26][Class: javax.faces.component.html.HtmlInputText,Id: firstname]}
|
the error should be ralted to whichever "firstname" component is rendered (they are mutually exclusive)...
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033150#4033150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033150
17Â years, 9Â months