• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

jdeveloper lookup error

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using oracle9i jdeveloper 9.0.3,
I have downloaded jdev903_pre and uziped and executed jdevw.
I had created a simple session bean (TSession) and to test it a client has been created. The source code is as follows:
package Samplemypackage1;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import mypackage1.TSession;
import mypackage1.TSessionHome;
import javax.naming.NamingException;
public class TSessionClient
{
public static void main(String [] args)
{
TSessionClient tSessionClient = new TSessionClient();
try
{
Context context = getInitialContext();
TSessionHome tSessionHome = (TSessionHome)PortableRemoteObject.narrow(context.lookup("TSession"), TSessionHome.class);
TSession tSession;
// Use one of the create() methods below to create a new instance
// tSession = tSessionHome.create( );
tSession = tSessionHome.create();

// Call any of the Remote methods below to access the EJB
// tSession.PrintGiven( java.lang.String str );
tSession.PrintGiven("raju");
}
catch(Throwable ex)
{
ex.printStackTrace();
}
}
private static Context getInitialContext() throws NamingException
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
return new InitialContext(env);
}
}
When I run this code I got the following error message.
javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect
java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
RMIContext.java:134
java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
InitialContext.java:350
void Samplemypackage1.TSessionClient.main(java.lang.String[])
TSessionClient.java:18
Process exited with exit code 0.
Any Idea how to resolve this error? Do I need set any environment variables before developing ejbs?
regds
-raju
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a feeling that this does not have anything to do with JBoss since you are obviously using Oracle 9iAS as your Application Server based on your JNDI Properties. You would be better off posting this question to the Oracle/Oracle AS Forum or the IDE's and other tools Forum.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Run the OC4j server, make a connection to oc4j server and deploy the bean to oc4j server and then u will be fine.
 
reply
    Bookmark Topic Watch Topic
  • New Topic