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 305283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:21:33+00:00 2026-05-12T07:21:33+00:00

Here’s my Bean class source @Stateless(mappedName=StringVal) public class NewSessionBean implements NewSessionRemote { String val

  • 0

Here’s my Bean class source

@Stateless(mappedName=”StringVal”)
public class NewSessionBean implements NewSessionRemote {

String val = null;

public String stringChange(int parameter) {
     while(parameter < 5){
        switch (parameter){
            case 1: System.out.println(val + "One" + ",");
            case 2: System.out.println(val + "Two" + ",");
            case 3: System.out.println(val + "Three" + ",");
            case 4: System.out.println(val + "Four" + ",");
        }
    }
    return val;
}     

}

And here’s my client class for this bean (Stand Alone Client)

import endpoint.NewSessionRemote;
import javax.naming.InitialContext;

public class TestLogicBean {

static String retVal = null;

public static void main(String[] args) {
    try {
        InitialContext ctx = new InitialContext();
        NewSessionRemote br = (NewSessionRemote) ctx.lookup("StringVal");
        for (int i = 0; i < 5; i++) {
            String retVal1 = br.stringChange(i);
            System.out.println("EJB message is:" + retVal1);
        }


    } catch (Exception ex) {
        ex.printStackTrace();
    }

}

}

But i’m getting this 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: java.naming.factory.initial”

I have tried several ways to make this,but still it gives this exception.

  • 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-12T07:21:33+00:00Added an answer on May 12, 2026 at 7:21 am

    Look what I found:

    http://www.jboss.org/index.html?module=bb&op=viewtopic&t=38107

    Seems like you have to had this to your jndi.properties:

    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=jnp://localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces 
    

    Looks like it’s all about setting up the connection to the JNDI server.

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

Sidebar

Related Questions

Here's the domain classes I'm working with: class Foo { String name, type static
Here is what I am trying to achieve in PHP: I have this string:
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here's my test function (c#, visual studio 2010): [TestMethod()] public void TestGetRelevantWeeks() { List<sbyte>
Here is some code I made :) @echo off set source=R:\Contracts\ set destination=R:\Contracts\Sites\ ROBOCOPY
Here is binding: <Image Width=16 Height=16 Source={Binding SwitchForImage, Converter={StaticResource stringToImage}} HorizontalAlignment=Left> </Image> and here
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.