cancel
Showing results for 
Search instead for 
Did you mean: 

EJB invocation of CAF Application Service

Former Member
0 Kudos
120

Hello!

I have create a Composite Application (Development Component) with SAP NetWeaver CE 7.1. There I have create an Application Service. The special generated EJB and its interface have this code:

<b>EJB:</b>


package de.td.ir_as.modeled.appsrv.increcrfcconn;

@javax.ejb.Stateless(name = "de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConn")
@javax.ejb.Local(value = { de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConnServiceLocal.class })
@javax.interceptor.Interceptors(value = { com.sap.caf.rt.interceptors.LogInterceptor.class })
public class IncRecRfcConnBeanImpl extends de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConnBean {
}

<b>Abstract Class:</b>


/* ***************************************************************************
 * 			THIS FILE HAS BEEN GENERATED BY THE CAF CODE GENERATOR.
 * 			ALL CHANGES WILL BE LOST IF THE FILE IS REGENERATED!
 * ***************************************************************************/
//Application Service Template
package de.td.ir_as.modeled.appsrv.increcrfcconn;

public abstract class IncRecRfcConnBean implements de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConnServiceLocal {
    public static final String _PROVIDER = "sap.com";
    public static final String _APPLICATION = "ir_as";
    public static final String _APP_SRV_NAME = "IncRecRfcConn";
    public static final String _OBJECT_NAME = _PROVIDER + "/" + _APPLICATION + "/" + _APP_SRV_NAME;
    public static final String _JARM_REQUEST = "XAP:APPSERV:" + _OBJECT_NAME;

    protected static final com.sap.tc.logging.Location _location = com.sap.tc.logging.Location.getLocation(IncRecRfcConnBean.class);
	    
    public IncRecRfcConnBean(){
    }
...
}

<b>Interface:</b>


/* ***************************************************************************
 * 			THIS FILE HAS BEEN GENERATED BY THE CAF CODE GENERATOR.
 * 			ALL CHANGES WILL BE LOST IF THE FILE IS REGENERATED!
 * ***************************************************************************/
//Application Service Template
package de.td.ir_as.modeled.appsrv.increcrfcconn;

public interface IncRecRfcConnServiceLocal{

...
	
}

I have created an other Development Component. It's a EJB Module. In this component I want to use via EJB invocation the developed Application Service. I use the @EJB invocation to use it:

@Stateless
public class IncRecRfcImplBean implements IncRecRfcImplLocal {

	@EJB(beanName="de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConn")
	private IncRecRfcConnServiceLocal incRecRfcConn;
...

But if I instantiate a [/code]IncRecRfcImplBean

-object in an POJO the attribute [code]incRecRfcConn

will not be initialized at runtime.

What do I do wrong?

Regards,

Armin

View Entire Topic
0 Kudos

Hi Armin,

Isn't your local interface, IncRecRfcConnServiceLocal, missing the @Local annotation before the interface declaration?

package de.td.ir_as.modeled.appsrv.increcrfcconn;

@Local

public interface IncRecRfcConnServiceLocal{

...

}

Best regards,

Dobrinka

Former Member
0 Kudos

Hi,

is the code

@javax.ejb.Local(value = { de.td.ir_as.modeled.appsrv.increcrfcconn.IncRecRfcConnServiceLocal.class })

in the EJB not enough? Or do I have to add the @Local annotation to access from other Development Components via EJB invocation?

Regards,

Armin