Can't cast home stub to home interface

WL 5.1
          NT4.0
          I'm trying to talk to an EJB from a servlet. I had been doing this successfully
          using tomcat for the servlet engine and WL as the app server. Now, I wish
          to get this working using WL's servlet engine and WL app server.
          I look up the home like this:
          (this class is in a base class)
          protected Object lookupHome( String jndiName, Class serviceClass ) throws NamingException
          InitialContext initialContext = new InitialContext();
          return javax.rmi.PortableRemoteObject.narrow( initialContext.lookup( jndiName ),
          serviceClass );
          (this class is a derived class)
          private FooHome getHome() throws NamingException
          return (FooHome)lookupHome( "Foo", Foo.class ); // !!!!!!!!!!!!<-----this cast fails
          The cast to (FooHome) fails, with a ClassCastException. I've looked at what is returned from the
          initialContext and after narrowing and the object is what it should be: FooHomeBeanImpl_ServiceStub.
          At anyrate, I compared what I get back using tomcat and what I get back using WL's servlet engine
          and
          they are the same.
          So the above works using tomcat/WL but fails for WL/WL.
          The obvious difference is that the tomcat -> WL involved to JVMs, one
          for tomcat, one for WL. I believe with WL-> WL there is only one JVM.
          I'm a bit baffled. Any clues would be very much appreciated.
          Thanks.
          

Yes, you will see many older messages in this forum related to this issue.
          The home and remote interfaces and any other classes "mentioned" therein are
          "exported" by the ejb jar class loader to the rest of the classes running on
          that instance of web logic.
          Cameron Purdy
          [email protected]
          http://www.tangosol.com
          WebLogic Consulting Available
          "Rich Johns" <[email protected]> wrote in message
          news:[email protected]...
          > Sorry to reply to my own, but I thought I'd report that I've fixed the
          > problem which was related to loading the same class from multiple jars.
          >
          > Apparently, (and admittedly I'm still a bit shaky on this) servlets can
          > see interfaces for already deployed EJBs loaded via the deployment jar.
          This means that you should
          > not load them for the benefit of the servlet on the servlet classpath. For
          example,
          > the servlet might need home and/or remote bean interfaces, but, since they
          > are already deployed beans, you don't need to explicitly put them on the
          > weblogic.httpd.servlet.classpath. I believe the same goes for WARs
          (whether
          > they are zipped or unfolded).
          >
          > Just what subset of classes in the deployment jar can be seen by a
          servlet? The
          > reason I ask this is because there are some classes in the deployment jar
          that
          > my servlet cannot see. These classes are not used by the deployed beans,
          but
          > they are used by the servlet. I had to make a separate jar containing
          these files.
          > (Eventually, they will not be part of the deployment jar.)
          >
          > So, is this a correct inference? Only files that the EJB classloader
          loaded,
          > which which is to say the EJB interfaces, stubs, and other classes used
          > by them, are actually visible to the servlet.
          >
          >
          > Rich Johns wrote:
          >
          > > WL 5.1
          > > NT4.0
          > >
          > > I'm trying to talk to an EJB from a servlet. I had been doing this
          successfully
          > > using tomcat for the servlet engine and WL as the app server. Now, I
          wish
          > > to get this working using WL's servlet engine and WL app server.
          > >
          > > I look up the home like this:
          > >
          > > (this class is in a base class)
          > > protected Object lookupHome( String jndiName, Class serviceClass )
          throws NamingException
          > > {
          > > InitialContext initialContext = new InitialContext();
          > > return javax.rmi.PortableRemoteObject.narrow(
          initialContext.lookup( jndiName ),
          > > serviceClass );
          > > }
          > >
          > > (this class is a derived class)
          > > private FooHome getHome() throws NamingException
          > > {
          > > return (FooHome)lookupHome( "Foo", Foo.class ); //
          !!!!!!!!!!!!<-----this cast fails
          > > }
          > >
          > > The cast to (FooHome) fails, with a ClassCastException. I've looked at
          what is returned from the
          > > initialContext and after narrowing and the object is what it should be:
          FooHomeBeanImpl_ServiceStub.
          > >
          > > At anyrate, I compared what I get back using tomcat and what I get back
          using WL's servlet engine
          > > and
          > > they are the same.
          > >
          > > So the above works using tomcat/WL but fails for WL/WL.
          > >
          > > The obvious difference is that the tomcat -> WL involved to JVMs, one
          > > for tomcat, one for WL. I believe with WL-> WL there is only one JVM.
          > >
          > > I'm a bit baffled. Any clues would be very much appreciated.
          > >
          > > Thanks.
          >
          

Similar Messages

  • EJB home stubs in a cluster

    The following URL describes how replica-aware EJB home stubs work. Basically,
    when you do a lookup for the EJB home in JNDI, you get a home stub on any of the
    nodes in the cluster.
    However, I want to invoke EJBs on a particular node in the cluster. Can I do
    this by simply disabling the replica-aware EJB home in the deployment descriptor
    and doing a remote JNDI lookup on the desired node in the cluster? And if so,
    would I have to bind each EJB's home to JNDI with a different name?
    -reza
    http://edocs.bea.com/wls/docs61/cluster/object.html#1006777
    All bean homes can be clustered. When a bean is deployed on a server, its home
    is bound into the cluster-wide naming service.
    Because homes can be clustered, each server can bind an instance of the home under
    the same name. When a client looks up this home, it gets a replica-aware stub
    that has a reference to the home on each server that deployed the bean. When create()
    or find() is called, the replica-aware stub routes the call to one of the replicas.
    The home replica receives the find() results or creates an instance of the bean
    on this server.

    However, I want to invoke EJBs on a particular node in the cluster. Can Ido
    this by simply disabling the replica-aware EJB home in the deploymentdescriptor
    and doing a remote JNDI lookup on the desired node in the cluster? Andif so,
    would I have to bind each EJB's home to JNDI with a different name?Yes. Something like that. We do that with JMS queues sometimes (to send a
    message to a particular machine in the cluster).
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Behforooz" <[email protected]> wrote in message
    news:3c8fc8bf$[email protected]..
    >

  • Is it OK to cache home stubs in 6.1?

    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

    Regarding the remotes stubs: Remote interface is not serializable. If your app
    needs to work in clustered env then weblogic 6.1 will have problems replicating
    the remote interface. If you absolutely have to cache the remote stub in httpsession,
    get the handle of the remote interface and cache it. To get the remote interface
    from the handle use handle.getEJBObject().
    sudy
    "Bob Lee" <[email protected]> wrote:
    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

  • Can I use Solaris with my Home Recording Studio?

    Hello,
    I am currently building a basic home recording studio. I recently assembled a new computer and will be purchasing music recording equipment very soon. Before I purchase the audio recording gear, I was curious about a few things pertaining to the use of Solaris as my possible choice system.
    The data that I store on my hard drives will need to be secure. I had originally considered RAID 5 though recently found out about RAID Z, which appears to be far ahead of the other RAIDs. I am curious to know more about how to set up a RAID Z system.
    The computer will be running Solaris, various Linux or BSD, and Windows Vista. I have 500GB x4 hard drives. I am considering separating one and using it strictly for Vista, and using the remaining 3 with a RAID set-up for nix. If I had a choice, I would put much less hard drive space into Vista (capping it at 150 to 200 GB), though I have yet to come across a RAID system that effectively or efficiently cooperates cross-platform. With that in mind, the majority of the remaining 1.5TB can go into my studio OS - hopefully Solaris - while left-over hard drive space is set aside for various other *nix.
    I've used Solaris 10 before, though haven't really gone into detail on the mechanics of such features as ZFS, zones, now RAID Z, and the many more amazing features that Solaris provides. Likewise, I am not really familiar with how well the system might operate with software/applications that I could use for recording and composing music.
    Beyond the available 2TB (or 1.5TB RAID-ready) space, my computer is running on a new 64-bit quad-core AMD CPU (~2.6GHz) and currently has 4GB 1066MHz RAM. In my search for preparing a computer that suits me for high performance recording - including the editing and mastering of audio - I am attempting to narrow down my options on the software side of things. I have been very satisfied with the general file management of Solaris, though am unsure of how well it might run as the software side of a home recording studio. An additional factor in deciding will be the software's compatbility with audio PCI cards and external recording/audio interfaces. There is always a question of whether or not the necessary drivers, firmware, or similar is available between any given hardware and software components.
    Some other *nix options I have considered - "Ubuntu Studio 64-bit" (though it appears to prefer 32-bit) and "64 Studio" (also Debian-based, though appears to be optimized for 64-bit). Some colleagues have used Gentoo with studio applications, though I don't know of any Linux distributions that offer the versatility, power, stability, and efficiency of Solaris for the operating system that it is.
    If I use something like "64 Studio", I will have the advantage of a system that is ready-built for studio recording purposes as well as a system that I know is compatible with the sound gear that I am considering purchasing. However, those systems are restricted by their file system types, RAID availability and dependability, and the general disadvantages of using the Linux kernel in general. (I enjoy Linux, though I admittedly prefer Unix over it.)
    Can I use Solaris with my home recording studio?
    Thank you!
    Edited by: the_professor on Nov 9, 2008 6:26 PM
    Corrected a typo.
    Edited by: the_professor on Nov 9, 2008 6:30 PM
    Caught another typo.

    I'm not sure what your question is. If you have particular software you want to run, you should see what you can get that package to run under. Sound hw stuff don't tend to be too portable unless it's written on top of OSS (htttp://www.opensound.com). Were I you, I'd consider separating out the storage part and the processing part. Get something like a cheap dell sc440 to be a file server and give the drives to that (unless you actually can get all the components working under solaris).
    -r

  • Can't connect to wifi at home on MacBook Pro or iPhone 4S

    I recently moved and got set up with a new (cable) internet provider. Since that time, I have been unable to connect to wireless on my MacBook Pro or my iPhone 4S. I can connect via ethernet. I can connect via other people's wireless (coffee shops, library, etc.). Sometimes, I get a "connection timeout error occurred" message. Other times, it looks like wifi is connected, but when I try to visit a URL on a browser, the blue bar moves about a centimeter across the address bar and stops. Email doesn't work, etc. The technician who set up my internet tried for nearly three hours to figure out why it wasn't working and concluded it must be a problem with my computer. It seems odd that I would only have problems at home, but I'm not an expert. Hoping someone here is, and can help. I work from home so this is rather frustrating (especially since connecting via ethernet means sitting in the living room instead of my office and tempting the dog to trip on the cord). Thanks for reading!

    What is the make & model of the new wireless router that you ISP has provided you? Are you able to administer it if needed?
    For the MacBook Pro, try the following, in order, until (hopefully) resolved:
    1a. Delete Preferred Network(s)
    System Preferences > Network > Wi-Fi > Advanced > Wi-Fi tab
    Under "Preferred Networks," delete the network(s) you regularly use from the list.
    1b. Delete AirPort Keychain Entries
    Launch the "Keychain Access" application located in Applications/Utilties.
    In the windows on the left side: Select login for Keychains and "All Items" for Category.
    Click on the "Kind" filter at the top, and look for any "AirPort network password" entries...and delete them.
    1c. Add Preferred Network(s)
    System Preferences > Network > Wi-Fi > Advanced > Wi-Fi tab
    Add the preferred network(s) using the "+" button.
    Restart or log out then back in.
    2. Move System Configuration Files
    (Note: You will have to reestablish your network connections settings.)
    Go to /Library/Preferences
    Move the SystemConfiguration folder to the desktop.
    Restart your Mac. (Note: OS X will rebuild the files that are now sitting on your desktop. If this doesn't resolve the issue, you can move the folder back to it's original location.)

  • Can't automatically connect to my home airport with Leopard

    After I installed Leopard on my MacBook Pro, I can no longer automatically join my home (Airport) network. I have an antique (flying saucer shaped) airport hub that has worked perfectly for our home network up until now. In order to connect, I have to open Safari, wait for the Network Diagnostic button to appear, then go through the Network Diagnostic sequence. Sometimes it will ask for the password and sometimes not. I called Apple Support and they said that the new Airport utility (with Leopard) will not work on the older Airport hubs. They then transferred me to the Airport specialists, but after 15 minutes of waiting I gave up. I don't really want to spend the money to upgrade to an Airport Extreme, when the current hub works. But, on the other hand, it is a bit of a pain to go through this every time I turn on or wake up my MBP. Does anyone have any ideas how to address this problem?
    Thanks.

    Hello, andyBall_uk. I figured out the problem, and I'm going to reply to it on here in case anybody else has the same issue they can see this solution. I already had an iOS device before, which saved a "keychain" of the old login info for the router. This was back when the router did have WEP security. Since then, it has been reconfigured for WPA2 however my old keychain was trying to join it as WEP.
    To solve this, I went to System Preferences>Network>Advanced
    From here, I noticed the
    [ + ] [ - ] Drag Networks into the order you prefer
    Highlighting my router and hitting the [ - ] sign removed the keychain that would previously only connect as WEP. This now allowed my computer to automatically connect to the router every time I opened it or turned it on.

  • Can't even connect to my home network.

    Title says it all, bought a 64gig iPad wifi today...little did i know tons of users are having wifi problems...my problem doesnt seem to fit the others though. Most of what i've read people can connect for a bit, and after being in sleep mode then it has problems. I can't even connect to my home network. Works fine with my ipod Touch, laptop, etc. I dont have any form of security set up on my router what so ever. I plan on buying a new router soon (for reasons other than this iPad crap.) I'd really like to see some kind of resolution to this problem before i need to do that though.
    I tried all that i could out of the trouble shooting stuff. nothing worked. I even tried setting up a static IP for it. What else can be done? i really dont want to have to return it since its such a nice piece of tech.

    Umm... one of the questions that's been asked is whether his iPad will connect anywhere else, If it will, the issues is between the iPad and the particular configuration he has at home. If not, the issue is with the iPad.
    Since we don't have an answer to that question yet, your inference that anyone is telling him to "phone ahead to every business or hotel he plans on visiting to request that they replace their "clunky old router" " is unjustified and unhelpful.
    Please, continuously blaming every ipad wifi issue on the same router that happily works with every other device is getting old. What standards does iPad support that these clunky old routers do not?
    Since, as you've said in another post, you're experienced in the ways of the internet, you will know that it's quite common for new kit to have problems connecting to old kit.

  • HT5544 can i share an ibook with home sharing?

    I have purchased an Ibook and read through ibooks app can I share the book over home sharing with my wife?

    If you log in with your iTunes account on that iPad (Settings > Store) you should then be able to download that ibook onto it : http://support.apple.com/kb/HT2519

  • How can I determine what computers are home sharing??

    How can I determine what computers are home sharing??

    Launch iTunes on the computers you're interested in. Check in the "Advanced" menu.
    If "Turn on Home Sharing" is listed as an option, the iTunes library that you have open is not Home Sharing.
    If "Turn off Home Sharing ([accountname]) is listed as an option, the iTunes library that you have open is Home Sharing.

  • Can you play personal videos using home sharing

    Can I play personal videos with apple tv using homesharing?

    Welcome to the Apple Community.
    They can be shared and played over home sharing, yes.

  • I have an apple TV Model A1427 and do not have an icon for youtube. How can I add youtube to the home page?

    I have an apple TV Model A1427 and do not have an icon for youtube. How can I add youtube to the home page?

    Have icon but cannot connect - Please Help.
    Mine is Gen. 2 - Model MC572C/A. I have the YouTube icon but cannot access YouTube.  Message says "No content was found - There is a problem communicating with YouTube. Try again later."  This problem has been for at least 1 month now.  Any ideas?

  • My MacBook works fine wifi everywhere except for home.  The home wifi is fine with the iPad and iPhone.  How can I fix my MacBook?

    My MacBook works fine wifi everywhere except for home.  The home wifi is fine with the iPad and iPhone, so I assume the issue is with my computer.  My computer works fine on wifi networks elsewhere.  The only problem is at home.
    The computer "connects to the wifi," but browsers and other internet-dependent software do not work.  Curiously, if I connect the ethernet cord that doesn't work either. Usually if I reset the modem to factory settings twice (for some reason, once doesn't do the trick), my computer will fully connect to the wifi.  However, in a few days, it goes back to not working.
    Today, resetting the modem didn't work. I could only get wifi connection while in safe mode, but not in normal mode.  So, the issue seems to be software not hardware. I have tried starting new accounts in normal mode, but those also don't connect properly to internet.
    Not sure if this is relevant, but this problem started when my building switched internet providers from ComHem to Telia (I live in Sweden).
    What do you recommend I do?
    Thanks!
    PS I use Snow Leopard: OS 10.6.8

    Not unless the modem is causing a problem.
    What you want to do is get it to work reliably over Ethernet first, then tackle wifi. Power off the modem. On your macbook, delete the Ethernet configuration and the Wifi configuration. Power up the modem, then connect the mac via Ethernet. Create the new Ethernet configuration and see if you can connect.

  • I hate the new operating system. Can't connect to wifi in home anymore even after a restore. Rhapsody no longer works on my phone either. Plus the brighth graphics are bothering my eyes even with brightness turned down. Any ideas on why rhapsody doesn't w

    I hate the new operating system. Can't connect to wifi in home anymore even after a restore. Rhapsody no longer works on my phone either. Plus the brighth graphics are bothering my eyes even with brightness turned down. Any ideas on why rhapsody doesn't why rhapsody doesn't work anymore?

    Contact Rhapsody to see if they have or plan to release an update for the app. Try uninstalling and reinstalling the app. Have you tried resetting your device by pressing and holding the Home button and power button until the silver apple appears?

  • Why can't I connect to my home WiFi network with my new iPad Mini?

    Why can't I connect to my home WiFi network with my new iPad Mini when I can connect to free WiFi networks at cafes and public areas?

    Try this:
    1. Turn router off for 30 seconds and on again
    2. Settings>General>Reset>Reset Network Settings

  • I miss hit and made aol my homepage. How can I return to my previous home page.

    I miss hit and made aol my homepage. How can I return to my previous home page. e

    Reset your homepage. <br/>
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page

Maybe you are looking for