My Oracle Support Banner

Deployment Plan With Resource EJB (Doc ID 1501665.1)

Last updated on MAY 11, 2018

Applies to:

Oracle WebLogic Server - Version 10.3.5 to 10.3.6
Information in this document applies to any platform.

Goal

 Within an EJB bean ,  @Resource annotation  is used to reference a datasource ( "jdbc/datasource1") as the following :

  package myPackage;

  @Stateless(name = "mySLSB")

  public class MySLSBBean ... {
     @Resource(mappedName = "jdbc/datasource1")
     private DataSource dataSrc;

   ...
  }

This resource ( "jdbc/datasource1")   is also referenced  within  weblogic-ejb-jar.xml descriptor file :

<resource-description>
<res-ref-name>myPackage.MySLSBBean/dataSrc</res-ref-name>
<jndi-name>jdbc/datasource1</jndi-name>
</resource-description>


The goal of this document is to show how  to  update the mappedName attribute value ( "jdbc/datasource1") of the @Resource annotation when deploying EJB by another value ("jdbc/datasource2").
 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.