• Post Reply Bookmark Topic Watch Topic
  • New Topic

Object and EJB 3  RSS feed

 
Carla Celiberti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm training myself with the EJB 3 technology.
I followed a guide that helped me to create my first stateless bean.
Now, I want to go to the next step, I would like to create a stateless bean that instead of returning a String, it returns an object.
I tried in the same way I did with the first exercise, but I'm getting several errors.
Can someone explain me the way or some good internet guide?

Thank you
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this link.
 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the errors?
 
Carla Celiberti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example I tried in this way http://stackoverflow.com/questions/25041663/returning-object-with-ejb-3
the errors are pasted here: http://justpaste.it/gfs3

I know it is ugly link another website, I'm sorry, Forgive me

@Dieter I'm reading the guide that you'e linked, hope to find answers.
 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to do a remote bean deployed on a different server?
 
Carla Celiberti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since I have two EARs, one with the bean and another one for the client side (mvc), RAD suggested me to create a remote bean and not a local bean.
 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So since you are doing a remote bean you need some special iiop configuration on the client mvc side in order to access the remote bean. If both EARS are on the same server you can try a local bean. I'd start with putting everything into a single ear and use local beans first.
 
Carla Celiberti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my first example there were two EARs too. But instead of returning "Persona" it returned a String and it worked. I really don't know.
 
Rob Spoor
Sheriff
Posts: 20898
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the objects you send Serializable? String is, so if the objects need to be serializable String never caused problems.
 
Carla Celiberti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is. It's just one object that implements Serializable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!