jndi

Seam JNDI injection

How do you inject a JNDI value in Seam? I read that you can use @Resource or @JndiInject, but it is not working. ...

Using ActiveMQ via JNDI

I'm trying to create simply connect with ActiveMQ using JNDI. I have Queue named 'example.A'. According ActiveMQ documentation touching JNDI, if I want to use ConectionFactories and Queues (Topics) via JNDI, I have to place jndi.properties file on my classpath. As I have understood, activeMQ classpath is %activemq%/conf directory by ...

Using JNDI to get a user's group name in Windows XP

Hi all, I have heard - and I'm not sure if it was from a credible source or from someone who actually has done it - that JNDI can be used to access a user's group name in windows. I am using Windows XP. I'm not sure how it works exactly but it sounds windows uses active directory to manage groups (can someone confirm?) and JNDI might ...

mail/Session Resource Factory does not work in Struts application

I want to use the standard resource factory provided by Tomcat 6.0, which create javax.mail.Sessions instance for me. As described in the JNDI Resource HOW-TO tutorial. My META-INF/context.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <Context reloadable="true"> <Resource name="mail/Session" auth="Container" ...

How to initialize a value in web.xml from a JNDI variable?

Hi All, In my Java web application, the NTLM domain controller name is specified in web.xml like this: <filter> <!-- other code --> <init-param> <param-name>jcifs.http.domainController</param-name> <param-value>DCNAME</param-value> </init-param> <!-- other code --> </filter> In the above XML, we've hard-coded t...

Data handling in web app with GWT, Struts and Hibernate

I am writing a Web App using Struts and Hibernate. Recently, I discovered GWT and the Visualization API. This all looked very interesting and provides AJAX functionalities that my app needs. I'm a newbie that is quite confused.... Where to put data access level checks? In the web app, users have different level of access for the data. ...

Declaring a JNDI variable in JBoss 4.0.5

Hi All, I want to declare a new JNDI variable in the JBoss 4.0.5 server. Can someone please explain how this can be done? waiting for your replies. Thanks. ...

Obtaining an IntialContext from Weblogic without using clear text password

I can obtain the Weblogic InitialContext from a JNDI Client using the following properties as the Environment parameters for InitialContext Hashtable jndiProps = new Hashtable(); Hashtable.put( the below 4) java.naming.factory.initial "t3://localhost:7001" java.naming.provider.url "weblogic.jndi.WLInitialContextFactory" java.naming.secu...

JNDI failing with NameNotFoundException

I'm writing regression tests for a in-house library (where the creators are looong gone) and I'm trying to validate the environment. A couple of the tests keep failing with that NameNotFoundException only when the jndi name is "complex". This is a stand alone app and is not running with any web containers. The app uses a preference fi...

Can I use JNDI to access FIles/their content?

Can JNDI be used in a Java servlet to access filesystem on the local machine or a remote machine? I am able to bind local directories/files with it, but not able to find a mechanism(if exists) to read/modify the file's contents. The files are simple text files. Please tell me if it is possible, and how? ...

"java:comp/env/jdbc/MY_SQL_DS" or "MY_SQL_DS" or what else to reference the DataSource from within Java?

"java:comp/env/jdbc/MY_SQL_DS" does not work. I get a Naming Exception: NameNotFoundException. neither works "MY_SQL_DS" alone.name exception again. I created another JNDI for a Mail Session named "MY_MailSession" and reference it like (javax.mail.Session) ctx.lookup( "MY_MailSession" ) which works... what is the convention to refer th...

Hibernate: Is it okay to not bind SessionFactory to a JNDI name?

There is a way to set the JNDI name of a SessionFactory in the hibernate.cfg.xml file. However, if I'm not explicitly using JNDI lookup to get my SessionFactory at all in my web app, is it okay to NOT give it a JNDI name? The reason I ask is that if I didn't set up my JNDI name, my JUnit tests will run fine. But if I do set it up by onl...

How to create resource ref for a JBoss MBean

A have application deployed to JBoss. It contains Inside it I register Quartz MBean wich trigger scheduled task. How can I create reouce ref for that MBean to access resource by java:/comp/env/* and not java:/* in my task code. ...

giving an EJB a JNDI

Hi, I have created and EJB with a remote interface: @Stateless public class TestSessionBean implements TestSessionRemote { public void businessMethod() { System.out.println ("***businessMethod"); } } I to access it from another component (e.g a servlet) running on the server via: ic = new InitialContext(); ...

How to Use Different META-INF/context.xml Files For Development and Production Environments

In Tomcat (and some other servlet containers) I can store information about my JDBC DataSource in META-INF/context.xml. This is very useful. However, the settings for my JDBC DataSource can be different in my development and production environments. I'd like to know how other people deal with these differences in an elegant way, specifi...

Can remote stateless session bean references be cached in EJB3?

I am calling a remote stateless session bean from a J2SE application and would like to cache the reference to the session bean in order to reduce the cost of the lookup. Is this ok? In EJB2 the ServiceLocator pattern was commonly used to cache lookups to remote resources, but EJB3 doesn't have separate EJB Home (which were usually cach...

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

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....

Configuring setting for JPA

How can I configure Jetty to use Java Persistence API? I would prefer to use toplink-essentials. ...

Where is class weblogic.jndi.WLInitialContextFactory?

Hi, when trying to execute my jar file I get an exception: javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory] I guess this is some kind of missing library on the classpath. Can anyone tell m...

How do I set an <env-entry/> in JBoss as part of the server context?

I want to configure connections to a JCR repository at the application server level JBoss and retrieve those settings from within my web application using JNDI. I managed to configure the JCR repository using a typical data source. Can somebody tell me how to configure the username and password settings? Or point me to some samples? I m...