我是IBM WCM和IBM Portal的新手;我使用以下版本:
- IBM WebSphere Portal server8.0 .0.0.0
- IBM Web Content Manager_8.0.0.0
我需要为WCM工作流创建一个自定义操作;到目前为止,我能够通过以下链接创建一个非常简单的自定义操作:WCM自定义操作
现在我需要创建一个更复杂的自定义动作;在我的自定义操作中,我想使用spring 4.0和Hibernate 4.3.0;所以我创建了一个EAR文件和一个WAR模块;在WAR模块中,在WEB-INF/lib目录下,我有以下jar:
- commons-pool-1.5.4.jar
- spring-beans-4.0.0.RELEASE.jar
- hibernate-core-4.3.0.Final.jar
- dom4j-1.6.1.jar
- spring-aop-4.0.0.RELEASE.jar
- validation-api-1.1.0.Final.jar
- jandex-1.1.0.Final.jar
- spring-context-support-4.0.0.RELEASE.jar
- commons-math3-3.2.jar
- javassist-3.18.1-GA.jar
- antlr-2.7.7.jar
- aspectjweaver-1.7.4.jar
- hppc-0.5.4.jar
- commons-dbcp-1.4.jar
- spring-jdbc-4.0.0.RELEASE.jar
- hibernate-commons-annotations-4.0.4.Final.jar
- aopalliance-1.0.jar
- jackson-mapper-asl-1.9.13.jar
- spring-tx-4.0.0.RELEASE.jar
- slf4j-log4j12-1.7.1.jar
- log4j-1.2.17.jar
- commons-io-2.4.jar
- spring-web-4.0.0.RELEASE.jar
- xml-apis-1.0.b2.jar
- spring-core-4.0.0.RELEASE.jar
- hibernate -空间- 4.3 - snapshot.jar
- spring-aspects-4.0.0.RELEASE.jar
- hsqldb-2.0.0.jar
- classmate-1.0.0.jar
- jboss-logging-3.1.3.GA.jar
- hibernate-validator-5.0.2.Final.jar
- spring-orm-4.0.0.RELEASE.jar
- hibernate-ehcache-4.3.0.Final.jar
- slf4j-api-1.7.1.jar
- commons-collections-3.2.1.jar
- jackson-core-asl-1.9.13.jar
- spring-expression-4.0.0.RELEASE.jar
- commons-logging-1.1.3.jar
- spring-context-4.0.0.RELEASE.jar
- ehcache-core-2.6.6.jar
- hibernate - jpa 2.1 - api - 1.0.0.final.jar
- spring-webmvc-4.0.0.RELEASE.jar这是我的web.xml文件内容:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>CoMiGeoMediaWeb</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
这是我的plugin.xml文件内容:
<?xml version="1.0" encoding="UTF-8"?>
<plugin id= "mitu.wcm.api.custom"
name= "Spring Custom Action"
version= "1.0.0"
provider-name= "IBM" >
<extension-point id= "CoMiCustomActionFactory" name="CoMiCustomActionFactory" />
<extension point="com.ibm.workplace.wcm.api.CustomWorkflowActionFactory" id= "CoMiCustomActionFactory" >
<provider class= "it.wcm.api.custom.SpringCustomActionFactory"/>
</extension>
</plugin>
当我尝试在WAS 8下部署EAR时,EAR安装是OK的,但是当我尝试启动它时,我得到这个错误:
[3/11/14 9:14:38:719 CET] 000000e7 RegistryLoade W CWXRS0010W: Error while processing: file:/opt/IBM/WebSphere/wp_profile/installedApps/192Cell/CoMiGeoMedia.ear/CoMiGeoMediaWeb.war/WEB-INF/plugin.xml
java.lang.ClassCastException: com.ibm.wkplc.extensionregistry.Extension incompatible with com.ibm.wkplc.extensionregistry.ExtensionPoint
at com.ibm.wkplc.extensionregistry.RegistryCache.putExtensionPoint(RegistryCache.java:341)
at com.ibm.wkplc.extensionregistry.PluginDescriptor.convertObjectsToProxies(PluginDescriptor.java:296)
at com.ibm.wkplc.extensionregistry.ExtensionRegistry.addPlugin(ExtensionRegistry.java:339)
at com.ibm.wkplc.extensionregistry.ExtensionRegistry.addPlugin(ExtensionRegistry.java:319)
at com.ibm.wkplc.extensionregistry.RegistryLoader.loadPluginXml(RegistryLoader.java:482)
我将完整的日志添加到问题中。有人能告诉我我哪里错了吗?是春天和冬眠导致列出的错误?我怎么解它?
尝试下面的plugin.xml文件-注意属性的顺序和属性名称/值的空白的删除:
<?xml version="1.0" encoding="UTF-8"?>
<plugin provider-name="IBM" version="1.0.0" name="Spring Custom Action" id="com.ibm.workplace.wcm.api.custom">
<extension-point name="CoMiCustomActionFactory" id="CoMiCustomActionFactory" />
<extension point="com.ibm.workplace.wcm.api.CustomWorkflowActionFactory" id="CoMiCustomActionFactory" >
<provider class="it.wcm.api.custom.SpringCustomActionFactory"/>
</extension>
</plugin>
希望这对你有帮助。确保您有包含的JAR文件,以便编译代码。您还需要:
- ilwwcm-api.jar -位于:$PORTAL_HOME$/wcm/preeq .wcm/wcm/shared/app
- wp.base.jar -位于:$PORTAL_HOME$/base/wp.base/shared/app
您还需要确保在部署应用程序时,它与WebSphere_Portal实例绑定并且它的启动行为(Enterprise Applications -> Deployed_WAR -> Startup Behavior)将其启动顺序设置为30 (WCM的默认值)。
Pete。