1

I have @Stateless ejb with simple @Resource field

@Stateless
@Local({Foo.class})
public class FooImpl implements Foo {

    @Resource(name = "field1")
    private Boolean field1 = false;

    @Override
    public Boolean getStatus() {
    return field1;
    }
}

@Local
public interface Foo {
    public Boolean getStatus()
}

I have to override this field1 during deployment to the weblogic by the deployment plan.

I've tried adding the following to the plan

<variable>
  <name>Test_field1_16258439838455</name>
  <value>true</value>
</variable>

<variable-assignment>
  <name>Test_field1_16258439838455</name>
  <xpath>/ejb-jar/enterprise-beans/session[ejb-name="FooImpl"]/env-entry[env-entry-name="field1"]/env-entry-value</xpath>
  <operation>replace</operation>
</variable-assignment>

I know that I can override it if I would use XML deployment descriptor like in the article http://javaeenotes.blogspot.com/2010/11/using-weblogic-deployment-plans.html but I would use annotation without deployment descriptor and I don't know how to override it by deployment plan.

Does anyone have any idea how I can do it?

0 Answers0