facebook

why not java:comp/env?

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

    augustfox
    Member

    i am new in myeclipse,before i only used WSAD.
    when connected to a DB2 datasource,i used
    context.lookup(“java:comp/env/jdbc/njscsc”),
    but it failed,the error message is
    “java.lang.RuntimeException: No data source”

    then i changed to context.lookup(“java:jdbc/njscsc”),it was running.
    why?

    thanks a lot!

    #242521

    Riyad Kalla
    Member

    Hard to say, what application server are you using? Are you connecting to this data source from your running web application? You sure that using jdbc/njscsc wouldn’t have worked with your old setup? (I don’t know much about JNDI, but I wonder if /comp/env is implied and can be ommitted?)

    #242570

    augustfox
    Member

    i am using jboss4.0.1sp1.
    In Websphere,if not using java:comp/env/jdbc/njscsc,only using jdbc/njscsc,
    it can run well,but will give you a warning.

    but “java:comp/env/” is the Java standard ref using of JNDI.
    thanks!

    #242575

    Riyad Kalla
    Member

    Sorry augustfox I really don’t know why one server accepts it and the other doesn’t.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: why not java:comp/env?

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