Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weblogic initialContext returns String out of range

 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a lookup in our dev environment which looked up our Data Resource in Weblogic using CONTEXT_URL:


However this does not work in our test environment due to they have set a weblogic flag: Djava.net.preferIPv4Stack=true.

The documentation for this says the URL is not needed, http://docs.oracle.com/cd/E11035_01/wls100/jndi/jndi.html
When i do this without the settings(hashtable properties) only using:

The Data Source in Weblogic has JNDI Name test. http://docs.oracle.com/cd/E24329_01/web.1211/e21049/configureresources.htm

weblogic.xml
web.xml
Of some reason i get the following error:
String index out of range: -1
weblogic.jndi.Environment.getContext(Environment.java:308)
weblogic.jndi.Environment.getContext(Environment.java:285)
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
javax.naming.InitialContext.init(InitialContext.java:223)
javax.naming.InitialContext.<init>(InitialContext.java:175)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic