Datasource Lookup in webloic 8.1 & Jboss


General J2EE: Datasource Lookup in webloic 8.1 & Jboss

  1. Datasource Lookup in webloic 8.1 & Jboss (2 messages)


    i have a application which works fine on JBOSS server.
    it uses 'java:/decapool' as datasource name(jndi name).
    now i have to migrate this application on weblogic...but when i try to create a datasource with 'java:/decapool' as jndi name it is giving me error.

    if i use only 'decapool' as datasource name(jndi name) in weblogic then it works fine...
    but then i don't want to change any file for incorporating different datasource name for different servers.

    is there any way thro' which i can configure 'java:/decapool' as datasource jndi name in weblogic.

  2. There should be no reason to tie to a specific Datasource JNDI name. Your app should factor out this info and be flexible enough if you want to move between app server
  3. I suppose that you use ant when building your deployables. I supopose you can set an environment variables that can be used in your build process. For example when
    using XDoclet it wuold look something like this :
    <target name="xdoclet.ejb">
      <ejbdoclet destdir="${project.root.dir}" >
         <jboss version="3.0" xmlencoding="UTF-8" destdir="${src.dir}/META-INF" datasource="${datasource.jboss}" datasourceMapping="PostgreSQL" />
         <weblogic version="7.0" xmlencoding="UTF-8" destdir="${src.dir}/META-INF" datasource="${datasource.weblogic}" />