facebook

Websphere 5 deployment question [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #212000 Reply

    elmilo
    Member

    Hi,

    Having been able to deploy successfully to jboss, iIm now trying to deploy to Websphere 5 using a generated ear from eclipse.

    When deploying (manually using the console), my ejb has not been bound to a jndi name. I’ve provided the 2 deployment descriptors, ejb-jar.xml and ibm-ejb-jar-bnd.xmi:

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE ejb-jar PUBLIC “-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN” “http://java.sun.com/dtd/ejb-jar_2_0.dtd”&gt;

    <ejb-jar >

    <description><![CDATA[No Description.]]></description>
    <display-name>Generated by XDoclet</display-name>

    <enterprise-beans>

    <!– Session Beans –>
    <session >
    <description><![CDATA[TestWebpshereBean EJB]]></description>
    <display-name>TestWebpshereBean</display-name>

    <ejb-name>TestWebpshereBean</ejb-name>

    <home>mac.interfaces.TestWebpshereBeanHome</home>
    <remote>mac.interfaces.TestWebpshereBean</remote>
    <ejb-class>mac.ejb.TestWebpshereBeanSession</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>

    <!–
    To add session beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    –>

    <!– Entity Beans –>
    <!–
    To add entity beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    –>

    <!– Message Driven Beans –>
    <!–
    To add message driven beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    –>

    </enterprise-beans>

    <!– Relationships –>

    <!– Assembly Descriptor –>
    <assembly-descriptor >
    <!–
    To add additional assembly descriptor info here, add a file to your
    XDoclet merge directory called assembly-descriptor.xml that contains
    the <assembly-descriptor></assembly-descriptor> markup.
    –>

    <!– finder permissions –>

    <!– transactions –>

    <!– finder transactions –>
    </assembly-descriptor>

    </ejb-jar>

    <ejbbnd:EJBJarBinding xmi:version=”2.0″
    xmlns:xmi=”http://www.omg.org/XMI&#8221; xmlns:ejbbnd=”ejbbnd.xmi”
    xmlns:ejb=”ejb.xmi” xmlns:commonbnd=”commonbnd.xmi”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xmi:id=”ejb-jar_ID_Bnd”>

    <ejbJar href=”META-INF/ejb-jar.xml#ejb-jar_1″/>

    <ejbBindings
    xmi:id=”Session_bnd_1″
    jndiName=”ejb/mac/TestWebpshereBeanHome”>

    <enterpriseBean
    xmi:type=”ejb:Session” href=”META-INF/ejb-jar.xml#SessionTestWebpshereBean” />
    </ejbBindings>

    </ejbbnd:EJBJarBinding>

    Any idea why I can’t deploy the bean with the jndi name? The bind file seems to use a name that doesn’t exist in the standard ejb-jar.xml, but i’m unsure as to websphere’s requirement to bind the beans to jndi names.

    Maybe there needs to be extra configuration in the xdoclet to deploy to websphere?

    Thanks for your time

    #212005 Reply

    Riyad Kalla
    Member

    I’ve asked another support person to have a look at this.

    #212011 Reply

    Scott Anderson
    Participant

    Just guessing, I’d say there’s no way to tie the binding the the .xmi file back to ejb-jar.xml. This is typically done using the <ejb-name> attribute. However, in ejb-jar.xml you have:

    
     <ejb-name>TestWebpshereBean</ejb-name> 
    

    and the xmi file references this:

    
     <enterpriseBean
    xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#SessionTestWebpshereBean" /> 
    

    Note that one of them is TestWebsphereBean and the other is SessionTestWebsphereBean

    #212094 Reply

    elmilo
    Member

    Hey,

    I noticed this as an issue in the deployment descriptor, I’ve also noticed that there is no id in the standard ejb-jar.xml, whereas when using WSAD an id is generated for the session bean.

    Looking around for known problems, I found some for XDoclet with relation to Websphere 5:
    http://opensource.atlassian.com/projects/xdoclet/browse/XDT-12
    http://opensource.atlassian.com/projects/xdoclet/browse/XDT-526

    Do you know if this has been tested, i.e. Can I write and generate appropriate bean and deployment descriptors for websphere 5 using myeclipse, with bound jndi names and so not having to complete these in the admin console during deployment of my ear.

    Thanks

    #212097 Reply

    elmilo
    Member

    Hi,

    been playing around, and come up with two issues:

    1- The attribute ‘id’ for the element ‘session’ is requried in the ejb-jar.xml to allow the binding to happen
    2- For some reason none of the app server specific deployment descriptors are being packaged under the META-INF directory which is stopping them being used. I can manually copy them and everything works fine

    ejb-jar.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    
    <ejb-jar >
    
       <description><![CDATA[No Description.]]></description>
       <display-name>Generated by XDoclet</display-name>
    
       <enterprise-beans>
    
          <!-- Session Beans -->
          <session id="WebsphereBean">
             <description><![CDATA[WebsphereBean EJB]]></description>
             <display-name>WebsphereBean</display-name>
    
             <ejb-name>WebsphereBean</ejb-name>
    
             <home>mac.interfaces.WebsphereBeanHome</home>
             <remote>mac.interfaces.WebsphereBean</remote>
             <ejb-class>mac.ejb.WebsphereBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
    
          </session>
    
         <!--
           To add session beans that you have deployment descriptor info for, add
           a file to your XDoclet merge directory called session-beans.xml that contains
           the <session></session> markup for those beans.
         -->
    
          <!-- Entity Beans -->
         <!--
           To add entity beans that you have deployment descriptor info for, add
           a file to your XDoclet merge directory called entity-beans.xml that contains
           the <entity></entity> markup for those beans.
         -->
    
          <!-- Message Driven Beans -->
         <!--
           To add message driven beans that you have deployment descriptor info for, add
           a file to your XDoclet merge directory called message-driven-beans.xml that contains
           the <message-driven></message-driven> markup for those beans.
         -->
    
       </enterprise-beans>
    
       <!-- Relationships -->
    
       <!-- Assembly Descriptor -->
       <assembly-descriptor >
         <!--
           To add additional assembly descriptor info here, add a file to your
           XDoclet merge directory called assembly-descriptor.xml that contains
           the <assembly-descriptor></assembly-descriptor> markup.
         -->
    
       <!-- finder permissions -->
    
       <!-- transactions -->
    
       <!-- finder transactions -->
       </assembly-descriptor>
    
    </ejb-jar>

    ibm-ejb-jar-bnd.xml:

    <ejbbnd:EJBJarBinding xmi:version="2.0"
       xmlns:xmi="http://www.omg.org/XMI" xmlns:ejbbnd="ejbbnd.xmi"
       xmlns:ejb="ejb.xmi" xmlns:commonbnd="commonbnd.xmi"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmi:id="ejb-jar_ID_Bnd">
    
       <ejbJar href="META-INF/ejb-jar.xml#ejb-jar_1"/>
    
          <ejbBindings
             xmi:id="Session_bnd_1"
             jndiName="ejb/WebsphereBeanHome">
    
             <enterpriseBean
                xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#WebsphereBean" />
          </ejbBindings>
    
    </ejbbnd:EJBJarBinding>

    So, for some reason the id is never created from the XDoclet for the ejb-jar.xml. Having the id here has no bearing on deployment to other servers, as I just deployed the same ear to weblogic and it worked fine.

    And, my descriptors are not being packaged in the META-INF directory, presumably I can just change a setting for this to work?

    Thanks

    #212098 Reply

    Scott Anderson
    Participant

    elmilo,

    And, my descriptors are not being packaged in the META-INF directory, presumably I can just change a setting for this to work?

    Yes, you need to change the destDir setting on the websphere subtask in the xdoclet configuration for your project. Full documentation for that subtask is available here:
    http://xdoclet.sourceforge.net/ant/xdoclet/modules/ibm/websphere/ejb/WebSphereSubTask.html

    As far as generating the id attribute on session, I believe you just need to set the ‘useIds’ field in the websphere doclet also.

    #212105 Reply

    elmilo
    Member

    Hey,

    All good, working perfectly,

    All the best

    #212107 Reply

    Scott Anderson
    Participant

    elmilo,

    Glad to hear it! Now show everyone else at your rather large company how great it is. 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Websphere 5 deployment question [Closed]

You must be logged in to post in the forum log in