jetty - JNDI not working in JUnit after upgrading Wicket from 6.20 to 7.0 -
i decided upgrade recent wicket project 6.20 7.0. quite smooth main code, had problem setup code jndi in junit environment. using : try { // create , bind jndi resource database connection initialcontext ic = new initialcontext(); ic.createsubcontext("java:comp/env"); ic.createsubcontext("java:comp/env/jdbc"); sqlserverconnectionpooldatasource ds = new sqlserverconnectionpooldatasource(); ds.seturl("jdbc:sqlserver://localhost:1433;databasename=myproject;username=myuser;password=mypassword"); ic.bind("java:comp/env/jdbc/myproject", ds); } catch (exception e) { e.printstacktrace(); } this worked fine wicket 6.20, throws javax.naming.noinitialcontextexception on call createsubcontext(). after fruitless experimentation, key information in http://www.eclipse.org/jetty/documentation/current/jndi-embedded.html . with change jetty 7 jetty 9 between ...