aspose file tools*
The moose likes BEA/Weblogic and the fly likes Naming Exception while Jndi Lookup for DataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Naming Exception while Jndi Lookup for DataSource " Watch "Naming Exception while Jndi Lookup for DataSource " New topic
Author

Naming Exception while Jndi Lookup for DataSource

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi i am using Weblogic 11g

I had created a Datasource in it from Services/JDBC/DataSources and assigned it a name JNDIDataSource .


But from my jsp page when i am looking for it It is displaying as

Unable to resolve JNDIDataSource .

I had used differnt options like

1. Putting the properties and passing it to the InitailContext.

2. Used java:comp/env/JNDIDataSource , java:comp/JNDIDataSource .

But all in waste ,so please let me know where i am doing wrong .

(Sorry for my English Its very poor )


Save India From Corruption - Anna Hazare.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Browse your JNDI tree. This will tell you where the object is bound. Perhaps it was not bound at all ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234



Could you please tell me how can i found this ??

THanks in advance
Pawel Nowacki
Ranch Hand

Joined: Nov 14, 2008
Posts: 67
In my Weblogic 10.3 I can look it up through console in web browser under Enviroment->Servers->Choose your server from the table and click its name->There is a link above table in general tab "View JNDI Tree".
I bet there are another ways to get it (some scripts for example) but this is quite fast.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi ,

When i clicked on the View JNDI Tree Tab it is displaying nothing .

But i can see i have configured myDBPool under DataSources and its successfully done .

Please help me with what name i should look to the DataSource under Context.lookup??
Renjan Thomas
Ranch Hand

Joined: Jan 09, 2009
Posts: 49

check the target of your datasource...whether it is properly targeted to the cluster or server whichever you have configured.
Renjan Thomas
Ranch Hand

Joined: Jan 09, 2009
Posts: 49
check the target of your datasource...whether it is properly targetted to the cluster or server whichever you have configured.

I guess..it will be your datasource jndi name....
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

hey Thomas ,

Thanks for your time , atlast it worked .

THank you very much .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Naming Exception while Jndi Lookup for DataSource