users@glassfish.java.net

[gf-users] Re: Configuring EJBs within a WAR

From: Reza Rahman <reza.rahman_at_oracle.com>
Date: Thu, 11 Sep 2014 10:44:42 -0400

Please check the forum archives. This is something that has been discussed very recently.

Sent from my iPhone

> On Sep 11, 2014, at 10:19 AM, Lachezar Dobrev <l.dobrev_at_gmail.com> wrote:
>
> Hello,
> I'm struggling with elementary stuff here.
>
> I have a WAR packaged application with @Stateless inside.
> I am trying to make them configurable when the application is
> installed in a Glassfish server.
>
>
> package com.company;
>
> @Stateless
> public class ServiceEJB implements Service {
> @Resource
> private String link;
>
> @Override
> public void sendHelloWorld() {
> // Hit the remote service
> new URL(link).openStream().close();
> }
> }
>
>
> The EJB is called by a servlet.
>
> I am unable to configure the link field.
> Tried:
> asadmin set-web-env-entry ... link
> asadmin set-web-env-entry ... com.company.ServiceEJB/link
> asadmin create-custom-resource ... link
> asadmin create-custom-resource ... com.company.ServiceEJB/link
>
> None of these seem to have any effect on the situation.
>
> Please advise.