Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EJB Session Bean in WebCenter Portal

Krzysztof SedekJan 30 2018 — edited Jan 30 2018

Hi

Does someone know is there a possilibity to use EJB Session bean to receive values from database using PortalSharedLibrary in WebCenter Portal?

In Project EJB I've create Entity:

@Entity

@NamedQueries({ @NamedQuery(name = "ComParametr.findAll", query = "select o from ComParametr o") })

@Table(name = "COM_PARAMETR")

public class ComParametr implements{

    @Id

    @Column(name = "PARAMETR_ID", nullable = false)

    private BigDecimal parametrId;

@Column(nullable = false)

    private BigDecimal version;

}

and one Facade (with its implementation):

@Remote

@Local

public interface ComParametrEJB {

    Object queryByRange(String jpqlStmt, int firstResult, int maxResults);

    <T> T persistEntity(T entity);

    <T> T mergeEntity(T entity);

    void removeComParametr(ComParametr comParametr);

    List<ComParametr> getComParametrFindAll();

}

In ViewController project I've created managed bean, which (in test() method) receives all values from table:

@ManagedBean(name = "ejbHelperMB")

@SessionScoped

public class EjbHelperMB implements Serializable {

    @EJB

    ComParametrEJB comParametrEJB;

    public EjbHelperMB() {

    }

  

    public void test(){

        List<ComParametr>  par = comParametrEJB.getComParametrFindAll();

        System.out.println(par.size()); 

    }

}

And all works well in standalone WebLogic.

But when I've create PortalSharedLibrary with taskflow, which contains this ManagedBean and I deploy it on WC_PORTAL, during restart I get error:

weblogic.management.DeploymentException: weblogic.application.naming.ReferenceResolutionException: [J2EE:160199]Error resolving ejb-ref "view.EjbHelperMB/comParametrEJB" from module "spaces.war" of application "webcenter". The ejb-ref does not have an ejb-link and the JNDI name of the target Bean has not been specified.

and server runs in admin_mode.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2018
Added on Jan 30 2018
0 comments
213 views