Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5966327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:47:01+00:00 2026-05-22T19:47:01+00:00

i have a problem with JNDI in Tomcat: without tomcat I have used JNDI

  • 0

i have a problem with JNDI in Tomcat:
without tomcat I have used JNDI as following:

  Context context = new InitialContext();   
  JVoiceXml jvxml = (JVoiceXml) context.lookup("JVoiceXml");

And jndi.properties :

  java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
  java.naming.provider.url=rmi://localhost:1099
  java.naming.rmi.security.manager=true

Now I want to use this code in my Web Application(deployed with Tomcat), I have changed the code to:

 Context context = new InitialContext();
 Context envCtx = (Context) context.lookup("java:comp/env");
 JVoiceXml jvxml = (JVoiceXml) envCtx.lookup("JVoiceXml");

In web.xml:

<resource-env-ref>
  <resource-env-ref-name>
    JVoiceXml
  </resource-env-ref-name>
  <resource-env-ref-type>
    org.jvoicexml.JVoiceXml
  </resource-env-ref-type>
</resource-env-ref>

And in context.xml:

<Resource name="JVoiceXml" auth="Container"
            type="org.jvoicexml.JVoiceXml"
            factory="com.sun.jndi.rmi.registry.RegistryContextFactory"
            url="rmi://localhost:1099"/>

What I have missed, because after lookup() my JVoiceXml is null

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:47:01+00:00Added an answer on May 22, 2026 at 7:47 pm

    Your Tomcat code is not equivalent to what you wrote outside Tomcat. All you’ve done in the Tomcat case is name an RMI Registry context factory as JVoiceXML. That doesn’t seem to make sense: the RMI Registry has nothing to do with XML. I suspect you don’t need the java:comp/env stuff at all here. Presumably you have an RMI Registry running somewhere: just look it up with Naming.lookup(). If you want it to act as a Tomcat Resource, you need to define a factory that can create it. That needs to be an instance of javax.naming.spi.ObjectFactory (?). That may in turn do a Naming.lookup(), or a JNDI lookup, outside the java:comp/env namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with initializing the application. JNDI lookup is not fully initialized
I have problem with context menu. I have got: @Override public void onCreateContextMenu(ContextMenu menu,
I have a multiple contexts running in one tomcat instance each context need access
My problem is as follows: I have server.properties for different environments. The path to
I have the following problem: a user can't login to our webapp if the
I have a problem setting up my configuration for JNDI with Spring. I checked
I have a weird problem, to be specific it's about Jboss's JNDI and on
Trying to get ActiveMQ with JNDI running following ( http://activemq.apache.org/jndi-support.html ) and i have
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I have problem with my query on C, I’m using the oci8 driver. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.