• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why can't we use Annotation for when we Creating a Java Stand-Alone Client

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i heard that it can't use Annotation for when we Creating a Java Stand-Alone Client
1) is it true?
2)then why?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a feeling that you haven't asked the right question.

I think you meant - Java stand alone clients cannot use EJB (or other EJB environment) injection (for example: @EJB annotation). Is that what you meant?

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use annotations in the standalone Java apps.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai is Correct
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to know why it is unable when it is stand along
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dependency injection of EJB components in a stand alone client is not possible because there is no container available to do the injection. However, there are application client containers which you can use to run that standalone client as an application client, so that injection becomes possible. You will have to check the documentation of the application server you are using to see how it's done.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic