WSIF calling EJB 3.0 beans, with JAXB 2.0.2 as the JavaSerializer

I'm working with SOA suite (10.1.3.1.0 [build #0 ]), and I am trying to allow my BPEL processes to call my EJB 3.0 stateless session beans via WSIF.
This works fine when I am passing primitives (strings, dates and so-forth) between BPEL and my EJB's using WSIF.
However I want to be able to pass my 'business objects" across the BPEL/EJB boundary directly. I started off by following the BPEL cookbook article "Using WSIF for Integration" which was usefull in showing how to use JAXB 1.x generated classes across the BPEL/EJB boundary.
However in the project I am working on we want to use JAXB 2.0 as it allows us to create an XML schmea binding directly from our existing "business objects".
So I am using the knowlege gained in the article mentioned above to implement a custom JavaSerializer for my bpel process that will use JAXB 2.0. My custom JavaSerilizer is being invoked correctly, when I invoke my BPEL process, but it is unable to load the correct JAXB (2.0.2) classes - it keeps getting the JAXB 1.0 classes that come standard with oracle.
My debug code that prints out the classloaders for my serializers (and parent classloaders) reports the following:
06/09/05 11:18:18 CustomSerializer.serialize
06/09/05 11:18:18 Classloader =oracle.bpel.common:10.1.3
06/09/05 11:18:18 Classloader =api:1.4.0
06/09/05 11:18:18 Classloader =jre.extension:0.0.0
06/09/05 11:18:18 Classloader =jre.bootstrap:1.5.0_06
The Jaxb classes it is loading a coming from classloader:
06/09/05 11:18:18 JAXBContext classloader =oracle.xml:10.1.0_2
My question is how do I get the JAXB 2.0 classes in my classpath?
Thanks,
Dave Oram

Hello,
About WSIF, we are currently working on a WSIF-EJB30 binding that will allow you to direclty annotate the session ben and get the EJB exposed as SOAP and WSIF binding out of the box.
This will be available in OracleAS 10.1.3.1 production.
Regards
Tugdual Grall

Similar Messages

  • EJB 2.1 session bean calling EJB 3 session bean?

    I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
    It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse?

    I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
    It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse?

  • Failed to call EJB from Managed Bean in user interface

    Hi,
    I'm very new to JDeveloper and EJB. I'm now in learning stage. I managed to find a simple example for me to get started. But I encountered errors.
    This is the tutorial that I have followed -> http://www.packtpub.com/article/Building-JSF-EJB3-Applications
    When we create an application, the application will consist of EJBModel and Interface (JSF View)
    In my EJB Model, I have session bean name myappejb.ejb.QuestionSessionBean and one Entity bean name myappejb.entities.Question
    In my User Interface, I have created a managed bean name QuestionController and I try to call QuestionSessionLocal in the EJBModel, but before I can compile, there are systaxs errors. I can't import the import javax.ejb.EJB and myappejb.ejb.QuestionSessionBean, stated not found. In other words I can't call all the beans that I have created in EJBModel from java class that I have ceated in UserInterface.
    Please advise, I'm lost.
    WenXin
    I really confuse how exactly it works
    Edited by: user8989450 on Jan 14, 2010 12:57 AM

    Hi,
    The problem has been solved. I found the solution, this is due to the "dependencies", must "Checked" the EJBModel.jpr.
    Thanks.
    Wen Xin

  • Dependency inject a EJB 2.x bean with EJB3

    Hi there
    I have an old EJB3 2.x bean deployed on my server, that is registered in JNDI with the name "abc/xyz/ItemLookup_v35".
    Now I wrote a EJB3 SFSB bean and I want to access the old bean using dependency injection. I tried it with the annotation
      @EJB(mappedName = "abc/xyz/ItemLookup_v35")
      private ItemLookupRemote itemRemote;but it wasn't working. How can I explicitly set the JNDI name of an old bean, that I want to lookup for?
    Any help is appreciated!
    Regards,
    Stephan
    Edited by: MasterRefactorer on Jun 27, 2008 7:31 AM

    You can use @EJB to access 2.x Remote views, but the field type has to be the Home interface.
    @EJB(mappedName = "abc/xyz/ItemLookup_v35")
    private ItemLookupHome itemHome;

  • Calling a Bean with parameters

    I would like to be able to call a JSF managed bean with a call such as
    How can I code to use a href directly to call a faces managed bean method without using listener?
    Thanks in advance.

    Take a look at: http://blog.exadel.com/?p=19
    This is a article how to use struts-like action to manage next steps
    Sergey : http://jsfTutorials.net

  • WebLogic 12.1.2 fails when deploying ear with injecting extension and bean with injection of this extension in ejb

    WebLogic 12.1.2 fails when deploying an enterprise application(ear) that contains a ejb in which injected 1) an extension 2)bean with injection of this extension.
    The following exception is thrown:
    Caused By: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [CdiExtension] with qualifiers [@Default] at injection point [[field] @Inject private test.extension.Bean1.extension].
    Possible dependencies [
    [Extension [class test.extension.CdiExtension] with qualifiers [@Default]; zip:/domain1/servers/AdminServer/tmp/_WL_user/test/7x6roh/lib/test-extension-0.0.1-SNAPSHOT.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[test.extension.CdiExtension@1115deb],
    Extension [class test.extension.CdiExtension] with qualifiers [@Default]; zip:/domain1/servers/AdminServer/tmp/_WL_user/test/7x6roh/lib/test-extension-0.0.1-SNAPSHOT.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[test.extension.CdiExtension@ed791f]]]
        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:314)
        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
        at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
        at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
        at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
        at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
        at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
        at com.oracle.injection.provider.weld.WeldInjectionContainer.start(WeldInjectionContainer.java:106)
        at com.oracle.injection.integration.CDIAppDeploymentExtension.initCdi(CDIAppDeploymentExtension.java:70)
        at com.oracle.injection.integration.CDIAppDeploymentExtension.activate(CDIAppDeploymentExtension.java:47)
        at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:37)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
        at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
    Problem can be easily reproduced by a minimal case:
    test.ear:
    \lib\test-extension-0.0.1-SNAPSHOT.jar
    test-ejb-0.0.1-SNAPSHOT.jar
    where
    test-extension-0.0.1-SNAPSHOT.jar contains:
    CdiExtension.java:
    package test.extension;
    import javax.enterprise.inject.spi.Extension;
    public class CdiExtension implements Extension {
        private String someString = "Some String";
        public String getSomeString() {
            return someString;
    Bean1.java:
    package test.extension;
    import javax.enterprise.context.ApplicationScoped;
    import javax.inject.Inject;
    @ApplicationScoped
    public class Bean1 {
        @Inject
        private CdiExtension extension;
        public String get() {
            return extension.getSomeString();
    test-ejb-0.0.1-SNAPSHOT.jar contains:
    EjbBean.java:
    package test;
    import test.extension.Bean1;
    import test.extension.CdiExtension;
    import javax.ejb.Stateless;
    import javax.inject.Inject;
    @Stateless
    public class EjbBean {
        @Inject
        private CdiExtension extension;
        @Inject
        private Bean1 bean1;
        public String getSomeString() {
            return extension.getSomeString() + "\n" + bean1.get();
    p.s. i seen same problem in community.oracle.com/thread/2577403 , but it happen in "war", not "ear", and seems successfully patched with patch №17424706

    Hi,
    It looks like there is patch exists for this issue.
    Patch 17198187
    Please try to download from the MOS or try to open a ticket with support.
    Regards,
    Kal

  • Calling beans with Role

    Hi,
    I have an enterprise bean with some roles and Principal assigned to the methods.
    In the client program what changes i have to make to call that method.

    I still have some problems. What changes should be made in the
    weblogic.properties file. Iam using weblogic 5.1
    ----Chandru
    Rob Woollen <[email protected]> wrote:
    The simplest thing to do is to specify a username and credentials when
    you create the InitialContext.
    i.e.
    Properties p = new Properties();
    p.put(Context.SECURITY_PRINCIPAL, "rob");
    p.put(Context.SECURITY_CREDENTIALS, "mypassword");
    Context ctx = new InitialContext(p);
    -- Rob
    chandrasekar wrote:
    Hi,
    I have an enterprise bean with some roles and Principal assignedto the methods.
    In the client program what changes i have to make to call that method.

  • SONIC MQ - Message Driven Bean with CMT

    Hi guys,
    I am having hard time with MDB having container managed transaction with TX attribute required. I am using RAD 6.0.1 and the JMS provider is Sonic MQ.I have defined XAConnectionFactory on Sonic side. The MDB runs without any error, but when I shut down the app server the message appears back in the queue. When I use transaction attribute as NOT SUPPORTED everything runs as normal.
    Am I missing something on the configuration here?
    I am seeing the XA implementation classes in the sonic jar file, but do I need their resource adaptor from sonic?
    Thanks
    Matt

    The current version of the white-paper that Raffi
              refers to covers through 7.0. For 8.1 see also
              http://edocs.bea.com/wls/docs81/ConsoleHelp/jms_config.html#accessing_foreign_providers
              and
              http://edocs.bea.com/wls/docs81/jms/j2ee_components.html
              these features can often make integration easier.
              Tom
              Raffi wrote:
              > Doug,
              >
              > You can find very detailed information on this topic at the link below. All
              > you need to do is specify the destination-jndi-name, initial-context-factory,
              > provider-url, and connection-factory-jndi-name in weblogic-ejb-jar.xml for the
              > non-BEA JMS provider for that specific MDB.
              >
              > ftp://edownload:[email protected]/pub/downloads/jmsproviders.pdf
              >
              > Hope that helps!
              >
              > Raffi
              >
              > Doug Chew <[email protected]> wrote:
              >
              >>Can someone give me an example on how to setup a message driven bean
              >>with a foreign JMS provider using the foreign JMS provider's implementation
              >>of a connection factory. i.e. binding the foreign JMS provider's connection
              >>factory to the JNDI tree.
              >>
              >>Thanks
              >
              >
              

  • Deploying entity beans with Local interfaces on Jboss

    Hi, I'm trying to deploying a simple entity bean on Jboss. The EJB has been developed with Local Interfaces because then I want to access it with a session bean facade.
    I get the following error:
    <!-- ERROR BEGIN -->
    23:41:25,984 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.2.2
    Warning: The entity bean class must not be defined as abstract.
    23:41:25,984 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.4.7.1
    Warning: The primkey-field element must name a public field in the bean implemen
    tation class.
    <!-- ERROR END -->
    I'm following what is wrote in the Professional EJB editeb by wrox?
    Is it possible to deploy an entity bean alone with Local interfaces? Is there something I'm missing? It's true that I defined the implementation class as abstract, but because there are abstract getter/setter methods.
    Thanks for any help,
    Marco

    Greetings,
    Hi, I'm trying to deploying a simple entity bean on
    Jboss. The EJB has been developed with Local
    23:41:25,984 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.2.2
    Warning: The entity bean class must not be defined as abstract.
    23:41:25,984 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.4.7.1
    Warning: The primkey-field element must name a public field in
    the bean implementation class.What version of JBoss are you using? These errors indicate container compliance with EJB spec 1.1, not 2.0 to which your CMP beans are written. Download the latest JBoss release version - 3.2.1 - and you should not see this problem.
    Is it possible to deploy an entity bean alone with
    Local interfaces? Is there something I'm missing? It'sYes it is (no, you are not "missing something" ;). In fact, this is recommended practice in most cases under CMP 2.0 - CMR having been a major impetus to the development of Local interfaces in the specification. ;)
    true that I defined the implementation class as
    abstract, but because there are abstract getter/setter
    methods.No problems. You are "right on track" for CMP 2.0. :)
    Thanks for any help,
    MarcoRegards,
    Tony "Vee Schade" Cook

  • Problems deploying entity beans with local interfaces on Jboss?

    I'm trying to deploy a simple entity bean using local interfaces on Jboss 3.2.1 and I obtain the following exception:
    19:08:51,875 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.2.2
    Warning: The entity bean class must not be defined as abstract.
    19:08:51,875 WARN [verifier] EJB spec violation:
    Bean : UsersEJB
    Section: 9.4.7.1
    Warning: The primkey-field element must name a public field in the bean implemen
    tation class.
    Any idea?
    Thanks,
    Marco

    I guess you are missing <cmp-version>2.x</cmp-version> for your first warning and <primkey-field>primary key field </primkey-field> for you second warning in your ejb-jar.xml

  • Calling EJB 3.0 Stateless Session Bean

    Dear all,
    I created a stateless session bean with a hello world method on it. Now i want to call the method from a BeanDecorator class, through a getter metod. When i use the jndi lookup in my getter, i can call the helloWorld method without a problem. However, when i dont use the jndi lookup, and only use the @EJB annotation, i always get a nullpointer.
    This is working:
    InitialContext ic = new InitialContext();
                   test = (TestLocal)ic.lookup("test.be/ear~bd/LOCAL/TestBean/"+TestLocal.class.getName());
                   test.helloWorld()
    This gives nullpointer:
    @EJB
    private TestLocal test;
    test.helloWorld();
    What is the correct way to consume session beans without having to explicitly code the jndi lookup?
    Kind regards.

    Hi,
    any annotation like this can be used only in "managed classes" like Session Beans, Servlets etc. Managed classes are those classes managed by the J2EE server. Managed here means, lifetime controlled by server.
    You can find this in J2EE specification.
    Frank

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

  • Problem with ejb 3.0 entity beans with manyToMany relationship

    Hello everyone!
    I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, (i would upload file but i do not know how:)
    with manytomany relationship with join table.
    when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:
    public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
    TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
    Targetgroup targetgroupForUpdate = find(pkForUpdate);
    targetgroupForUpdate.setGender(newGender);
    targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
    targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));
    //pronalazenje gradva za koje je vezana ciljna grupa
    Collection<City> newCitiesCollection = new ArrayList<City>();
    for(int i = 0; i < newCities.length; i++){
    String tmp_city_name = newCities;
    City city_obj = cityFacade.find(tmp_city_name);
    newCitiesCollection.add(city_obj);
    targetgroupForUpdate.setCityidCollection(newCities Collection);
    parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
    this code throws following exception:
    [#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    javax.transaction.RollbackException: Transaction marked for rollback.
    at
    .com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
    at $Proxy149.update(Unknown Source)
    at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
    at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
    |#]
    exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
    City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
    i thought it was going to figure it out by itself, and only update those rows.
    Does anyone know what is the problem and solution?
    Thanks! (forgive my spelling errors :)

    solved the problem!
    I moved code from sesion bean to struts action as follows:
    CityFacadeLocal cityFacade = lookupCityFacade();
    //prikupljanje novih podataka o ciljnoj grupi
    String newGender = ctf.getGender();
    String newMaxYears = ctf.getMaxyears();
    String newMinYears = ctf.getMinyears();
    String[] newSelectedCities = ctf.getSelectedCities();
    //niz imena gradova se prevodi u kolekcju objekata City
    Collection<City> newCitiesObjCollection = new Vector<City>();
    for(int i = 0; i < newSelectedCities.length; i++){
    String tmpCityName = newSelectedCities;
    City tmpCityObj = cityFacade.find(tmpCityName);
    newCitiesObjCollection.add(tmpCityObj);
    //setovanje novih podataka
    targetgroupForUD.setGender(newGender);
    targetgroupForUD.setMinyearold(Integer.parseInt(newMinYears));
    targetgroupForUD.setMaxyearold(Integer.parseInt(newMaxYears));
    targetgroupForUD.setCityidCollection(newCitiesObjCollection);
    //pozivanje update metdoe u session beany
    targetgroupFacade.edit(targetgroupForUD);
    //korisnik se vraca na stranu sa svim postojecim ciljnim grupama
    forward = mapping.findForward("backend.targetgroups");
    and now it works fine. I guess probelm was same transaction scope for Targetgroup and City entities. Now when they are separated it works.
    Thanks!

  • Help needed in EJB - to call AS from EJB a Session Bean

    Hi All ,
    I have been strictly told not to use Web Services as all the applications are on the same server
    actually I have to make an EJB invocation to an Application Service from the CAF layer from a Session Bean of another EJB Project(Not a CAF Service).
    the CAF layer has 5 parts metadata , permissions , dictionary , ear and ejbmodule.
    I added the ejbModule to the Build Path of the calling EJB Session Bean. And so I was able to access the operations of the Application Service which in turn accesses a BAPI(The Appl Service operation returns a String).
    But while executing I got the exception java.lang.RuntimeException: java.lang.NoClassDefFoundError
    My method :
    Normally from a Dynamic Web Project acting as a client to an EJB Session bean, I was able to get access to EJB Local Interface by using
      private ConverterLocal converterBean = null;
      public void jspInit() {
        try {
         InitialContext ic = new InitialContext();
         converterBean = (ConverterLocal)
         ic.lookup("java:comp/env/Converter");
        } catch (Exception ex) {
             System.out.println("Couldn't create converter bean."+
           ex.getMessage());
    BigDecimal dollarAmount =  converterBean.euroToDollar(value);
    So I created a JNDI field in ejb-j2ee-engine.xml
    enterprise-beans>
            <enterprise-bean>
         <ejb-name>com.sap*******.bapi_company_getlist.BAPI_COMPANY_GETLIST</ejb-name>
                   <jndi-name>COMPANY</jndi-name>
                </enterprise-bean>
    </enterprise-beans>
    And from my Session Bean , I tried to access it using the code in already existing Bean which was working fine
    BAPI_COMPANY_GETLISTBeanImpl bean = new BAPI_COMPANY_GETLISTBeanImpl();
              try {
                   InitialContext ctx = new InitialContext();
                   bean = (BAPI_COMPANY_GETLISTBeanImpl)ctx.lookup("COMPANY");
              } catch (NamingException e) {
                   System.out.println("Converter Bean can't be created");
                   String send = bean.returnDetails();
    And I tried to print the String , but I got the above error
    I have a doubt :
    1) How do I specify the JNDI name ie in the ejb-j2ee-engine.xml file , what should I add as the name of the ejb
    is this sufficient , or are there more steps ??

    Hi Ekaterina,
    I have the document to access my Bean from another Bean.
    I could access my Bean from a standalone Java class with this code
    Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL,"hostname:port");
              try{
                   Context ctx = new InitialContext(props);
                   Object o = ctx.lookup("sap.com/TestEAR/REMOTE/TestBean/com.@#$.TestRemote");
                   TestRemote testRem = (TestRemote)javax.rmi.PortableRemoteObject.narrow(o, TestRemote.class);
                   String msg = testRem.getMessage();
                   System.out.println(msg);
    And in this document there is a way shown to access a bean from another Bean.
       http://help.sap.com/saphelp_nw04/helpdata/en/13/c8633e0084e946e10000000a114084/frameset.htm
    If your client is another enterprise bean, declare the EJB reference in the ejb-jar.xml.
    -For more information, see Declaring EJB References.
    But the problem is that in EJB 3.0 ,  I can't see the ejb-jar.xml file .
    So how should I have a Bean as a client to another Bean, I am not that familiar with Annotations.

  • Calling EJB with Annotation not successfull within Netbeans

    I am trying to call EJB but my simple program can't find a ejb
    within netbeans. I also download a stub file from the admin page and add to the ejb client path. but still without the luck
    @EJB
    private static ConverterBean converterBean;
    public static void main(String[] args) {
    // TODO code application logic here
    BigDecimal param = new BigDecimal ("100.00");
    BigDecimal amount = converterBean.dollarToYen(param);
    System.out.println( amount );
    }

    Thanks for your pointer. Could you please help me out with a small code snippet example?
    I want to make use of this existing bean (AMSProfileServiceBean ):
    @WebService(targetNamespace = "http://www.ttt.de/ota")
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
    // standard EJB3 annotations
    @Local(AMSAgencyWSPortType.class)
    @Stateless
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    // jboss propriatary annotations
    @WebContext(transportGuarantee = "NONE", secureWSDLAccess = false)
    public class AMSProfileServiceBean extends AbstractProfileBuilder implements AMSAgencyWSPortType
      private static Log log = LogFactory.getLog(AMSMappingServiceBean.class);
      @EJB(mappedName = "PotsdamProfileService/local")
      private PotsdamProfileService profileService;
      private Security              security;
      @EJB
      private OTAProfileBuilder     otaProfileBuilder;
      @EJB
      private OTAProfileUpdater     otaProfileUpdater;
    @Override
      public OTATTProfileReadRS otaTTReadRQ(Holder<Security> wsseHeader, OTATTReadRQ request)
    ...in my soap-connector :
    @WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/PotsdamAMSAgencyWS.wsdl", targetNamespace = "http://www.ttt.de/ota", serviceName = "PotsdamAMSAgencyWS", portName = "PotsdamAMSAgencyWSPortType")
    @ServiceMode(value = Service.Mode.MESSAGE)
    public class PotsdamAgencyWSProvider extends WSProvider implements Provider<SOAPMessage>
      @Resource
      WebServiceContext     wsCtx;
    ...A small example would be really appreciated.
    Thanks.

Maybe you are looking for

  • Scanned Data duplicating in Adobe Acrobat Standard 7

    I am scanning a multiple page document, that includes letter size sheets and A4 size sheets. When I set the A4 size in my twain driver screen, inside acrobat, any pages that are letter size in the batch, come up with the last quarter-inch or so dupli

  • Issue with child node edit on TreeTable

    Hello, I have a treeTable which is based on single VO. My problem is such that, when i select the child node and click on edit, i get values of it's parent :( .... but when i have once  edit on any node (either rollback/commit) and hit the browser re

  • Mini display port wont work.

    I have bought an mini displayport to DVI adapter for my x1 Carbon, but when i plug it in the external display is just black. Do it need to some kind of special mini display adapter?  I have tryed to BIOS update, installed all the reqiuerd drivers and

  • Earbud won't stay in

    I have an Apple Bluetooth earbud that won't stay in my ear. Is it just me or does anyone else have that problem, and if so how did you resolve it?

  • Using LDAP query to get all the domains from all the forests in my company

    Foreword: I'm using two domain controller (dc1 and dc2). I'm using a domain registered to the root domain dc1 and simply request all of the domains in its forest by preforming search in the CN=Partitions,CN=Configuration,DC=dc1,dc=local. I can also g