jndi

在Tomcat上配置Proxool的DataSource(Jndi)

回眸只為那壹抹淺笑 提交于 2019-12-02 00:06:29
我使用的是Tomcat 6.0.14 + Proxool 0.9.1 Jndi在tomcat下做配置 先把需要的包复制进 %tomcat_path%\lib 需要的包为: proxool-0.9.1.jar proxool-cglib.jar 2个Proxool包,没什么好说的 ojdbc14.jar Oracle-JDBC驱动包 commons-logging-1.0.4.jar logging包,不放进去可能会报错 上面的包放进%tomcat_path%\lib之后,就不需要在项目中引入了,否则会报错 包放入之后,就可以配置Jndi了... 打开%tomcat_path%\conf\context.xml 在里面有一个Context 的Tag <Context> ........ </Context> 在里面插入以下代码 < Resource auth ="Container" delegateProperties ="foo=bar" factory ="org.logicalcobwebs.proxool.ProxoolDataSource" name ="/jdbc/mydatasource" user ="user" password ="password" proxool.alias ="proxool_testdb" proxool.driver-class =

Configure JBOss cache to run on JBoss server 4.2.3.GA

≯℡__Kan透↙ 提交于 2019-12-01 22:02:41
Our commercial application used to run on different application server and letely we started adjust it to run on JBoss server. The problem is that that application runs JBoss cache and as part of the integration with this framework, the web-inf\lib contains the follwing jars: jboss-aop.jar, jbosscache-core.jar, jboss-common.jar, jboss-common-core.jar, jboss-j2ee.jar, jboss-jmx.jar, jboss-logging-spi.jar This causes a problem to use JNDI through the application because the jboss-common-core.jar contain naming package that cause JBoss JNDI to work incorrect. So I need to find a way to organise

Tomcat: what is the init context params to use for making an external client connection to Tomcat 5.5 JNDI tree?

房东的猫 提交于 2019-12-01 21:57:59
Currently I am using this for JBoss, but I need something also for an external Tomcat: Properties props = new Properties(); props.put(Context.PROVIDER_URL, "jnp://localhost:1099"); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client"); props.put("j2ee.clientName", "abtest"); Searching with Google I find this ones, but I am not able to figure out what Tomcat's port configuring to accept JNDI connection... props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");

JNDI lookup failing with Jetty for JDBC connection pooling with MySQL?

蓝咒 提交于 2019-12-01 21:22:51
I'm using Jetty 9.2 (embedded) with the standard MySQL connector API and I'm very confused by how this is supposed to be setup. Currently, I have this in my web.xml file: <webapp ... <resource-ref> <description>JDBC Data Source</description> <res-ref-name>jdbc/DataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </webapp> ...and this in my jetty-env.xml: <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <New id="DatabaseConnector" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg></Arg> <Arg>jdbc/DataSource</Arg> <Arg>

Can I make a WAR depend on a JNDI entry in JBoss 5.1?

蓝咒 提交于 2019-12-01 18:50:30
As part of an upgrade from JBoss 4.0.4 to 5.1, I am trying to get a WAR to deploy after an EAR is successfully deployed. JBoss 5.x does not support PrefixDeploymentSorter like 4.x did, which means that I have to use <depends> in the WAR's jboss-web.xml. It seems I cannot depend on the EAR itself, so I pick the last deployed EJB instead. This EJB provides a JNDI entry that the WAR needs. Here's the EJB as it deploys when the WAR is absent from the deploy directory: 2010-03-25 10:47:30,348 INFO [org.jboss.ejb3.session.SessionSpecContainer] (main) Starting jboss.j2ee:ear=my-ear.ear,jar=mypackage

Configuring and looking up a simple String via JNDI in WebSphere

折月煮酒 提交于 2019-12-01 18:33:32
For the configuration of our applications we want to place some of the configuration in the application server. We are currently using the WebSphere JNDI facility for looking up urls and datasources. In addition we want to place simple Strings in the application server. We don't want to use the WebSphere "Enviroment variables". Can the "Resource Environment" be used for such a purpose? If so, how can it be used? We'd like to get the Strings with: InitialContext ctx = new InitalContext(); String myString = (String)ctx.lookup("jndi/string/myString"); Are there any more simple alternatives? We

Weblogic javax.naming.NameNotFoundException while running application

℡╲_俬逩灬. 提交于 2019-12-01 18:12:33
I have created a data source name in Weblogic 10.3.6 as jdbc/appsmDS and the same name has been given in application to lookup. However when I am trying to run application, I am getting the following error javax.naming.NameNotFoundException: While trying to lookup 'jdbc/appsmDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/appsmDS' How can I resolve this issue? when looking up the DS the full JNDI structure maps to java:jdbc/appsmsDS . Please use it for lookup. Rodrigo Klein The problem in this case is probably that the datasource is not deployed in the "server" inside

Make per-context JNDI variable available to Tomcat in Eclipse

坚强是说给别人听的谎言 提交于 2019-12-01 17:48:33
问题 I'm using Tomcat 8.5.6 inside Eclipse 4.6.1. I have my web-app project/context foo , which has a JAX-RS (using RESTEasy 3.1.0.CR3) endpoint of bar , so I can fire up Tomcat inside Eclipse and access: http://localhost:8080/foo/bar I have a variable named foobar which I want to access inside my JAX-RS implementation using JNDI: final String foobar = (String) new InitialContext().lookup("java:comp/env/foobar"); I plan on deploying the produced WAR in production using Tomcat autodeploy. I want to

Make per-context JNDI variable available to Tomcat in Eclipse

爱⌒轻易说出口 提交于 2019-12-01 17:45:45
I'm using Tomcat 8.5.6 inside Eclipse 4.6.1. I have my web-app project/context foo , which has a JAX-RS (using RESTEasy 3.1.0.CR3) endpoint of bar , so I can fire up Tomcat inside Eclipse and access: http://localhost:8080/foo/bar I have a variable named foobar which I want to access inside my JAX-RS implementation using JNDI: final String foobar = (String) new InitialContext().lookup("java:comp/env/foobar"); I plan on deploying the produced WAR in production using Tomcat autodeploy. I want to configure the foobar variable for Tomcat externally to the WAR. How can I do that so that I can test

Bind JNDI datasource in tomcat?

╄→гoц情女王★ 提交于 2019-12-01 17:26:00
问题 Is it possible to bind programatically a DataSource to Tomcat's 6 JNDI? I want to create a DataSource on the fly and then make it available through JNDI ( to ColdFusion for instance ). This is what I have: public void bindToConext(DataSource dataSource) throws NamingException, SQLException { Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); envContext.bind("jdbc/mydatasource", dataSource); } But I'm getting this exception: javax