You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Zhonghui Ning <zh...@9starresearch.com> on 2005/02/17 13:20:32 UTC

Error in ClassCastException

Hello everyone,

I want to implement a portlet in jetspeed 2 + tomcat 5.0.28 + linux. My 
code can compile but I got a runtime error after I deploy my portlet in 
jetspeed. The error is java.lang.ClassCastException: 
org.apache.jetspeed.container.JetspeedPortletConfig.The error part of my 
code is in the following.
Any help? Thanks.
Zhonghui

// PortletConfigImpl.java

package com.star.portlet;
import javax.portlet.PortletConfig;
public class PortletConfigImpl implements PortletConfig {
......
}

// StrutsPortlet.java
package com.star.portlet;
import javax.portlet.PortletConfig;
public class StrutsPortlet extends GenericPortlet {

       private PortletConfigImpl _portletConfig;

    public void init(PortletConfig config) throws PortletException {
        super.init(config);            
        _portletConfig = (PortletConfigImpl)config;  // Error: 
java.lang.ClassCastException

        _editAction = getInitParameter("edit-action");
        _helpAction = getInitParameter("help-action");
        _viewAction = getInitParameter("view-action");

        _copyRequestParameters = GetterUtil.get(
            getInitParameter("copy-request-parameters"), true);
    }

......
}

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: Error in ClassCastException

Posted by Shah Amit <am...@hotmail.com>.
A wild guess would be try to cast it to the interface and not directly to 
the implementation ??

If you can give the entire trace, that would probably help better.

Amit

----Original Message Follows----
From: Zhonghui Ning <zh...@9starresearch.com>
Reply-To: "Jetspeed Users List" <je...@jakarta.apache.org>
To: jetspeed-user@jakarta.apache.org,  zhonghui@9starresearch.com
Subject: Error in ClassCastException
Date: Thu, 17 Feb 2005 12:20:32 +0000

Hello everyone,

I want to implement a portlet in jetspeed 2 + tomcat 5.0.28 + linux. My code 
can compile but I got a runtime error after I deploy my portlet in jetspeed. 
The error is java.lang.ClassCastException: 
org.apache.jetspeed.container.JetspeedPortletConfig.The error part of my 
code is in the following.
Any help? Thanks.
Zhonghui

// PortletConfigImpl.java

package com.star.portlet;
import javax.portlet.PortletConfig;
public class PortletConfigImpl implements PortletConfig {
......
}

// StrutsPortlet.java
package com.star.portlet;
import javax.portlet.PortletConfig;
public class StrutsPortlet extends GenericPortlet {

       private PortletConfigImpl _portletConfig;

    public void init(PortletConfig config) throws PortletException {
        super.init(config);                   _portletConfig = 
(PortletConfigImpl)config;  // Error: java.lang.ClassCastException

        _editAction = getInitParameter("edit-action");
        _helpAction = getInitParameter("help-action");
        _viewAction = getInitParameter("view-action");

        _copyRequestParameters = GetterUtil.get(
            getInitParameter("copy-request-parameters"), true);
    }

......
}

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org