I receive the following when trying to compile a
servlet (a servlet which attempts to obtain a home interface via a JNDI lookup)
C:\ASAservletCode\ASAdonations.java:61: inconvertible types
found : java.lang.Object
required: RagHome
RagHomehome= (RagHome) context.lookup( "Rag" );
^
1 error
Finished
The code in the servlet is:
Properties env = new Properties();
env.put( "java.naming.factory.initial",
"desisoft.ejb.client.JRMPFactory" );
env.put( "desisoft.ejb.nameServer1",
"g2h:2050" );
Context context = new InitialContext( env );
RagHomehome= (RagHome) context.lookup( "Rag" );
The compiler obviously knows about RagHome. The context.lookup method returns a Java.lang.object
I am attempting a cast of object to RagHome.
What am I doing wrong?