Topic
  • 7 replies
  • Latest Post - ‏2013-06-17T20:08:26Z by flavio_b
flavio_b
flavio_b
19 Posts

Pinned topic How to bind JNDI resource during Eclipse Deployment

‏2013-05-20T07:05:40Z |

Hello,

I am developing a web application where the use of JNDI resource is needed.

Indeed, I defined the following piece of code within the web.xml file:

<resource-ref id="ResourceRef_123">
        <res-ref-name>MY_CONFIG_DIR</res-ref-name>
        <res-type>java.lang.String</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
 </resource-ref>

 

When I build the application and then I want to deploy the EAR using the Websphere WEB console, I can perform the step where you specify the binding between MY_CONFIG_DIR and APP_CONFIG_DIR, where APP_CONFIG_DIR is a JNDI property defined in Environment -> Naming -> Name Space Bindings.

All works fine, since I am deploying through the WAS console, but I have some problem in development environment. Actually, I cannot perform the step described above (i.e. the binding between MY_CONFIG_DIR and APP_CONFIG_DIR), when deploying directly from Eclipse through the WAS plugin.

How can this be done in eclipse during the deployment phase? I've read something about deployment descriptor but I didn't understand how to solve.

Thanks

  • ktsao
    ktsao
    3 Posts
    ACCEPTED ANSWER

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-04T19:06:53Z  
    • flavio_b
    • ‏2013-05-29T21:29:56Z

    Hello, 

    I use Java EE 5, and higher versions.

    Don't you think 1.4 is a little bit old? ;-) :P

    Hi, it sounds like you need to specify the bindings in the ibm-web-bnd.xml file.  For more information on how to configure this file, you can refer to these instructions:

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.javaee.doc%2Ftopics%2Ftcreateconfigresref.html

  • LenTheivendra
    LenTheivendra
    2 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-05-28T20:56:36Z  

    Hell,  would like to get some more information. Are you using a Java EE 5 or above application, or J2EE 1.4 app?

  • flavio_b
    flavio_b
    19 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-05-29T21:29:56Z  

    Hell,  would like to get some more information. Are you using a Java EE 5 or above application, or J2EE 1.4 app?

    Hello, 

    I use Java EE 5, and higher versions.

    Don't you think 1.4 is a little bit old? ;-) :P

  • ktsao
    ktsao
    3 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-04T19:06:53Z  
    • flavio_b
    • ‏2013-05-29T21:29:56Z

    Hello, 

    I use Java EE 5, and higher versions.

    Don't you think 1.4 is a little bit old? ;-) :P

    Hi, it sounds like you need to specify the bindings in the ibm-web-bnd.xml file.  For more information on how to configure this file, you can refer to these instructions:

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.javaee.doc%2Ftopics%2Ftcreateconfigresref.html

  • flavio_b
    flavio_b
    19 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-04T20:25:29Z  
    • ktsao
    • ‏2013-06-04T19:06:53Z

    Hi, it sounds like you need to specify the bindings in the ibm-web-bnd.xml file.  For more information on how to configure this file, you can refer to these instructions:

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.javaee.doc%2Ftopics%2Ftcreateconfigresref.html

    Thank you so much.

     

    This is just what I was looking for!!!

     

    Great hint!!!

  • flavio_b
    flavio_b
    19 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-15T07:08:59Z  
    • ktsao
    • ‏2013-06-04T19:06:53Z

    Hi, it sounds like you need to specify the bindings in the ibm-web-bnd.xml file.  For more information on how to configure this file, you can refer to these instructions:

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.javaee.doc%2Ftopics%2Ftcreateconfigresref.html

    By the way: do you think it would be possible to do the same with shared libraries?

    I have a shared library directory bound to my websphere profile and I need to do the operation described below from within Eclipse, so that every web application has its own binding (because I cannot "share" the shared library to App Server level):

    Applications -> Application Types -> WebSphere enterprise applications:

    MyApplicationEAR -> Shared library references, then select the module and "Reference shared libraries" that goes to

    Shared Library Mapping. There I can bind my shared library to my web application.

     

    Is it possible to do this directly from eclipse?

  • ktsao
    ktsao
    3 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-17T13:52:45Z  
    • flavio_b
    • ‏2013-06-15T07:08:59Z

    By the way: do you think it would be possible to do the same with shared libraries?

    I have a shared library directory bound to my websphere profile and I need to do the operation described below from within Eclipse, so that every web application has its own binding (because I cannot "share" the shared library to App Server level):

    Applications -> Application Types -> WebSphere enterprise applications:

    MyApplicationEAR -> Shared library references, then select the module and "Reference shared libraries" that goes to

    Shared Library Mapping. There I can bind my shared library to my web application.

     

    Is it possible to do this directly from eclipse?

    Hi,

    I assume you have WDT installed?  If so, then you won't be able to configure shared libraries from the tooling.  This feature is only available in RAD.

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.servertools.doc%2Ftopics%2Ftlibraryv6.html

     

     

     

  • flavio_b
    flavio_b
    19 Posts

    Re: How to bind JNDI resource during Eclipse Deployment

    ‏2013-06-17T20:08:26Z  
    • ktsao
    • ‏2013-06-17T13:52:45Z

    Hi,

    I assume you have WDT installed?  If so, then you won't be able to configure shared libraries from the tooling.  This feature is only available in RAD.

    http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.servertools.doc%2Ftopics%2Ftlibraryv6.html

     

     

     

    Hi!

     

    Yes, I have WDT installed. Unfortunately I'm not working with RAD in this moment.

    Thank you for your reply. Perhaps, I have to find a way to deploy using an external tool, like maven for instance. But I didn't find a plugin for WAS7 yet.