2 Replies Latest reply on Sep 15, 2006 1:22 PM by Pavel Lysov

    ClassCastException: org.jboss.portal.cms.impl.jcr.JCRCommand

    Pavel Lysov Newbie

      It's jboss portal 2.4 final.

      I am getting classcast exception while trying to access jcr repository in my portlet:

      CMS CMSService = (CMS) getPortletContext().getAttribute("CMS");
      System.out.println(CMSService.getDefaultLocale()); //<= works fine!!!
      org.jboss.portal.cms.CommandFactory factory = CMSService.getCommandFactory();

      The last line throws classcast.
      13:46:56,376 ERROR [HelloWorldPortlet] The portlet threw an exception
      java.lang.ClassCastException: org.jboss.portal.cms.impl.jcr.JCRCommandFactory
       at $Proxy146.getCommandFactory(Unknown Source)
       at org.jboss.portlet.hello.HelloWorldPortlet.doView(HelloWorldPortlet.java:47)
       at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:167)

      You see, I am on 'helloworld' phase, so would be appreciate any help/advice.

      Thank you!