in Education by
When I try the following lookup in my code: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); return (DataSource) envCtx.lookup("jdbc/mydb"); I get the following exception: java.sql.SQLException: QueryResults: Unable to initialize naming context: Name java:comp is not bound in this Context at com.onsitemanager.database.ThreadLocalConnection.getConnection (ThreadLocalConnection.java:130) at ... I installed embedded JBoss following the JBoss wiki instructions. And I configured Tomcat using the "Scanning every WAR by default" deployment as specified in the configuration wiki page. Quoting the config page: JNDI Embedded JBoss components like connection pooling, EJB, JPA, and transactions make extensive use of JNDI to publish services. Embedded JBoss overrides Tomcat's JNDI implementation by layering itself on top of Tomcat's JNDI instantiation. There are a few > reasons for this: To avoid having to declare each and every one of these services within server.xml To allow seemeless integration of the java:comp namespace between web apps and EJBs. Tomcat's JNDI implementation has a few critical bugs in it that hamper some JBoss components ability to work We want to provide the option for you of remoting EJBs and other services that can > be remotely looked up Anyone have any thoughts on how I can configure the JBoss naming service which according to the above quote is overriding Tomcat's JNDI implementation so that I can do a lookup on java:comp/env? FYI - My environment Tomcat 5.5.9, Seam 2.0.2sp, Embedded JBoss (Beta 3), Note: I do have a -ds.xml file for my database connection properly setup and accessible on the class path per the instructions. Also note: I have posted this question in embedded Jboss forum and seam user forum. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Thanks for the response toolkit.... yes, I can access my datasource by going directly to java:jdbc/mydb, but I'm using an existing code base that connects via the ENC. Here's some interesting info that I've found out .... The above code works with JBoss 4.2.2.GA and here's the JNDI ctx parameters being used: java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces: org.jboss.naming:org.jnp.interfaces The above code works with Tomcat 5.5.x and here's the JNDI ctx parameters being used: java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory java.naming.factory.url.pkgs=org.apache.naming The above code fails with Embedded JBoss (Beta 3) in Tomcat 5.5.x with the above error message. java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory java.naming.factory.url.pkgs=org.apache.namingThe above code fails with the above error using JBoss Embedded in tomcat 5.5.x Anyone have any thoughts I what I need to do with configuring embedded JBoss JNDI configuration?

Related questions

0 votes
    I am trying to override the tomcat session manager with an embedded tomcat. These are the steps preformed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    How to override or replace the Embedded tomcat server in Spring Boot?...
asked Jul 7, 2021 in Technology by JackTerrance
0 votes
    Is it possible to change the port of the embedded Tomcat server in Spring Boot?...
asked Jul 7, 2021 in Technology by JackTerrance
0 votes
    I have a Hello-World application with one java class and one jsp. The JSP prints out some text ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    I have a Hello-World application with one java class and one jsp. The JSP prints out some text ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I tried installing Postgres with OpenSSL by doing ./configure --with-openssl but I got an error saying ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    (5) lll in the blanks :- The body element is embedded within the The tag does not need closing tag is ... displays the biggest heading, Select the correct answer from above options...
asked Dec 2, 2021 in Education by JackTerrance
0 votes
    What is JNDI? Explain its terms in terms of EJB....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Application level gateway firewalls are also used for configuring cache-servers. (a) True (b) False I got this ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    Fill in the blanks: If X follows binomial distribution with parameters n = 5, p and P (X = 2) = 9.P (X = 3), then p = ___________ Select the correct answer from above options...
asked Nov 19, 2021 in Education by JackTerrance
0 votes
    A random variable X takes the values 0,1,2,3,..., with prbability PX(=x)=k(x+1)( 1 5 )x, where k is a ... 16 25 C. 18 25 D. 19 25 Select the correct answer from above options...
asked Nov 16, 2021 in Education by JackTerrance
0 votes
    Two integers xandy are chosen with replacement out of the set {0,1,,2,3,10} . Then find the probability that |x-y ... 25 121 D. 20 121 Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
0 votes
0 votes
    Find the phase constant of a wave travelling with a velocity of 1.2 x 108 and a frequency ... proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 6, 2021 in Education by JackTerrance
...