0 Replies Latest reply on Jan 11, 2002 9:47 AM by Fred Livingston

    ClassCastException

    Fred Livingston Newbie

      i am about to commit, also please post this to user i am not subscribed to it anymore,

      thx

      marcf
      -----Original Message-----
      From: Fred Livingston [mailto:FLivings@physiome.com]
      Sent: Thursday, January 10, 2002 3:39 PM
      To: 'marc.fleury@jboss.org'
      Subject: RE: [JBoss-user] rh: using local interfaces


      Hi:

      I am having the same problem as was discussed below, so I wanted to know if it was supposed to have been fixed. I have the Dec. 29 stable release (2.4.4) with Tomcat (3.2.3) integration. I have not packaged my application into an ear.

      Thanks,

      Fred


      I will implement the cl integration next week,

      this class of problem should go away

      marcf

      |-----Original Message-----
      |From: jboss-user-admin@lists.sourceforge.net
      |[mailto:jboss-user-admin@lists.sourceforge.net]On Behalf Of Dain
      |Sundstrom
      |Sent: Sunday, December 02, 2001 10:10 AM
      |To: 'Jozsa Kristof'
      |Cc: jboss-user@lists.sourceforge.net
      |Subject: RE: [JBoss-user] rh: using local interfaces
      |
      |
      |If you are attempting to do this from the web container (jsp, servlet), you
      |need to package your application into an ear.
      |
      |-dain
      |
      |> -----Original Message-----
      |> From: Jozsa Kristof [mailto:dynax@kami.vein.hu]
      |> Sent: Sunday, December 02, 2001 3:16 AM
      |> To: Dmitri Colebatch
      |> Cc: jboss-user@lists.sourceforge.net
      |> Subject: Re: [JBoss-user] rh: using local interfaces
      |>
      |>
      |> InitialContext ic = new InitialContext();
      |> ProductLocalHome home = (ProductLocalHome) ic.lookup
      |> ("myproject.Product");
      |>
      |> .. result:
      |> [10:12:48,315,Default] java.lang.ClassCastException: $Proxy31
      |>
      |> So it's all the same. I've tried it this way as well
      |> yesterday, but tried it
      |> again to make sure, it gives the same results.
      |>
      |> Christopher
      |>
      |>
      |> On Sun, Dec 02, 2001 at 09:28:32AM +1100, Dmitri Colebatch wrote:
      |> > for local beans you dont need to narrow using
      |> PortableRemoteObject - just
      |> > cast normally.
      |> >
      |> > hth
      |> > dim
      |> >
      |> > On Sat, 1 Dec 2001, Jozsa Kristof wrote:
      |> >
      |> > > Hi,
      |> > >
      |> > > I have an entity bean and a stateless session bean
      |> playing on the fields.
      |> > > >From the session bean, I'm trying to reach the entity
      |> bean through its local
      |> > > interface, but it has both remote and local interfaces. I
      |> used similar code
      |> > > as using its remote interface:
      |> > >
      |> > > InitialContext ic = new InitialContext();
      |> > > Object ref = ic.lookup ("myproject.Product");
      |> > > ProductLocalHome home = (ProductLocalHome)
      |> PortableRemoteObject.narrow (ref, ProductLocalHome.class);
      |> > > ..
      |> > >
      |> > > and at the PortableRemoteObject.narrow() call, RH throws a
      |> > > ClassCastException. I looked up the EJB2 specs, and it
      |> shows an example code
      |> > > doing that.. In spite of this, I think JBoss is right
      |> dropping this
      |> > > exception, because the context's lookup returns a ProductHome type
      |> > > interface, not a ProductLocalHome, and it seems logical
      |> not be able to cast
      |> > > the remote interface to the local one. How can I lookup
      |> and initialize the
      |> > > Local interface of my bean then?
      |> > >
      |> > > Thanks,
      |> > > Christopher
      |> > >
      |> >
      |> >
      |> > _______________________________________________
      |> > JBoss-user mailing list
      |> > JBoss-user@lists.sourceforge.net
      |> > https://lists.sourceforge.net/lists/listinfo/jboss-user
      |>
      |> --
      |> .Digital.Yearning.for.Networked.Assassination.and.Xenocide
      |>
      |> _______________________________________________
      |> JBoss-user mailing list
      |> JBoss-user@lists.sourceforge.net
      |> https://lists.sourceforge.net/lists/listinfo/jboss-user
      |>
      |
      |_______________________________________________
      |JBoss-user mailing list
      |JBoss-user@lists.sourceforge.net
      |https://lists.sourceforge.net/lists/listinfo/jboss-user


      _______________________________________________
      JBoss-user mailing list
      JBoss-user@lists.sourceforge.net
      https://lists.sourceforge.net/lists/listinfo/jboss-user

      --------------------------------------------------------------------------------

      [JBoss-user] rh: using local interfaces, Jozsa Kristof
      Re: [JBoss-user] rh: using local interfaces, Dmitri Colebatch
      Re: [JBoss-user] rh: using local interfaces, Jozsa Kristof
      Re: [JBoss-user] rh: using local interfaces, Peter Levart
      RE: [JBoss-user] rh: using local interfaces, Dain Sundstrom
      RE: [JBoss-user] rh: using local interfaces, marc fleury




      Fred Livingston, Ph.D.

      Bioinformatics Scientist

      Physiome Sciences, Inc.