This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

EJB3 help needed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dear friends..

Need your help...
I am new to EJB,
I was trying to run an example from
the MyEclipse's tutorial..

Using GlassFish v 2, MyEclipse 6.0, EJB 3.

The code is as follows
*******************************************************
package com.myeclipseide.ejb3;

import javax.ejb.Stateless;

@Stateless
public class MyBean implements MyBeanRemote {

public String doSomething() {

return "HELLO";
}
}


***************************************************************************
package com.myeclipseide.ejb3;

import javax.naming.InitialContext;
import javax.naming.NamingException;

public class MyBeanClient {
public static void main(String[] args) {
try {
InitialContext ctx = new InitialContext();
MyBeanRemote bean = (MyBeanRemote) ctx.lookup("com.myeclipseide.ejb3.MyBeanRemote");
bean.doSomething();
System.out.println("Hi!!");
} catch (NamingException e) {
e.printStackTrace();
}
}
}

******************************************************************************
package com.myeclipseide.ejb3;

import javax.ejb.Remote;

@Remote
public interface MyBeanRemote {
public String doSomething() ;
}

*********************************************************************
The output got printed is:-
Hi!!
And the expected line
"HELLO"
of method "doSomething" is not getting printed..

Can anyone help in solving this problem..

Thanks
 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You got some basic thing missed. To understand whats happen there, try to tell me the answer for this simple SCJP question:



What is the output?
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What did you do to setting jndi properties inside Eclipse?
Please, if you can help me I thank you.

Thank you,
Higor
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"susMita blr", please check your private messages for an important administrative matter.
 
Meeta Dey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks treimin..
 
Meeta Dey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Higor,

we need to add appserver-rt.jar to our Build Path. This JAR is from the Glassfish 2 library directory and contains a customized jndi.properties file that will allow us to connect directly to the Glassfish 2 JNDI context automatically .
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Missed the sys out
 
Higor Zardo
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And for JBOSS, someone know how to setting jndi properties inside Eclipse?

Thank youu,
Higor
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Higor Zardo wrote:And for JBOSS, someone know how to setting jndi properties inside Eclipse?



Please ask it in this forum
 
Higor Zardo
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, thank you.

Higor
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic