The code I am using on the lookup is 

try {
      InitialContext ctx = new InitialContext();
      Object obj = ctx.lookup("Demo");
      out.println("Grabbed the bean's object reference.");
      DemoHome home = (DemoHome) PortableRemoteObject.narrow(obj,
DemoHome.class);
      out.println("Casted the Bean's object reference to the DemoHome
class.");
      Demo demo = home.create();
      out.println("Created the bean.");
      retInt = demo.getInt();
      out.println("Found the bean and it is returning "+retInt);
    }
    catch(Exception e) {
      out.println("Error thrown trying to contact the bean.  The exception
says " + e.toString());
      e.printStackTrace(System.err);
      System.err.println("Error thrown in Servlet1.  e.toString() says
"+e.toString());
      e.printStackTrace();
    }



-----Original Message-----
From: John Zhao [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 11:36 AM
To: JRun-Talk
Subject: RE: JRun 4 Bean Deployment


The message means that EJBContext.getEnvironment() is deprecated in the
latest EJB spec.  Use JNDI lookup instead in your code.  

Regards,
John

-----Original Message-----
From: Robert Jacobs [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 11:25 AM
To: JRun-Talk
Subject: JRun 4 Bean Deployment


I deployed a Bean in JRun 4 and when I tried to create an instance of it I
recieved a CastException.  I found out that there was a problem in JRun 3.1
where you needed to have the ejb's jar file in the {servers}/lib directory
or else it threw that exception.
I put the bean's jar file in the {servers}/lib directory now in JRun 4 and I
am getting the following exception

java.rmi.RemoteException: Deprecated and unsupported.; nested exception is: 
javax.ejb.EJBException: Deprecated and unsupported.
at jrunx.cluster.ClusterAlgorithm.invokeService(ClusterAlgorithm.java:112)
at jrunx.cluster.ClusterAlgorithm.invokeService(ClusterAlgorithm.java:70)
at jrunx.rmi.Invocation.invoke(Invocation.java:289)
at
jrunx.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:133)
at
jrun.ejb.invocation.ClientInvocationHandlerImpl.invoke(ClientInvocationHandl
erImpl.java:221)
at $Proxy6.getInt(Unknown Source)
at jruntest.Servlet1.doGet(Servlet1.java:43)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:
348)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451
)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:29
4)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: javax.ejb.EJBException: Deprecated and unsupported.
at jrun.ejb.InstanceContext.getEnvironment(InstanceContext.java:80)
at ejbtest.DemoBean.setSessionContext(DemoBean.java:49)
at
jrun.ejb.StatelessSessionInstanceFactory.createInstance(StatelessSessionInst
anceFactory.java:125)
at
jrun.ejb.interceptors.StatelessSessionInstanceInterceptor.invokeObjectMethod
(StatelessSessionInstanceInterceptor.java:75)
at
jrun.ejb.interceptors.EJBSecurityInterceptor.invokeObjectMethod(EJBSecurityI
nterceptor.java:81)
at jrun.ejb.EJBContainer.invokeObjectMethod(EJBContainer.java:111)
at
jrun.ejb.invocation.RemoteInvocationProxyImpl.invoke(RemoteInvocationProxyIm
pl.java:89)
at jrunx.rmi.RMIBroker.invokeEJB(RMIBroker.java:225)
at jrunx.rmi.RMIBroker.invoke(RMIBroker.java:135)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
java:28)
at java.lang.reflect.Method.invoke(Method.java:313)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:256)
at sun.rmi.transport.Transport$1.run(Transport.java:151)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:463)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
04)
at java.lang.Thread.run(Thread.java:539)

Any help would be most appeciated.  
Thanks,
Bob



______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to