使用Pluto+Tomcat 开发遇到的问题和总结 (2)

以下是我在具体配置和开发中遇到的问题和解决的办法。

注意:这里的Solution是根据我的开发环境和项目给出的,并不一定适合你的项目,需要具体问题具体分析。

         另外,还有一些问题没有找到Reason,只是有个Solution,有知道Root Cause的高手,麻烦指导一二,THX

 

Problems and Solution

 

1)portletentityregistry.xml


    It contains the definition of the portlet. Add these lines to it: 

 

        <application id="5">
            <definition-id>HelloWorld</definition-id>
            <portlet id="1">
                   <definition-id>HelloWorld.HelloWorld</definition-id>
            </portlet>
        </application>


       The <definition-id> of the application should be the name of the web application folder. The portlet's <definition-id> should be equal to the generated portlet-guid in web.xml.

 

 

 2)web.xml
   <init-param>
            <param-name>portlet-guid</param-name>
            <param-value>HelloPortal.HelloWorldPortlet</param-value>
   </init-param>


The <portlet-guid> of the servlet should be <folder name in webapps of Tomcat>.<portlet name in portlet.xml>

 

 

 3)Encounter Eceptions
 
 javax.servlet.UnavailableException: Initialization of one or more services failed
 
>>>>>>need to find out the Root Cause
 change the <portlet-app> in portlet.xml of the project.
 
  Right
   <portlet-app
   xmlns="/org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd"
   version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="/org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd /org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd">

 

  Wrong
   <portlet-app
   xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
   version="1.0" 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">

  
   java.lang.IllegalStateException: The prepare method was never called
  
   JDK issue. After I change the JDK to 1.4, it is OK.
  
   ERROR  org.apache.pluto.invoker   PortletInvokerImpl.render() - Error while dispatching portlet.
 java.lang.IllegalStateException: The prepare method was never called
 at org.apache.pluto.PortletContainerServices.get(PortletContainerServices.java:38)
 at org.apache.pluto.services.information.InformationProviderAccess.getContainerService(InformationProviderAccess.java:39)
 at org.apache.pluto.services.information.InformationProviderAccess.getStaticProvider(InformationProviderAccess.java:29)
 at org.apache.pluto.core.PortletServlet.init(PortletServlet.java:86)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:880)
 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:613)
 at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:597)
 at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:519)

......
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值