jndi

Spring @Resource Handling

南笙酒味 提交于 2019-12-07 00:28:19
问题 I'm having trouble with a field annotated as @Resource in a Spring bean. What I have: A field, with setter method, annotated @Resource @Resource private URL someUrl; public void setSomeUrl(URL someUrl) { this.someUrl = someUrl; } An <env-entry> tag in my deployment descriptor (web.xml) <env-entry> <env-entry-name>someUrl</env-entry-name> <env-entry-type>java.net.URL</env-entry-type> <env-entry-value>http://somedomain.net/some/path</env-entry-value> </env-entry> The application fails to start

Documentation of Java Mail API configuration for JNDI in Tomcat

醉酒当歌 提交于 2019-12-06 23:57:48
问题 I spend several days to figure out how to configure an javax.mail.Session in Tomcat via JNDI with authentication , now I get it but only after a deep dive in the code. In this time I have seen the worst code ever: javax.mail.Service#connect(String,String,String,String) Version 1.4.1 if (user == null) { user = url.getUsername(); if (password == null) // get password too if we need it password = url.getPassword(); } else { if (password == null && user.equals(url.getUsername())) // only get the

Spring Boot - JNDI value lookup

别等时光非礼了梦想. 提交于 2019-12-06 21:05:52
@SpringBootApplication public class SampleTomcatJndiApplication { public static void main(String[] args) { SpringApplication.run(SampleTomcatJndiApplication.class, args); } @Bean public TomcatEmbeddedServletContainerFactory tomcatFactory() { return new TomcatEmbeddedServletContainerFactory() { @Override protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer( Tomcat tomcat) { tomcat.enableNaming(); return super.getTomcatEmbeddedServletContainer(tomcat); } @Override protected void postProcessContext(Context context) { ContextResource resource = new ContextResource(); resource

Jboss client send message to remote hornetq in Jboss

半城伤御伤魂 提交于 2019-12-06 19:48:31
I have a client run in JBoss (JB_Client) and it needs to send messages to a remote Jboss server (JB_Server) HornetQ . And Remote jboss server (JB_server) needs to send the response message back to it's HornetQ . So JB_Client MDB is listening to remote HorentQ for the responses. I am using Jboss AS6 for my client and server. This system works perfectly in local environment which is client and server both in same Jboss . But now I need to separate client and server in to two machines. here is my test client configuration. Properties prop = new Properties(); prop.put(Context.INITIAL_CONTEXT

Tomcat: use FTP connection via JNDI [closed]

久未见 提交于 2019-12-06 15:51:36
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I need to access an FTP server from my Web Application which runs on Tomcat 6. I want to use JNDI to do this. How can I configure this FTP connection in Tomcat using JNDI? What do I have to write into web.xml and context.xml to configure the resource? And how can I then access this connection from the Java source code? From this post : http://codelevain.wordpress.com/2010/12/18/url-as-jndi-resource/ Define your

jboss jndi context is empty

≡放荡痞女 提交于 2019-12-06 15:20:17
问题 An ejb-jar deployed to jboss 7 has a jdni binding "java:global/foo!IFoo". Jboss management console shows this binding. The jndi port is 1099 as by default. A client on jboss gets an object to that binding but a standalone client running on the same machine does not. Properties properties = new Properties(); properties.put("java.naming.factory.initial", "org.jboss.as.naming.InitialContextFactory"); properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); properties

Differences between javax.jms.ConnectionFactory and javax.jms.XAConnectionFactory

跟風遠走 提交于 2019-12-06 13:57:28
I'm entering the world of JTA, due to need of distributed transactions, and I'm uncertain about the differences between javax.jms.ConnectionFactory and javax.jms.XAConnectionFactory or more accurately how can it be that javax.jms.ConnectionFactory performed what I expected only javax.jms.XAConnectionFactory can do for me. The details: I'm using Atomikos essentials as my transaction manager and my app is running on Apache Tomcat 6. I'm running a small POC with a dummy app where I have my JMS provider ( OpenMQ ) registered as a JNDI resource. <Resource name="jms/myConnectionFactory" auth=

Godaddy JNDI Problem---Cannot create JDBC driver of class '' for connect URL 'null'

蓝咒 提交于 2019-12-06 12:54:12
问题 I have a website hosted at Godaddy where I use JNDI to manage DB connections. Godaddy is using Tomcat 5.5.27 with JDK 1.5. I am also using the same versions locally. JNDI works fine at my local development environment, but when I run it at Godaddy, I get the following exception message: Cannot create JDBC driver of class '' for connect URL 'null' I have placed everything correctly in Godaddy server as in my local system. Here is the context.xml <?xml version="1.0" encoding="UTF-8"?> <Context>

Weblogic 10.3.5 & EJB 3 JNDI names

*爱你&永不变心* 提交于 2019-12-06 12:30:58
Could someone tell me where I can find infos on the default JNDI naming for EJB 3 ? Does Weblogic use portable JNDI names like Glassfish? Can I find (like for Glassfish) a trace of EJB deployment with JNDI names used? For example : an interface (Service) with only @Remote a bean (ServiceImpl) with only @Stateless implementing the interface everything packaged in an .ear file (service-application-1.0) When deploying on Weblogic the only JNDI reference I see is: service-application-1.0service-application-1.0_jarServiceImpl_Home but I can't use that name with a context lookup. If I do Service

Best way to manage DB connections without JNDI

北城余情 提交于 2019-12-06 12:30:01
问题 I have a website, in which currently I am getting 1000 page views. I am expecting it will go around 30k per day in future. Now the problem for me to manage the DB connections. At present I am just connecting to DB directly from java program. I know it is worst design in the world. But for time being I have written like that. I have plan to manage connection pooling using JNDI. But the problem is my hosting provider is not supporting JNDI. Can anyone suggest me how to manage DB connections