• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to locate jndi via sar file ...continuation..

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am still trying to access JNDI through start() method of my MBean as follows:

I have written rebind() method (referred documentation):

private void rebind() throws NamingException
{
private String jndiName = "ejb/Results1Bean";
InitialContext rootCtx = new InitialContext();
// Get the parent context into which we are to bind
Name fullName = rootCtx.getNameParser("").parse(jndiName);
System.out.println("fullName="+fullName);
Name parentName = fullName;
if( fullName.size() > 1 )
parentName = fullName.getPrefix(fullName.size()-1);
else
System.out.append("fullName Size is not greater than 1 -----> ");
Context parentCtx = createContext(rootCtx, parentName);
Name atomName = fullName.getSuffix(fullName.size()-1);
String atom = atomName.get(0);
NonSerializableFactory.rebind(parentCtx, atom, contextMap);
}


Now Results1Bean is getting bound to JNDI tree correctly.

In my client I have following code:
InitialContext context = new javax.naming.InitialContext(); //Line 1
Results1RemoteHome results1RemoteHome = (Results1RemoteHome)context.lookup("ejb/Results1Bean"); //Line 2

At Line 2 I am getting error as
Exception in thread "Thread-4"
java.lang.ClassCastException: java.util.HashMap

Can anybody please guide me what should I do to solve this ?

I have searched all dcumentation available on JBoss but was of no use.
Please help me I am with no clue left ;(

Thanks in advance,
Ameeta
 
reply
    Bookmark Topic Watch Topic
  • New Topic