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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB help, very confused with gui's and JFrames with J2EE

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi im in need of some help with a J2EE application im working on. I need to develop a JFrame front-end GUI client that will talk to the server, however i am not sure how to use JFrame to invoke methods on the server. This is mainly because im struggling to understand how I can call a method on the client side that will call a method on the server side when it appears to me that the client doesn't have a handle on the server-side (If that makes sense?)

I have crawled the web for some examples(including sun) but I still cannot find a tutorial.

I think my biggest problem is where I access the bean and how I can use it to set the JLabel to "hello World"
So I created a simple 'Tester' package that had a stateless session bean with one method which was to return a String. When the client GUI clicked a JButton its JLabel updated to the value. I initially created all of the code without a JFrame and compiled it using ant, and it worked fine (printing to the console).

Then I added some JFrame code to the frontend, but I got 28 error messages when I did so. My real questions are how to call methods on the bean and where I do this, take a look at the 'actionPerformed' method I call on the beans method here but it causes an error, also Im stuck as to where I must place the IntitialContext and EJB creation/casting/JNDI lookup stuff in the class.

I can write all the server-side/business methods its just the GUI im getting stuck on(this is just a testing example).

The following is the TesterBean and TesterClient files
I have done a printscreen on the errors, they can be found
here here





[ March 12, 2006: Message edited by: stewart ridgway ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Stewart, please don't cross-post the same question to several forums. Even if your problem involves both Swing and EJB code, you really need to either pick one forum or formulate your question into several more specific ones and post each to their respective forums.

I'm closing this thread as a duplicate for the one in the Swing forum.
    Bookmark Topic Watch Topic
  • New Topic