Customer Portal

How to access JNDI datasource defined in weblogic

Comments 5

  • Avatar
    imriskal
    0
    Comment actions Permalink
    Hello, chaitanya_r,

    Please try to replace java:/comp/env/jdbc/mydb with jdbc/mydb

    Let me know if this does not help, please.

    Best regards,
  • Avatar
    chaitanya_r
    0
    Comment actions Permalink
    Thanks a lot for replying. I am getting below error after changing to jdbc/mydb

    Cannot establish DB connection to JNDI:jdbc/mydb While trying to lookup 'jdbc.mydb' didn't find subcontext 'jdbc'. Resolved '' caused by: javax.naming.NameNotFoundException: While trying to lookup 'jdbc.mydb' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/mydb'

    Please let me know if I am missing anything else. I have created the JNDI datasource in my weblogic server with name as 'jdbc/mydb'
  • Avatar
    admin
    0
    Comment actions Permalink
    Hi chaitanya_r,

    we checked that on one of our test servers. Please take a look on attached screenshot.

    Also we checked that:
    * "jdbc/TestDB" works
    * but "java:comp/env/jdbc/TestDB" does not

    on WebLogic.

    Seems to us, there is issue with getting DataSource. Potential troubles:
    * Do you really configured data source with "jdbc/TestDB" name? Please check typos in both Weblogic console and CloverETL Server
    * Check upper/lower case.

    I hope this helps.
  • Avatar
    chaitanya_r
    0
    Comment actions Permalink
    Thanks,

    Yes I have created the datasource object using JNDI similar to the screenshot you have give below. But still I am facing this issue. Is there anything else that I need to check because the error says that it is trying to look inside clover.war:

    caused by: javax.naming.NameNotFoundException: While trying to look up /comp/env/jdbc/mydb in /app/webapp/clover.war/1811641702.;

    I have created the JNDI for datasource using weblogic console, but how can I map that to clover web application. Is there any additional step which I am missing here?
  • Avatar
    imriskal
    0
    Comment actions Permalink
    Hi, chaitanya_r,

    There is no additional step. You just have to properly create datasource (the easiest way is usually sufficient) and war application started in the same environment. That is all. Application should be able to to get to the datasource via short JNDI name "jdbc/TestDB". If you have some more advanced deployment, your administrator should be able to set datasource properly.

    Best regards,

Please sign in to leave a comment.