0 Replies Latest reply: Jun 13, 2013 5:03 PM by 990435 RSS

    new InitialContext() gets String index out of bounds

    990435

      Context ctx = null;

      ctx = new InitialContext();

      DataSource dataSource = (DataSource) ctx.lookup("jdbc/datasource");

      connection = dataSource.getConnection();

       

      I get:

       

      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)

       

      Earlier when I had provider_url specified I didn't get this problem, but it should be working without specifing provider_url...

      And well now it doesn't work with provider_url localhost since they set -Djava.net.preferIPv4Stack=true

      Which made so it stopped listening to localhost:port...


      Does someone know a possible solution for:

      1. String index of range

      2. the preferIPv4Stack thingy, which makes the listeners to stop listening to localhost:port