|
|
ClassCastException (JBoss)
Hello there,
I'm trying to deploy a sample Spring MVC Portlet to JBoss. My web.xml looks like this:Code:
lt;context-paramgt; lt;param-namegt;contextConfigLocationlt;/param-namegt; lt;param-valuegt;/WEB-INF/applicationContext.xmllt;/param-valuegt;
lt;/context-paramgt;
lt;listenergt; lt;listener-classgt;org..web.context.ContextLoaderListenerlt;/listener-classgt;
lt;/listenergt;
lt;servletgt; lt;servlet-namegt;ViewRendererServletlt;/servlet-namegt; lt;servlet-classgt;org..web.servlet.ViewRendererServletlt;/servlet-classgt; lt;/servletgt;
lt;servlet-mappinggt; lt;servlet-namegt;ViewRendererServletlt;/servlet-namegt; lt;ucl-patterngt;/WEB-INF/servlet/viewlt;/ucl-patterngt; lt;/servlet-mappinggt;
lt;/servletgt;
and my portal.xml like this:Code:
lt;portletgt; lt;portlet-namegt;SpringMVCTestPortletlt;/portlet-namegt; lt;portlet-classgt;org..web.portlet.DispatcherPortletlt;/portlet-classgt; lt;init-paramgt;
lt;namegt;contextConfigLocationlt;/namegt;
lt;valuegt;/WEB-INF/context/SpringMVCTestPortlet-context.xmllt;/valuegt; lt;/init-paramgt; lt;init-paramgt;lt;namegt;viewRendererucllt;/namegt;lt;valuegt;/WEB-INF/servlet/viewlt;/valuegt; lt;/init-paramgt; lt;supportsgt; lt;mime-typegt;text/htmllt;/mime-typegt; lt;portlet-modegt;viewlt;/portlet-modegt; lt;/supportsgt;
lt;supported-localegt;enlt;/supported-localegt;
lt;portlet-infogt;
lt;titlegt;Spring Testlt;/titlegt;
lt;/portlet-infogt;
lt;/portletgt;
When I try to deploy this portlet, I get following excpetion:Code:
...
16:18:13,785 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
16:18:13,785 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
16:18:13,785 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
16:18:13,785 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
16:18:13,785 ERROR [STDERR] Caused by: java.lang.ClassCastException: org..web.portlet.DispatcherPortlet cannot be cast to javax.portlet.Portlet
16:18:13,785 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:231)
16:18:13,785 ERROR [STDERR] ... 107 more
I can't figure out whats wrong
Please, HELP
Interesting -- someone else just posted the same issue with Websphere 6, but I haven't seen this problem before otherwise.
I see from your exception that it is trying to cast it as javax.portlet.Portlet, which should be fine.
Any chance you accidentally deployed a copy of the portlet-api jar file?
Thanks allot - I've really deployed the portal-api.jar .
I spent a hole day on this and couldn't figure out the mistake.
But now I can't use the Controller Interface because there is no javax.portlet.ActionRequest.
I'm anxious how long it will take me to solve this one ;gt;
You need to have portlet-api.jar available at build time, but you should not include it in your deployed war file. That should take care of it. What are you using to perform your build? Both Ant and Maven have easy ways to excluded jar files from your war file.
I've allready found that out, but thanks anyway.
What was the problem ? |
|