jndi

What is JNDI? What is its basic use? When is it used?

China☆狼群 提交于 2019-11-26 11:44:25
问题 What is JNDI ? What is its basic use? When is it used? 回答1: What is JNDI ? It stands for Java Naming and Directory Interface. What is its basic use? JNDI allows distributed applications to look up services in an abstract, resource-independent way. When it is used? The most common use case is to set up a database connection pool on a Java EE application server. Any application that's deployed on that server can gain access to the connections they need using the JNDI name java:comp/env

Name [jdbc/mydb] is not bound in this Context

橙三吉。 提交于 2019-11-26 09:36:23
问题 I see this question was raised several times already and I went through all of them. But I am still unable to fix my problem. Could anyone help me pinpoint what I am doing wrong? I get the following error message when I try to access database.jsp: HTTP Status 500 - An exception occurred processing JSP page /database.jsp at line 24 type Exception report message An exception occurred processing JSP page /database.jsp at line 24 description The server encountered an internal error that prevented

Tomcat vs Weblogic JNDI Lookup

守給你的承諾、 提交于 2019-11-26 08:10:42
问题 The Weblogic servers we are using have been configured to allow JNDI datasource names like \"appds\". For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on \"java:comp/env/jdbc/*\" in the JNDI tree. Problem: in Weblogic, the JNDI lookup is \"appds\" whilst in Tomcat, it seems that that I must provide the formal \"java:comp/env/jdbc/appds\". I\'m afraid the Tomcat version is an implicit standard

Cannot create JDBC driver of class &#39; &#39; for connect URL &#39;null&#39; : I do not understand this exception

拟墨画扇 提交于 2019-11-26 04:48:56
问题 Why does it say null URL and gives a empty \' \' class in the exception when I have provided the database URL? I am trying to connect to a derby database via a servlet while using Tomcat. When the servlet gets run, I get the following exceptions: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class \'\' for connect URL \'null\' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452) at org.apache.tomcat.dbcp.dbcp

The meaning of NoInitialContextException error

二次信任 提交于 2019-11-26 03:35:58
问题 I am writing a client for my EJB and when trying to execute it, I get the following exception : javax.naming.NoInitialContextException : Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file. I just can\'t understand what the problem is. 回答1: The javax.naming package comprises the JNDI API. Since it's just an API, rather than an implementation, you need to tell it which implementation of JNDI to use. The implementations are

How to use JNDI DataSource provided by Tomcat in Spring?

China☆狼群 提交于 2019-11-26 03:29:03
问题 It is said that in the Spring javadoc article about DriverManagerDataSource class, that this class is very simple and that it is recommended to use a JNDI DataSource provided by the container. Such a DataSource can be exposed as a DataSource bean in a Spring ApplicationContext via JndiObjectFactoryBean The question is: how do I accomplish this? For example, if I wish to have DataSource bean to access my custom MySQL database, what would I require then? What should I write in the context

How to create JNDI context in Spring Boot with Embedded Tomcat Container

谁都会走 提交于 2019-11-26 03:08:10
问题 import org.apache.catalina.Context; import org.apache.catalina.deploy.ContextResource; import org.apache.catalina.startup.Tomcat; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.boot.context.embedded.tomcat