Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prevent JBoss deploying a bean

 
Nishanth Alphonse
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a situation where a session bean (call it Bean A) is defined in an external jar that I have no control over. This bean is used by other beans in that jar.
I wish to override the behaviour of this bean A and therefore, I have created another session bean and have named it A. This is because the other beans in the external jar relie on the bean with name A.

So I have a EAR file with the external jar and my A.class file. Deploying on JBoss throws the Bean already registered error. Is there any way to get JBoss to not deploy the bean from the external jar?
Or do you have another solution for the situation I have?

Many thanks,

Johny
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few options I can think of:

a) Repackage the JAR file replacing the existing A.class with yours.

b) Use AOP to overwrite the existing EJB's methods

c) Use pre/post processing mechanism built into JBoss (the term used for this escapes me) to override the EJB's methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic