Error in Registering the portlet - Websphere

This is a discussion on Error in Registering the portlet - Websphere ; Hi All, I've created a portlet Application. This portlet application contain portlet and servlet. There are certain classes which are commond for both. I've bundled in a jar file and kept at EAR level and gave entry in MANIFEST.MF file. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Error in Registering the portlet

  1. Error in Registering the portlet

    Hi All,

    I've created a portlet Application. This portlet application contain portlet and servlet. There are certain classes which are commond for both. I've bundled in a jar file and kept at EAR level and gave entry in MANIFEST.MF file.

    Application has been deployed successfully now when I execute the RegisterPreDeployedEAR.xml file for portlet application it generates class not found exception because that file is not peresent in portlet war WEB-INF/lib directory instead it is at EAR level.

    If I keep jar file (which has class file) in porlet war WEB-INF/lib directory register of portlet is run successfully.

    I can't keep jar (because it has other class file also) in portlet war WEB-INF/lib directory. Can any one help to overcome the problem?

    Regards,
    Deepak Bhatia

  2. Re: Error in Registering the portlet

    Hi there,

    This info comes from RAD help, keypoints are highlighted:
    http://publib.boulder.ibm.com/infoce...rtletj2ee.html

    ----------
    To make the portlet's EJB project and its utility JAR files available on a remote WebSphere Portal server, you must manually deploy the portlet EAR that contains the dependent utility JAR files from your development machine to the remote server's shared/app directory.

    * Identify all J2EE modules referenced from your portlets and manually deploy them to the remote WebSphere Portal server before testing/deploying the portlets. For more information, refer to Adding modules to an enterprise application
    * Add the necessary classes to the portlet project:
    o When referencing EJBs, create an EJB client jar from the EJB project, then add it to the portlet project.
    o When referencing utility JAR's, export the referenced utility JAVA project to a JAR and include it in the portlet project.

    This procedure is similar to those for deploying an EJB project EAR to a WebSphere Application Server. For further information on how to deploy J2EE-based modules, dependent utility JAR files, or data sources to a remote server, refer to the WebSphere Application Server Infocenter.
    ------------

    And reading from the JSR 168 spec (page 73):
    ---------
    Portlet classes, utility classes and other resources accessed through the portlet application classloader must reside within the /WEB-INF/classes directory or within a JAR file in the /WEB-INF/lib/ directory.
    ---------


    You could put a jar in [portalserver]/shared/app but I since it would put your classes in global scope i guess that ain't gonna happen ;-)
    I recommend you look in the WAS infocenter for getting more control over class-references.

    Hope that helps,
    /Jonas V


+ Reply to Thread