Datasource
568364Apr 12 2007 — edited Jun 29 2009I want to add a servlet to my ADF app. I already created it and adeded the servlet and servlet-mapping in web.xml
I wantto get a connection from my Data Source, i created it in the EMbebed OC4J Server preferences. Its the one my adf app uses and it works.
My code:
InitialContext ic = new InitialContext(); // JNDI initial context
DataSource ds = (DataSource) ic.lookup("jdbc/OracleDS"); // JNDI lookup
the name of the ds is jdbc/OracleDS
but i get the following error:
07/04/12 21:40:38 Hola
07/04/12 21:40:38 javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
07/04/12 21:40:38 javax.naming.NamingException: Not in an application scope - start OC4J with the -userThreads switch if using user-created threads
07/04/12 21:40:38 at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:30)
07/04/12 21:40:38 at com.evermind.naming.FilterContext.lookup(FilterContext.java:126)
07/04/12 21:40:38 at com.evermind.server.PreemptiveApplicationContext.lookup(PreemptiveApplicationContext.java:42)
07/04/12 21:40:38 at javax.naming.InitialContext.lookup(InitialContext.java:351)
how can i sort this?
thanks