Discussions

EJB programming & troubleshooting: Problems in configuring deployment descriptors to use EJB in JSP

  1. Hello,

    I've been trying to use an EJB in a JSP on Weblogic 8.1. The relevent part of my web.xml and weblogic.xml look like this:
    =====================================
    web.xml -

      <ejb-ref>
        <description>Purchase order bean deployed</description>
        <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <home>mypackage2.PurchaseorderHome</home>
        <remote>mypackage2.Purchaseorder</remote>
        <ejb-link>/PO.jar#Purchaseorder</ejb-link>

      </ejb-ref>

      <ejb-local-ref>
        <description>purchase order</description>
        <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
        <local-home>mypackage2.PurchaseorderLocalHome</local-home>
        <local>mypackage2.PurchaseorderLocal</local>
        <ejb-link>/PO.jar#Purchaseorder</ejb-link>
      </ejb-local-ref>
    =====================================

    weblogic.xml -
    <ejb-reference-description>
    <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
    <jndi-name>Purchaseorder</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    =================================
    My ejb-jar.xml file looks like this (this EJB jar is already deployed on Weblogic):

          <description>Entity Bean ( CMP )</description>
          <display-name>Purchaseorder</display-name>
          <ejb-name>Purchaseorder</ejb-name>
          <home>mypackage2.PurchaseorderHome</home>
          <remote>mypackage2.Purchaseorder</remote>
          <local-home>mypackage2.PurchaseorderLocalHome</local-home>
          <local>mypackage2.PurchaseorderLocal</local>
          <ejb-class>mypackage2.PurchaseorderBean</ejb-class>
      ==============================================
    Finally, my weblogic-ejb-jar.xml looks like this:

    <weblogic-ejb-jar>
      <weblogic-enterprise-bean>
        <ejb-name>Purchaseorder</ejb-name>
        <jndi-name>Purchaseorder</jndi-name>
      </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ===============================================

    But despite many many efforts, I keep getting the following error:

    Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or ejb-local-ref 'ejb/Purchaseorder' in the application module 'public_html' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or ejb-local-ref 'ejb/Purchaseorder' in the application module 'public_html' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct. at

    I have changed around a lot of things. I've a classes directory under web-inf where I have mypackage2\all-the-class-files. I've also made available PO.jar file (which contains Purchaseorder) at various levels to ensure that the class can be found. I've changed the "/PO.jar#Purchaseorder" value of <ejb-link> tag accordingly to try various things. (e.g ejb/Purchaseorder, mypackage2.Purchaseorder, and a lot of other things) but of no avail. I keep getting the same error over and over again. (Do you think banging my head on the wall would do the trick?)

    Any help would be greatly appreciated. Thanks.

    Threaded Messages (1)

  2. deployment[ Go to top ]

    Why u r using this (#) symbol in ejb local reference