• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve an interface in runtime

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
I'm developing a client application, which connects to an EJB3 module on JBoss 4.0.5 for common tasks, such as the db population or data migration.
As this application is a kind of utility, to be used in every project, I'd like to keep it flexible as much as I can, passing the remote interface name as string and load it during during runtime.
I know that interfaces cannot be instanced, but what about the EJB Object?

Below what I've done so far,


As I've commented, I got an Exception.
How can I to accomplish my target?

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no expert on EJB, but I'm fairly certain that you shouldn't create one in this way. This would completely bypass all the benefits of container-managed beans, not to mention the possibility of data corruption in the DB.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!