上次也已经提到了很难将Pluto1.1发布到Tomcat5.0,经过另外几个小时的艰苦努力,总算是成功了。
第一是因为它使用了一个JDK1.5的API,解决方法是修改org.apache.pluto.core.ContainerInvocation,将CONTAINERS.remove();注释掉。(可能有潜在的问题,猜测可能是会有内存泄漏)
第二是它提供的参考实现的war包的配置使用了testsuite那个应用,必须修改pluto-portal-driver-config.xml,删除其中对testsuite应用的portlet的引用:
<?xml version="1.0" encoding="UTF-8"?>

<pluto-portal-driver
    xmlns="http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd
                        http://portals.apache.org/pluto/xsd/pluto-portal-driver-config.xsd"
    version="1.1">

    <portal-name>pluto-portal-driver</portal-name>
    <portal-version>1.1.0</portal-version>
    <container-name>Pluto Portal Driver</container-name>

    <supports>
        <portlet-mode>view</portlet-mode>
        <portlet-mode>edit</portlet-mode>
        <portlet-mode>help</portlet-mode>
        <portlet-mode>config</portlet-mode>

        <window-state>normal</window-state>
        <window-state>maximized</window-state>
        <window-state>minimized</window-state>
    </supports>

    <!– Render configuration which defines the portal pages. –>
    <render-config default="About Pluto">
        <page name="About Pluto"
            uri="/WEB-INF/themes/pluto-default-theme.jsp">
            <portlet context="/pluto" name="AboutPortlet" />
        </page>
        <page name="Pluto Admin"
            uri="/WEB-INF/themes/pluto-default-theme.jsp">
            <portlet context="/pluto" name="PlutoPageAdmin" />
            <portlet context="/pluto" name="AboutPortlet" />
        </page>
    </render-config>

</pluto-portal-driver>

第三是必须修改castor.properties
org.exolab.castor.parser.validation=false
org.exolab.castor.parser.namespaces=false
org.exolab.castor.indent=false
org.exolab.castor.debug=false

第四就是拷贝必要的包(一些已经包含在war包的WEB-INF\lib中):
aopalliance-1.0.jar
avalon-framework-4.1.3.jar
castor-1.0.jar
commons-beanutils-1.6.jar
commons-cli-1.0.jar
commons-collections-2.1.jar
commons-digester-1.7.jar
commons-logging-1.1.jar
jstl-1.1.2.jar
log4j-1.2.12.jar
logkit-1.0.1.jar
plexus-utils-1.1.jar
portlet-api-1.0.jar
spring-beans-2.0.2.jar
spring-context-2.0.2.jar
spring-core-2.0.2.jar
spring-web-2.0.2.jar
standard-1.0.4.jar
xalan-2.6.0.jar

最后就是拷贝pluto.xml到conf\Catalina\localhost目录下,需要做些修改,最关键的就是tomcat的context的path属性在5.0和5.5是不同的,5.0下必须以/开头,而5.5下是不需要的:
<Context path="pluto" docBase="../PlutoDomain/pluto-portal-1.1.0.war" crossContext="true"></Context>
设置crossContext属性为true是这个文件存在的意义所在。

当然,将Pluto1.1发布到tomcat5.0下还需要修改tomcat-users.xml,将pluto用户和角色添加进去,但是我们同样可以通过修改web.xml文件,取消安全限制:
<!–
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>portal</web-resource-name>
            <url-pattern>/portal</url-pattern>
            <url-pattern>/portal/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>pluto</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/login.jsp</form-login-page>
            <form-error-page>/login.jsp?error=1</form-error-page>
        </form-login-config>
    </login-config>

    <security-role>
        <role-name>pluto</role-name>
    </security-role>
 –>

(Visited 111 times, 1 visits today)