Bc4j application services

Hi to all;
Let's suppose this;
webapp1 --> connection user db1
webapp2 --> connection user db2
where webapp1 (db1) is for development and webapp2 (db2) is real, for users;
When i deployed this 2 applications at the same instance of server ( tomcat for now ), application server module pool is getting lost, i guess that is because of the service has the same signature ( webapp1.model.service.myService ).
I'm facing that bc4j's application module pool is always delivering the same instance of application module, no meter what application is currently in the browser.
If my tests are correct , it is aways delivering the same inital instance that was primary executed by the pool.
There are some way to avoid this ? and have the two different instances one for each application , running at the same server ?
Very Thanks
Marcos Ortega
Brazil

here are ConnectionDefinition node from bc4j.cfg
<ConnectionDefinition name="Dbccac">
<ENTRY name="JDBC_PORT" value="1521"/>
<ENTRY name="ConnectionType" value="JDBC"/>
<ENTRY name="HOSTNAME" value="192.168.0.102"/>
<ENTRY name="user" value="ccac"/>
<ENTRY name="ConnectionName" value="Dbccac"/>
<ENTRY name="SID" value="xe"/>
<ENTRY name="JdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
<ENTRY name="password">{904}0585F4CD119C5872705971F4F9AA4438E1</ENTRY>
<ENTRY name="ORACLE_JDBC_TYPE" value="thin"/>
<ENTRY name="DeployPassword" value="true"/>
</ConnectionDefinition>
At Oracle Business components configuration i have jdbc url connection type;
I really do not think that it is an connection problem, because i do not set any external jdbc resource for it, i really think that at some point application pool, when he is queried about an instance of service, he just do not consider the application context where it's service is deployed.
I suppose that for improving the pool avaliability
Bc4j Application pool do not open a new "ccac.model.service.ccacServiceLocal" pool for this service class, because both application are querying the same class name.
Even if one of the two application is some steps forwards and "ccac.model.service.ccacServiceLocal" is some versions newer.
Perhaps it is an expected behavior, as the pool is cross web application context.
My main question is,
where are the application modules pool engine locate ? and how it delivers services instances to applications.
Thank you Steve ;

Similar Messages

  • How to deploy a BC4J application as a Session Bean to OC4J?

    I want to deploy a BC4J application as an Session Bean to Oracle9iAS Containers for J2EE instead to the 9iAS-DB (= Oracle8i database). How to package the EJB JAR(s), EAR(s), Client JAR(s) ...???
    The main question is: Is it generally possible to deploy/run a BC4J application as an Session Bean to/on Oracle9iAS Containers for J2EE???

    One of the cool things about BC4J framework is the way you can deploy the BC4J application.
    The BC4J application is independent of the deployment mode.
    Irrespective of which mode you actually deploy the applicaiton, you would still get all the framework services.
    It is also easily switchable from one deployment mode to another.
    Today you can decide to deploy it in the local mode and a later stage if you need to deploy it as EJB Session Bean you don't have rewrite your Appplication.
    All you do use the Design Time Wizards for the APplication Module and make it remotable as EJB Session Bean and everything is taken for you.
    BC4J white paper available on technet gives more details
    http://technet.oracle.com/products/jdev/info/techwp20/wp.html
    raghu

  • How to log Exceptions raised in CAF Application Services

    Hi All,
    When there is an Exception rasing in CAF Application Service custom method implementation what are the steps need to follow for send that exception details to log files & where those log files will be generated i.e either in server, local system, etc.
    If we use following 2 different lines please explain me where that trace is going to written:
    1) System.out.println(e);
    2) e.printStackTrace();
    Thanks in Advance,
    Uday.

    Hi Uday,
    Try this (in my case I'm using that in Background CO that implements IGPBackgroundCallableObject ):
         public static Location logger =
              Location.getLocation(<yourClass>.class);
    Catch block:
              } catch (GPInvocationException e) {
                   throw new GPTechnicalCallableObjectException(
                        logger,
                        resourceAccessor,
                        "ERROR_PARAMETERS",
                        e);
              } catch (GPEngineException e) {
                   throw new GPTechnicalCallableObjectException(
                        logger,
                        resourceAccessor,
                        e.getMessage(),
                        e);
    Reward points if it's helpful.

  • Application services not working with MS Word 2004

    for some reason, application services with MS Word 2004 no longer work with Leopard for me (all grayed out). I would appreciate any advice
    thanks,
    bill

    Bill
    Because Word 2004 doesn't support Services. Firefox is another app that doesn't.
    Regards
    TD

  • SharePoint Foundation Web Application service "missing"

    Hi all,
    I've got an unusual situation. I was getting an "object reference not set to an instance of an object" error when trying to create a web application which was a little concerning.
    Although I've not got to the bottom of that yet I've discovered that the SharePoint Foundation Web Application service is "missing" when I go to the list of Services on Server in Central Admin. It's only a small farm (1 app and 1 web server) with
    the service running on the web server. 
    It must actually be running because the existing SharePoint sites are running, but obviously something's not right.
    Has anyone ever seen this happen before?
    Thanks.

    Thank you for the replies
    I've run Install-SPService but that's not made any difference.
    When I run the SharePoint Products Configuration Wizard (GUI), on the first screen (Modify server farm settings) it's showing the
    correct database server and configuration database name and "Do not disconnect from this server farm" is selected by default.
    On the next screen (Configure SharePoint Central Administration Web Application) it looks like I'm configuring a new because it wants me to specify a port for central admin. If I specify the existing central admin port then I get "The port specified
    has already been chosen". If I don't specify the port then it appears that if I continue Central Admin will be re-provisioned on a new port. 
    "False" is returned for the command  (get-spserver $env:computername).NeedsUpgrade 
    Could running psconfig from the command line fix this? If there's an issue I don't want to make things worse (although we are running in a VMware environment so I can snapshot the servers).
    Thanks.

  • How to use an Adobe interactive form in an Application service operation?

    Hi,
    I have a peculiar requirement here:
    The user wants that on the trigger of a specific operation an operation of the Application service should get invoked: this operation should pick up a Adobe form template from a destination and then prefill this forms with some values and then store the same in the backend DMS.
    It's very easy to accomplish this task in WD Java with the use of Interactive form element but here we don't want any kind of user interaction for these forms, just the form templates will be prefilled with some dynamic values and then the same will be saved as is.
    Can some one please provide some insight into how the same can be acieved, any API's etc?.
    Please reply ASAP.
    Regards,
    Manish

    hi
    try this tutorial on
    online interactive
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on online interactive pdf form - 29.htm
    for offline interactive form
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on offline interactive pdf form using download - 30.htm
    for downloading and uploading pdf forms
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on offline interactive pdf form using e-mail - 31.htm
    regards
    saravana

  • How to use bapi /external service directly in application service

    Hi
    I have to use BAPI_ALM--RDER_MAINTAIN in my caf application
    i have imported it as external service.As there are problems mapping its input fields to entity service , it has to be consumed directly vai application service.
    But i ahve never done so before.Can someone give me an example as to how t do it.
    If someone can give example of how to code in the application service to call  the bapi , it would be great . as i have some time constraint.
    Thanks ,
    Points assured for help.

    Hi Vivek,
    As you asked for an example to call a bapi directly from Application Service you can follow this link.
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/57fff3b10b3672e10000000a114a6b/frameset.htm">Using Generated External Proxy in Application Service</a>
    Thanks and Regards
    Avijit

  • How to use a jar-file in an Application Service - NWDS 7.01

    Hello everybody,
    I want to create an Application Service in SAP NetWeaver Developer Studio 7.01.05. Can you explain me how i can import an external jar into my project?
    I found out that I can implement or create simple java files:
    Java Perspective --> package project_name.utils --> insert/create java file
    I try to add the jar into the java build path of my project, but when i build it the jar is gone.
    I would be very thankful for every hint.

    solved
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b]

  • Object null reference error while creating Web applications, Service applications etc after restoring AD accounts

    Hi,
    The old Active Directory accounts of my server were removed, those accounts are used by some of the SharePoint sites. A new AD account was created and when I try to replace the old accounts with new I am facing issue. I am also unable to create new web application,
    service application from my Central Administration. I also tried by restoring old accounts but still I am facing same issues, I
    am getting the error message Object
    reference not set to an instance of an object. for any create activities in Central Administration.
    Thanks in Advance for your help

    Thanks for the reply. When I am trying to update service account of services also I am getting error
    message Object
    reference not set to an instance of an object. i.e., while selecting component(web/service application from drop down) redirecting to error page

  • Exception in calling a web service from a composite application service

    Hi,
    I have created a composite application service with external service as a web service. My web service is deployed on localhost as well as I am running my composite application service in localhost. When i try to test the application service, I get the exception
    com.sap.caf.mp.base.exception.InvocationException: Invalid parameters
    The exception happens in MPConnector.java 'process' method where I am calling the execute operation on the service.
    I have tried testing this through Service Browser as well as creating a callable object on the Application service and testing the callable object.
    I am using the NWDS 7.0.06 version
    and EP installed on my machine is the Sneak Preview 7.0 sp 7
    Will appreciate all help in this regard.
    Thanks,
    Prachi

    Hi Navneet,
    I have verified the input/output parameters. They are simple types. All are Strings. Nothing really complex there.
    I have the Service Exceptions added already.
    And definitely the permissions are disabled but still this isn't working.
    Any more clues might be helpful.
    Thanks,
    Prachi

  • Error while testing an application service

    Hi,
    I have created a project wherein I have imported a standard BAPI as an external service and calling this external service in an application service.
    Following is the code used for the same:
    public com.sap.esproj.appsrv.datatypes.CompanyData getUserDetails(java.lang.String id) throws com.sap.caf.rt.exception.ServiceException {
            // logging
            java.lang.String CAF_user = sessionContext.getCallerPrincipal().getName();
            java.lang.String CAF_methodHeader = ESAppServiceBean.JARM_REQUEST + ":" + "getUserDetails(java.lang.String)";          
            Object[] CAF_parameters = new Object[] {id};
            com.sap.caf.rt.util.CAFPublicLogger.entering(CAF_user, ESAppServiceBean.JARM_REQUEST, CAF_methodHeader, ESAppServiceBean.location, CAF_parameters);
              com.sap.esproj.appsrv.datatypes.CompanyData retValue;
              try {
    //@@custom code start - getUserDetails(java.lang.String)
                   retValue = null;
    //                  Create data container for Input-Parameter and fill it.
                   BAPI__USER__GET__DETAIL
                         params = new BAPI__USER__GET__DETAIL();
                         params.setUSERNAME(id);
    //                  Get reference to the object representing the external service call.
                   BAPI__USER__GET__DETAILLocal bapi_local = this.getBAPI__USER__GET__DETAIL();
                   try {
    //                  Call the BAPI.
    //                  Return value of this method call contains all the data that the BAPI returns.
                        BAPI__USER__GET__DETAIL_dot_Response result = bapi_local.BAPI__USER__GET__DETAIL(params);
    //                  Retrieve the address structure out of the result data container.
                     BAPIADDR3 addr =
                   result.getADDRESS();
    //                  Fill the application services return structure.
                     retValue = new CompanyData();
                     retValue.setFirstName(addr.getFIRSTNAME());
                     retValue.setLastName(addr.getLASTNAME());
                   } catch (Exception e) {
                     e.printStackTrace();
                     throw new ServiceException(e);
    //@@custom code end - getUserDetails(java.lang.String)
                 return retValue;
            } finally {
                com.sap.caf.rt.util.CAFPublicLogger.exiting(CAF_user, ESAppServiceBean.JARM_REQUEST, CAF_methodHeader, ESAppServiceBean.location, CAF_parameters);
    I have also completed external service configuration.
    There is no compile time error and deployment is successful. When I try to test the application service I am getting the following error: ERROR. The following exception occured while processing your request: com.sap.caf.rt.exception.ServiceException.:
    Can anyone help me in resolving this error.
    Regards,
    Murtuza

    Hi Asutosh,
    Following is the error that I got from default trace. Can you please guide me what is the actual cause and help me in resolving error:
    #1.5#001A4DD89852006800000489000005A0000445DAF7D77BC8#1202706670130#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#sap.com/tcwddispwda#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#Administrator#122241##dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_28##0#0#Error#1#/System/Server/WebRequests#Plain###Processing HTTP request to servlet [dispatcher] finished with error.
    The error is: com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object 'sap.com/resources' and application 'sap.com' are not deployed on the server. Please check the used URL for typos.
    Exception id: [001A4DD89852006800000487000005A0000445DAF7D77836]#
    #1.5#001A4DD898520069000005DB000005A0000445DAF7E20D15#1202706670833#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#799E464C0ABBF6C70A2B2E16C951A281#46E52F6788684D5A1D7156AF1F58F0B2#<null>#
    #1.5#001A4DD898520069000005DD000005A0000445DAF7E215FE#1202706670833#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#799E464C0ABBF6C70A2B2E16C951A281#46E52F6788684D5A1D7156AF1F58F0B2#<null>#
    #1.5#001A4DD898520069000005DF000005A0000445DAF7E30840#1202706670895#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#799E464C0ABBF6C70A2B2E16C951A281#46E52F6788684D5A1D7156AF1F58F0B2#<null>#
    #1.5#001A4DD898520069000005E1000005A0000445DAF7E31577#1202706670895#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#799E464C0ABBF6C70A2B2E16C951A281#46E52F6788684D5A1D7156AF1F58F0B2#<null>#
    #1.5#001A4DD898520069000005E3000005A0000445DAF7E31DE2#1202706670895#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#799E464C0ABBF6C70A2B2E16C951A281#46E52F6788684D5A1D7156AF1F58F0B2#<null>#
    #1.5#001A4DD89852006900000D25000005A0000445DAF913C33D#1202706690864#System.err#sap.com/esproj#System.err#Administrator#122241#SAP J2EE Engine JTA Transaction : [061504e007dfffffffd]#dtpxp45jatalre.corp_EP9_6377550#Administrator#a6a5aac3d85f11dccfbf001a4dd89852#SAPEngine_Application_Thread[impl:3]_7##0#0#Error##Plain###com.sap.caf.mp.base.exception.EngineException
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPRFCServiceManager.executeOperation(SAPRFCServiceManager.java:1651)
         at com.sap.caf.mp.core.data.service.DataServiceFactory.executeOperation(DataServiceFactory.java:259)
         at com.sap.caf.mp.core.data.service.DataServiceFactory.executeConsiderSSO(DataServiceFactory.java:1056)
         at com.sap.caf.mp.core.data.service.DataServiceFactory.executeOperation(DataServiceFactory.java:168)
         at com.sap.esproj.extsrv.MPConnector.process(MPConnector.java:58)
         at com.sap.esproj.extsrv.bapi__user__get__detail.BAPI__USER__GET__DETAILBean.BAPI__USER__GET__DETAIL(BAPI__USER__GET__DETAILBean.java:40)
         at com.sap.esproj.extsrv.bapi__user__get__detail.BAPI__USER__GET__DETAILLocalLocalObjectImpl0.BAPI__USER__GET__DETAIL(BAPI__USER__GET__DETAILLocalLocalObjectImpl0.java:115)
         at com.sap.esproj.appsrv.esappservice.ESAppServiceBean.getUserDetails(ESAppServiceBean.java:103)
         at com.sap.esproj.appsrv.esappservice.ESAppServiceLocalLocalObjectImpl0.getUserDetails(ESAppServiceLocalLocalObjectImpl0.java:115)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.findByDataObject(ServiceWrapper.java:269)
         at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessBeanImpl.findByDataObject(CAFServiceAccessBeanImpl.java:223)
         at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessLocalLocalObjectImpl20.findByDataObject(CAFServiceAccessLocalLocalObjectImpl20.java:975)
         at com.sap.caf.rt.ui.cool.generic.AspectServiceAccess.findBy(AspectServiceAccess.java:275)
         at com.sap.caf.rt.ui.cool.generic.Query.execute(Query.java:217)
         at com.sap.caf.ui.servicebrowser.components.visualizer.controllers.TableViewCC.execute(TableViewCC.java:323)
         at com.sap.caf.ui.servicebrowser.components.visualizer.controllers.wdp.InternalTableViewCC.execute(InternalTableViewCC.java:196)
         at com.sap.caf.ui.servicebrowser.components.visualizer.views.TableViewCV.onActionExcuteQuery(TableViewCV.java:353)
         at com.sap.caf.ui.servicebrowser.components.visualizer.views.wdp.InternalTableViewCV.wdInvokeEventHandler(InternalTableViewCV.java:351)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.caf.mp.base.exception.EngineException
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPRFCServiceManager.getNonExecutedFunction(SAPRFCServiceManager.java:3300)
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPRFCServiceManager.executeOperation(SAPRFCServiceManager.java:1225)
         ... 50 more
    Caused by: com.sap.caf.mp.base.exception.ExternalException
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPSystemConnector.createFunction(SAPSystemConnector.java:500)
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPSystemConnector.getNonExecutedJCOFunctionOfFunctionModule(SAPSystemConnector.java:131)
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPRFCServiceManager.getNonExecutedFunction(SAPRFCServiceManager.java:3251)
         ... 51 more
    Caused by: com.sap.caf.mp.base.exception.ExternalException
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPSystemConnector.createRepository(SAPSystemConnector.java:363)
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPSystemConnector.createFunction(SAPSystemConnector.java:479)
         ... 53 more
    Caused by: java.lang.NullPointerException
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPConnectionPoolManager.createPoolName(SAPConnectionPoolManager.java:239)
         at com.sap.caf.mp.core.data.service.manager.saprfc.SAPSystemConnector.createRepository(SAPSystemConnector.java:350)
         ... 54 more
    #1.5#001A4DD898520072000006FE000005A0000445DAFC67CB9E#1202706746709#com.sap.ip.mmr.foundation.AssociationsContainer#sap.com/cafmpmmradapterear#com.sap.ip.mmr.foundation.AssociationsContainer.AssociationsContainer::ListReferencesIterator::next()#Administrator#121802####ec4acc90d85f11dcca12001a4dd89852#SAPEngine_Application_Thread[impl:3]_5##0#0#Error#1#/Applications/MMR#Java###Cannot read associated instance with MOF ID of MOF Layer for (,)#4#2#105D8E0C4F02D45AFFD5B9D6A09EFB7A#6DC24B80F6004CDBF4FA6C560AEDD33C#<null>#
    #1.5#001A4DD89852007200000700000005A0000445DAFCCC08E3#1202706753240#com.sap.engine.services.ejb#sap.com/cafmpmmradapterear#com.sap.engine.services.ejb#Administrator#121802####ec4acc90d85f11dcca12001a4dd89852#SAPEngine_Application_Thread[impl:3]_5##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method readServiceDefinition.
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:123)
         at com.sap.caf.mp.core.data.service.DataServiceBridge.getServiceDefinitionInfos(DataServiceBridge.java:170)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.populateServiceTree(OperationsMapping.java:1081)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.onPlugFromIndex(OperationsMapping.java:419)
         at com.sap.caf.runtime.ui.configuration.wdp.InternalOperationsMapping.wdInvokeEventHandler(InternalOperationsMapping.java:280)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NullPointerException
         at com.sap.caf.mp.mmr.adapter.ServiceDefinitionTypeConverter.convertExternalInterfaceWithProperties(ServiceDefinitionTypeConverter.java:190)
         at com.sap.caf.mp.mmr.adapter.MMServiceRetrievalAdapter.readServiceDefinition(MMServiceRetrievalAdapter.java:510)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerBean.readServiceDefinition(MMServiceRetrievalAdapterCallerBean.java:90)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:103)
         ... 34 more
    java.lang.NullPointerException
         at com.sap.caf.mp.mmr.adapter.ServiceDefinitionTypeConverter.convertExternalInterfaceWithProperties(ServiceDefinitionTypeConverter.java:190)
         at com.sap.caf.mp.mmr.adapter.MMServiceRetrievalAdapter.readServiceDefinition(MMServiceRetrievalAdapter.java:510)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerBean.readServiceDefinition(MMServiceRetrievalAdapterCallerBean.java:90)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:103)
         at com.sap.caf.mp.core.data.service.DataServiceBridge.getServiceDefinitionInfos(DataServiceBridge.java:170)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.populateServiceTree(OperationsMapping.java:1081)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.onPlugFromIndex(OperationsMapping.java:419)
         at com.sap.caf.runtime.ui.configuration.wdp.InternalOperationsMapping.wdInvokeEventHandler(InternalOperationsMapping.java:280)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    #1.5#001A4DD89852007200000701000005A0000445DAFD6AA2C8#1202706763662#com.sap.engine.services.ejb#sap.com/cafmpmmradapterear#com.sap.engine.services.ejb#Administrator#121802####ec4acc90d85f11dcca12001a4dd89852#SAPEngine_Application_Thread[impl:3]_5##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method readServiceDefinition.
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:123)
         at com.sap.caf.mp.core.data.service.DataServiceBridge.getServiceDefinitionInfos(DataServiceBridge.java:170)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.populateServiceTree(OperationsMapping.java:1081)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.onPlugFromIndex(OperationsMapping.java:419)
         at com.sap.caf.runtime.ui.configuration.wdp.InternalOperationsMapping.wdInvokeEventHandler(InternalOperationsMapping.java:280)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NullPointerException
         at com.sap.caf.mp.mmr.adapter.ServiceDefinitionTypeConverter.convertExternalInterfaceWithProperties(ServiceDefinitionTypeConverter.java:190)
         at com.sap.caf.mp.mmr.adapter.MMServiceRetrievalAdapter.readServiceDefinition(MMServiceRetrievalAdapter.java:510)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerBean.readServiceDefinition(MMServiceRetrievalAdapterCallerBean.java:90)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:103)
         ... 34 more
    java.lang.NullPointerException
         at com.sap.caf.mp.mmr.adapter.ServiceDefinitionTypeConverter.convertExternalInterfaceWithProperties(ServiceDefinitionTypeConverter.java:190)
         at com.sap.caf.mp.mmr.adapter.MMServiceRetrievalAdapter.readServiceDefinition(MMServiceRetrievalAdapter.java:510)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerBean.readServiceDefinition(MMServiceRetrievalAdapterCallerBean.java:90)
         at com.sap.caf.mp.mmr.ejb.MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.readServiceDefinition(MMServiceRetrievalAdapterCallerLocalLocalObjectImpl0.java:103)
         at com.sap.caf.mp.core.data.service.DataServiceBridge.getServiceDefinitionInfos(DataServiceBridge.java:170)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.populateServiceTree(OperationsMapping.java:1081)
         at com.sap.caf.runtime.ui.configuration.OperationsMapping.onPlugFromIndex(OperationsMapping.java:419)
         at com.sap.caf.runtime.ui.configuration.wdp.InternalOperationsMapping.wdInvokeEventHandler(InternalOperationsMapping.java:280)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Regards,
    Murtuza

  • Error while using external service from application service

    Hello All,
    I have exposed webservice from a CAF project that i am importing as external service in another CAF project. Now i am using application service to directly call the external service. following is the code in my application service:
    Ns6_getCountryByCode__R inp = new Ns6_getCountryByCode__R();
                   inp.setNs6_countryCode(countryCode);
                   try {
                          HRServicesWSVi__DocumentLocal bn = this.getHRServicesWSVi__Document();
                          Ns6_getCountryByCode__RResponse result = bn.getCountryByCode__R(inp);
                          retValue.setCountryCode(result.getNs6_Response().getNs3_countryCode());
                          retValue.setCountryName(result.getNs6_Response().getNs3_countryName());
                     }catch(Exception e){
                          throw new ServiceException(e);
    I am getting the following error
    ERROR. Problem in server response: [Bad Request].:
    What could be the problem ? Thanks in advance
    Regards,
    Ashutosh Rastogi

    Hello,
    It's always a good idea to check the log file. In many cases you find hints what the reason for the error could be. The log file can be found here: <root>usrsap<SID>JC30j2eeclusterserver0logdefaultTrace.<xy>.trc where <root> is probably c:, SID something like F33, F41, ... and <xy> a number 0, 1, .... -> the highest number is the last and therefore most youngest log file. Please check out this file.
    Another very common (but trivial) error is that you forgot to specify the URL and the end point location of your Web Service in CAF's config tool. This tutorial explains this beginning on page 20 <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/11669cea-0c01-0010-63b2-b98c35b1b370">Using a Web Service as External Service</a>.
    Regards,
      Jan

  • Error when trying to create a Composite Application Services project

    Hi Experts,
    I am facing a problem while trying to create a project using NWDS 7.0 SP 13
    New Development Component Project-> Composite  Application Services
    then pressing finish, it throws an error as follows
    "Generation can not completed due to one or more error"
    Reason :
    Errors occurred during code generation
    Warning :
    EAR-META-INF generation failed : null
    Plz help me to solve this
    Thanks in advance,
    John

    Hi John,
    It looks like there might be issue with CAF services related plugins. Check if there are any errors in log file under metadata folder of your workspace.Try deleting the metadata folder & restart the NWDS or start in a new workspace.
    I feel if the issue persists, it is a bug & you can raise an OSS ticket.
    Kind Regards,
    Nitin

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • How to use an Interactive form in a CAF Application service operation ?

    Hi,
    I have a peculiar requirement here:
    The user wants that on the trigger of a specific operation an operation of the Application service should get invoked: this operation should pick up a Adobe form template from a destination and then prefill this forms with some values and then store the same in the backend DMS.
    It's very easy to accomplish this task in WD Java with the use of Interactive form element but here we don't want any kind of user interaction for these forms, just the form templates will be prefilled with some dynamic values and then the same will be saved as is.
    Can some one please provide some insight into how the same can be acieved, any API's etc?.
    Please reply ASAP.
    Regards,
    Manish

    Hi Manish,
    If I get you correctly then you want to Upload a prefilled Adobe IF from some location without any user interaction and save it to some Backend/Temp storage: You need to have something like you have a user inbox and mail comes to this with the Adobe Form as an attachment, you extract the attachment and read it using available Java apis for reading. You can also specify a particular folder where you can place the filled form and then read it using FileInputStream and can save it in the backend after you have it in binary form in your application.
    Hope this helps!!
    Cheers,
    Arafat

Maybe you are looking for

  • IPod Touch read as a webcam by my computer?

    I've taken my iPod to work this week and have been charging it on my computer there. This morning I've downloaded some music and when I plugged in the iPod to sync, it comes up as "new hardware found - webcam," followed by "there's a problem installi

  • Ethernet issue Windows 8.1 Boot Camp

    Installed Windows 8.1 on boot camp - Macbook pro mid 2010. Everything workes very well except for - Ethernet works at first, but then stops working completely and I cannot get it to work again until I reboot. Happens every time, and no alert in Windo

  • 5800 does not turn on with SD card

    Hi, I have recently used Nokia PC Suite to delete some SMS from my Nokia 5800. After that, the phone has stopped turning on when the SD card is in. If I remove the SD card, the phone will switch on normally. How can I fix this? Thanks, Marco Message

  • Will this ram work?

    hi there, am soon hoping to purchase a new intel-imac i jsut want to be certain whether this ram will work in it: http://www.dabs.com/productview.aspx?Quicklinx=3VTJ&SearchType=1&SearchTerms=PC2 5300&PageMode=3&SearchKey=All&SearchMode=All&Navigation

  • Location of files transferred by Bluetooth

    Probably a dumb question here, but I don't know where the find the files that I transfer to our Macs via Bluetooth. In which folder are they located? I'm having trouble finding them. Any guidance is appreciated. Thanks. Chris