0 Replies Latest reply on Dec 12, 2007 3:14 AM by Raja Malik

    Getting org.jboss.portal.portlet.container.PortletInitializa

    Raja Malik Newbie

      Hello,

      I am trying to run a simple portlet having a jsp but gettting the error org.jboss.portal.portlet.container.PortletInitializationException.

      The jsp contains a text area and a button to invoke the portlet's processAction method.

      The jsp looks like: spellcheckPortlet.jsp
      --------------------------------------------------------------------------------------
      <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>

      <portlet:defineObjects/>


      This is sample Spell Check Portlet.
      Please Enter text for Spell Check in the text area below.

      <form action="<portlet:actionURL><portlet:param name="page"

      value="mainview"/></portlet:actionURL>"
      method="POST">
      Name:



      You can also link to other pages, using a renderURL, like <a
      href="<portlet:renderURL><portlet:param name="spellCheckText" value="Enter the text for

      Spell Check."></portlet:param></portlet:renderURL>">this.

      --------------------------------------------------------------------------------------

      Portlet.xml
      --------------------------------------------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app 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"
      version="1.0">

      <portlet-name>SpellChecketPortlet</portlet-name>
      <portlet-class>test.portal.SpellCheckPortlet</portlet-class>

      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      <portlet-mode>EDIT</portlet-mode>
      <portlet-info>
      Spell Checker Portlet
      </portlet-info>


      </portlet-app>

      --------------------------------------------------------------------------------------

      Portlet-instances.xml
      --------------------------------------------------------------------------------------
      <?xml version="1.0" standalone="yes"?>
      <!DOCTYPE deployments PUBLIC
      "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
      "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">



      <instance-id>SpellCheckPortletInstance</instance-id>
      <portlet-ref>SpellCheckPortlet</portlet-ref>




      --------------------------------------------------------------------------------------

      Spellcheck-Object.xml
      --------------------------------------------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>


      <if-exists>overwrite</if-exists>
      <parent-ref>default.default</parent-ref>

      <window-name>SpellCheckPortletWindow</window-name>
      <instance-ref>SpellCheckPortletInstance</instance-ref>
      center
      1




      --------------------------------------------------------------------------------------

      SpellCheckPortlet.java
      --------------------------------------------------------------------------------------
      public class SpellCheckPortlet extends GenericPortlet {

      protected void doView(RenderRequest renderrequest,
      RenderResponse renderresponse) throws PortletException,
      IOException, UnavailableException {
      try {
      renderresponse.setContentType("text/html");
      PrintWriter printwriter = renderresponse.getWriter();
      String text = (String) renderrequest.getParameter("spellCheckText");
      if (text != null) {
      renderrequest.setAttribute("spellCheckText",text);
      PortletRequestDispatcher reqDispatcher = getPortletContext().getRequestDispatcher("WEB-INF/html-jsp/index.jsp");
      reqDispatcher.include(renderrequest,renderresponse);
      }
      else{
      PortletRequestDispatcher reqDispatcher = getPortletContext().getRequestDispatcher("WEB-INF/html-jsp/index.jsp");
      reqDispatcher.include(renderrequest,renderresponse);
      }
      }catch (Exception gee) {
      gee.printStackTrace();
      }
      }//end doView

      public void processAction(ActionRequest arg0, ActionResponse arg1) throws PortletException, PortletSecurityException, IOException {
      //super.processAction(arg0, arg1);
      System.out.println("Hello! Process Action - Start");
      System.out.println("Hello! Process Action - End");
      }

      protected void doEdit(RenderRequest arg0, RenderResponse arg1) throws PortletException, PortletSecurityException, IOException {
      //super.doEdit(arg0, arg1);
      }
      }

      --------------------------------------------------------------------------------------

      StackTrace:
      12:55:35,299 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      12:55:36,458 INFO [TomcatDeployer] deploy, ctxPath=/spellCheckComponent, warUrl=.../tmp/deploy/tmp28659spellCheckComponent-exp.war/
      12:55:36,834 INFO [WebappClassLoader] validateJarFile(C:\Jboss-4.0.3\jboss-portal-2.6-BETA1\server\default\.\tmp\deploy\tmp28659spellCheckComponent-e
      xp.war\WEB-INF\lib\servlet-2.2.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
      12:55:37,116 ERROR [AbstractKernelController] Error installing to Start: name=portal:container=Portlet,id=/spellCheckComponent.SpellChecketPortlet sta
      te=Create
      org.jboss.portal.portlet.container.PortletInitializationException: The portlet SpellChecketPortlet threw a runtime exception during init
      at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:275)
      at org.jboss.portal.portlet.container.PortletContainerAdapter.start(PortletContainerAdapter.java:72)
      at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      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.jav
      a: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:226)
      at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:94)
      at org.jboss.portal.server.deployment.jboss.DeploymentContext.start(DeploymentContext.java:99)
      at org.jboss.portal.server.deployment.jboss.PortalDeploymentInfoContext.start(PortalDeploymentInfoContext.java:211)
      at org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:217)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      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:324)
      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 $Proxy173.deploy(Unknown Source)
      at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:259)
      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:324)
      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 $Proxy146.deploy(Unknown Source)
      at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:54)
      at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:160)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
      at $Proxy176.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:324)
      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.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      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 $Proxy160.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      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:324)
      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.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      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:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      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:324)
      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:490)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.ClassCastException
      at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:237)
      ... 148 more
      12:55:37,460 WARN [PortletAppDeployment] Failed to create instance SpellCheckPortletInstance of portlet /spellCheckComponent.SpellCheckPortlet becaus
      e portlet /spellCheckComponent.SpellCheckPortlet is not available
      12:55:37,601 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      12:55:37,868 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
      12:55:37,915 INFO [JkMain] Jk running ID=0 time=0/141 config=null
      12:55:37,930 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 1m:21s:562ms


      Thanks
      Raja