Angelo Immediata
Angelo Immediata

Reputation: 6954

IBM WCM 8, Spring 4

I'm pretty new to IBM WCM and IBM Portal; I'm using the following versions:

I need to create a custom action for the WCM workflow; so far I was able in creating a very simple custom action by following this link: WCM Custom Action

Now I need to create a more complex custom action; in my custom action I would like to use spring 4.0 and Hibernate 4.3.0; so I created an EAR file and a WAR module; in my WAR module, under WEB-INF/lib directory I have the following jars:

<?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>

This is my plugin.xml file content:

<?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>

When I try to deploy the EAR under my WAS 8, the EAR installation is OK but when I try to start it, I get this error:

[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)

I add the full log to the question. Can anybody tell me where I'm wrong? Are spring and hibernate causing the listed error? Ho can I solve it?

Upvotes: 0

Views: 534

Answers (1)

WartookMan
WartookMan

Reputation: 1

Try the following plugin.xml file - take note of the attribute ordering and removal of whitespace for the attributes names/values:

<?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>

Hope this helps. Ensure that you have the included JAR files in order to compile the code. You'll also need:

  • ilwwcm-api.jar - located in: $PORTAL_HOME$/wcm/prereq.wcm/wcm/shared/app
  • wp.base.jar - located in: $PORTAL_HOME$/base/wp.base/shared/app

You'll also need to ensure that when deploying the application, that's it's tied to the WebSphere_Portal instance AND that it's Startup Behavior (Enterprise Applications --> Deployed_WAR --> Startup Behavior), has it's start up Order set to 30 (default for WCM).

Pete.

Upvotes: 0

Related Questions