0 Replies Latest reply on Jan 22, 2007 10:38 AM by hussain rangwala

    java.lang.ClassCastException

    hussain rangwala Newbie

      hey guys,
      i am stuck on this problem for a very long time and need some help....i request the Jboss technical team to please help me on this.......
      i am trying to deploy a struts application as a portlet on jboss portal 2.4.0.GA.
      However the application gets deployed successfully and i see the portal-page when i access http://localhost:8080/portal.
      However when i click on the portal page It gives an error "Object not found SETLInstanceName".

      2007-01-22 20:25:20,271 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Loading portlet class org.apache.portals.bridges.struts.StrutsPortlet
      2007-01-22 20:25:20,286 DEBUG [org.jboss.portal.portlet.container.PortletContainer] Creating portlet object org.apache.portals.bridges.struts.StrutsPortlet
      2007-01-22 20:25:20,302 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=portal:container=Portlet,id=SETLAppName.SETLPortletName state=Create
       org.jboss.portal.portlet.container.PortletInitializationException: The portlet SETLPortletName threw a runtime exception during init at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:287)
       at org.jboss.portal.portlet.container.PortletContainerAdapter.start(PortletContainerAdapter.java:74)
       at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.joinpoint.plugins.reflect.ReflectMethodJoinPoint.dispatch(ReflectMethodJoinPoint.java:72)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:92)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:452)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:147)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:74)
       at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:232)
       at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:79)
       at org.jboss.portal.server.deployment.jboss.PortalDeploymentInfo$DeploymentContext.start(PortalDeploymentInfo.java:211)
       at org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:242)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy107.deploy(Unknown Source)
       at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:296)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy82.deploy(Unknown Source)
       at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:54)
       at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:133)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
       at $Proxy108.handleNotification(Unknown Source)
       at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:127)
       at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:108)
       at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:340)
       at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:308)
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:482)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
       at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:117)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy86.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.apache.portals.bridges.struts.StrutsPortlet
       at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:249)
       ... 147 more
      2007-01-22 20:25:20,521 DEBUG [org.jboss.portal.core.deployment.jboss.PortletAppDeployment] Looking for the WEB-INF path of SETLAppName
      2007-01-22 20:25:20,536 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: WEB-INF
      2007-01-22 20:25:20,536 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/D:/JBoss/jboss-portal-2.4.0/server/default/tmp/deploy/tmp52383SETLAppName-exp.war/WEB-INF/
      2007-01-22 20:25:20,567 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: SETLAppName.war
      2007-01-22 20:25:20,567 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/D:/JBoss/jboss-portal-2.4.0/server/default/deploy/SETLAppName.war
      2007-01-22 20:25:20,567 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/D:/JBoss/jboss-portal-2.4.0/server/default/deploy/SETLAppName.war -> file:/D:/JBoss/jboss-portal-2.4.0/server/default/deploy/SETLAppName.war
      



      below are the deployment descriptors:

      1.jboss-app.xml
      <jboss-app>
       <app-name>SETLAppName</app-name>
      </jboss-app>
      


      2.jboss-portlet.xml

      <portlet-app>
      
       <portlet>
       <portlet-name>SETLPortletName</portlet-name>
       <!-- Use the specific struts container configuration -->
       <config-name>StrutsPortlet</config-name>
       </portlet>
      </portlet-app>
      
      


      3. portlet.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app id="SETLAppName" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
       version="1.0">
      
       <portlet id="SETLPortletName">
       <init-param>
       <name>ServletContextProvider</name>
       <value>org.jboss.portal.bridge.JBossServletContextProvider</value>
       </init-param>
       <init-param>
       <name>ViewPage</name>
       <value>/Login.do</value>
       </init-param>
       <init-param>
       <name>HelpPage</name>
       <value>/signIn.do</value>
       </init-param>
       <portlet-name>SETLPortletName</portlet-name>
       <display-name>SETL Display Name</display-name>
       <description>This is the SETLBAAAAAANK</description>
       <portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>
       <expiration-cache>-1</expiration-cache>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       <portlet-mode>HELP</portlet-mode>
       </supports>
       <portlet-info>
       <title>SETL Bank Demo</title>
       <short-title>This is the short title</short-title>
       <keywords>SETL</keywords>
       </portlet-info>
       </portlet>
      </portlet-app>
      
      


      4.portlet-instances.xml
      <?xml version="1.0" standalone="yes"?>
      
       <instances>
       <instance>
       <instance-name>SETLInstanceName</instance-name>
       <component-ref>SETLPortletName</component-ref>
       </instance>
       </instances>
      
      


      5.SETLAppName-object.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <deployments>
       <deployment>
       <if-exists>overwrite</if-exists>
       <parent-ref>default</parent-ref>
       <page>
       <page-name>SETLAppName</page-name>
       <window>
       <window-name>SETLWindowName</window-name>
       <instance-ref>SETLInstanceName</instance-ref>
       <region>center</region>
       <height>1</height>
       </window>
       </page>
       </deployment>
      
      </deployments>
      


      6.SETLAppName-pages.xml
      <pages>
       <portal-name>default</portal-name>
       <page>
       <page-name>SETLStruts</page-name>
       <window>
       <window-name>SETLBankWindowName</window-name>
       <instance-ref>/SETLAppName.SETLPortletName.SETLInstanceName</instance-ref>
       <region>center</region>
       <height>0</height>
       </window>
       </page>
      </pages>
      



      Also i am using jdk 1.5..that is placed under the program files

      Any ideas and suggestions will be appreciated...please reply as soon as possible
      Thanks
      Hussain