I'm working on a Grails application that needs to connect to a Oracle database using a LDAP context. The URL format is something like the following:
jdbc:oracle:thin:@ldap://tns.mycompany.com:389/marketing,cn=OracleContext,dc=com,dc=marketing
I'm also not using the Grails DataSource.groovy configuration for this. I'm managing a separate DataSource in the resources.groovy using Spring DSL. I'm using the org.springframework.jdbc.datasource.DriverManagerDataSource. I have not tried this with the standard DataSource.groovy stuff. When I first tried using this, I would get an exception with the following text: "javax.naming.NotContextException Not an instance of DirContext". There seems to be a bug with the Spring LDAP and the SimpleNamingContextBuilder class. Basically the SimpleNamingContextBuilder returns a Context implementation, not a DirContext implementation. You can work around this in Grails by adding the following to the Config.groovy file:
grails.naming.entries = null
Problem solved. The DataSource now bootstraps correctly and I can go on my merry way. Kudos to Luke Daley for bringing this to my attention.
Do you know how to keep a good mood. Just remember to pay attention to the fashion trend of Paris Hermes such as Hermes Constance Handbag or the other styles like Kelly Hermes Bag. I promise you will relax yourself. So come on, know more fashion style arround you and make yourself more confidence. You will like it.
ReplyDeleteHey, i kind of am getting the same error but on different platforms. I am working on a JSP app connected to an LDAP and every time i run the web page i am getting the Not an instance of DirContext. how exactly did you work it out, maybe i might get a hint.
ReplyDeleteGreat and Useful Article.
ReplyDeleteJava Online Course
Java Online Training
Java EE training
Java Course in Chennai
Java Training in Chennai
Java Training Institutes in Chennai
Java Interview Questions
Java Interview Questions
Nice information Good Post,Looking for more blogs.
ReplyDeletePlease look here at
Best Astrologer in Rajarajeshwari Nagar
Well post,keep posting this.
ReplyDeletevisit oue website
Best Sofa Repair Services in C V Raman Nagar