I've got weblogic server with a service I need to behave in 2 different ways depending on instalation. My plan was to deploy normally in the first case setting a String variable as @Resource with an ejb-jar descriptor in the class that needs two different behaviors (which I choose using qualifiers) and if I wanted the second one apply the change using a plan during the installation.
Then I decided to make the parent class abstract because I needed two implementations of it, and I need to leave that variable there to still be able to chose the behavior. But then when I deploy the service the installer fails saying that variable can't be set.
What I tried so far is to completely remove the ejb-jar and set the variable with a default value but then the plan is not able to set the new value in case I want the second behavior (or I don't know how to do it, which being fairly new to all of this is completely possible).
An other idea that could probably work would be to set the variable in the classes implementing the abstract one and setting them using ejb-jar for each one but that could grow a bit too much.
So, any clues, help or documentation I could look at? Is the problem really the class being abstract or did I mess somewhere else?
The exact error I'm getting is:
weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015005]The session type is not set in the deployment descriptor or annotation for session bean MyAbstractBean
I know this could be meaning I need to add a type tag to the session tag in the descriptor but same ejb-jar seems to be working for non abstract classes and I don't really know what this type tag should be.
And here's my ejb-jar:
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>MyAbstractBean</ejb-name>
<ejb-class>mypackage.MyAbstractBean</ejb-class>
<env-entry>
<description> Here comes a descriptions</description>
<env-entry-name>MyAbstractBean</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>JMS</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
</ejb-jar>
Thanks!