Using JDO in a portal component.

Hi!
I've tried using JDO in a portal component (DynPage), but it just won't work for me (WAS 6.40).
What I've tried is this:
- Looking up a PersistenceManagerFactory using the name "java:comp/env/jdo/defaultPMF"
This does not work ... I get a NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/jdo/defaultPMF
- After reading this forum I tried with the name "deployedAdapters/jdo/defaultPMF/shareable/jdo/defaultPMF" although this is probably not the correct way
This did return a PersistenceManagerFactory object, however I wasn't able to cast to the PersistenceManagerFactory interface that I had. It must have been different versions of the interface - I tried downloading the jdo.jar from Sun and compiling the portal component against that, but still the ClassCastException occured. I used the reflection API to determine that the object returned did in fact implement the interface named javax.jdo.PersistenceManagerFactory. I even tried using the jdo.jar libraries from the server, but to no luck.
So ... my question is: Is JDO not available from a portal component? Must I develop a J2EE application to make it work? If so, I'd rather use Hibernate in my portal components, but it seems stupid when JDO is available?
Thanks,
Thomas

Hi Thomas,
In order to be able to use JDO in a Portal component, you have to add a Private Sharing Reference to the application sap.com/com.sap.jdo. This is a standard application provided with the SAP WebAS Java installation.
For more info on how to do that, please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/g-i/how%20to%20access%20an%20ejb%20from%20a%20portal%20component.mht">this</a> tutorial -> Accessing the EJB -> New Portal Component -> scroll to the section "Add PrivateSharingReference".
Hope that helps!
Vladimir

Similar Messages

  • How to use css in a portal component ?

    Ooooops, wrong forum.... sorry.
    Message was edited by: Elad Saar

    Hi
    As Francois pointed out Oracle forms has nothing to do with html based technology. The way you can get the equivalent effect of creating consistancy in the way your objects are displayed is by creating a set of items you want and alter their apperance and behaviour and place them into object libraries (one library should do the trick).  From there you subclass all of you forms items off these libraries.
    Regards
    Quintin

  • How to use a portal service in portal component(DynPage)

    Hi,
    I have made a portal service and i want to use this in my portal component .
    Please tell me how can i use it.
    also can anyone tell me step wise creation of portal component and portal service and their connectivity by using a smalll example in which connectivity is done in Dynpage and using stored procedure .

    Hi,
    Check this link:
    [How to Create a Portal Component and a Portal Service Tutorial|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0b57e590-0201-0010-a29f-abd37a436f54?QuickLink=index&overridelayout=true]
    Thanks and Regards,
    Shyam

  • How to use a Webservice (deployableproxy) within a portal component?

    hi,
    i need to know how to use a webservice using a deployable proxy within a portal component?
    i've created the proxies and they work (with servlets).
    i know how to use them in servletes (context lookup, jndi mapping, application references) but i cant find a way to use them in a portal component.. tried the context lookup way but cant figure out which jndi mapping to use.
    any help?
    thanks in advance,
    constantin

    i've found this document:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/cb2e29578c0262e10000000a11466f/frameset.htm
    but it doesn't help...
    i should add a privatesharing resource...
    <property name="PrivateSharingReference" value="SAPJ2EE::rh21.de/pca~wsproxy"/>
    which works
    this is my code
    public void doContent(IPortalComponentRequest request,IPortalComponentResponse response) {
       try {
         Context context = new InitialContext();
         WSPhonebook obj = (WSPhonebook) context.lookup("/wsclients/proxies/rh21.de/pca~wsproxy/de.rh21.wsproxy.phonebook.WSPhonebook");
         WSPhonebookViDocument phonebook = (WSPhonebookViDocument) obj.getLogicalPort("Config1Port_Document", WSPhonebookViDocument.class);
    } catch.....
    now the lookup works (i guess, no messages about that anymore), but i catch ClassNotDefFoundError-Exceptions, but the classes are there, i can strg+click them in the editor, they are in the used dc's etc.
    any help? its quite uurgent :/

  • Error while consuming web service in portal component

    Hi All,
    I am working on a portal application which uses web services in portal component via web service.
    I have tested the web service and then creted a relevant portal service to it .When using this portal service in the portal component and running it Im getting the following run time error
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : Test_portal_service_app.Test_portal_service_app
    Component Name : Test_portal_service_app.Test_portal_service_app
    com.sap.portal.ivs.global.ume.UMECLient.
    Exception id: 11:17_03/07/08_0028_2739150
    See the details for the exception ID in the log file
    I did not use any ume attributes or ume api methods in the portal component .
    I have also added sharingreference= portalserviceapplication name  in deploymentdescriptor of the portal application which has the portal component.
    Please provide any suggestion for the possible cause of error .
    Urgent!!!!
    Thanks.

    Hi all,
    Please throw some light into this issue i am getting the following exception.
    com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: Problem in server response: Proxy Authentication Required.
    I have given the proxy settings in the com.sap.portal.ivs.httpservice  in the portal and also
    defined a proxy server in the Visual Administrator under Services -> Webservice Container -> HTTP Proxy Server
    I am calling service in the following manner.
    IPortalRuntimeResources runtime = PortalRuntime.getRuntimeResources();
       IService service = runtime.getService(IWS_P_Service.KEY);
       IWS_P_Service ws_service = (IWS_P_Service)service;
        Volumes from = new Volumes(Volumes.VOLUMES_KILOLITER_VALUE);
        Volumes to = new Volumes(Volumes.VOLUMES_LITER_VALUE);
        ChangeVolumeUnit cvu = new ChangeVolumeUnit(1200,from,to);
        // working upto here
         response.write("working");
         ChangeVolumeUnitResponse cvu_res = ws_service.ChangeVolumeUnit(cvu);
         double result = cvu_res.getChangeVolumeUnitResult();
         response.write(result+"");
    It is working upto "working".
    If any body has any solutions please post.
    Thanks

  • URL Redirection from portal component

    I have created portal component.  I want to
    How to redirect request from jsp to external url
    Following is my jsp code
    <%
         String url = "http://abc.com/";
         url =     url +  componentRequest.getComponentSession().getValue("loginid").toString();
    %>
    <%= url %>
    i am able to see the url getting printed on the iview with
    http://abc.com<loginid>
    how do i forward request to the said url from the jsp page.

    Hi,
    here is a simple Code sample to achieve this (as stated by Praveen Gudapati I use response.sendRedirect):
    <%@ page language="java" %>
    <%
        String redirectURL = request.getParameter ("redirectURL");
        response.sendRedirect (redirectURL);
    %>
    In this sample you can even pass the redirectURL as URL Parameter. If you don't want that just define
    a static String for redirectURL.
    If you use this within a portal component and want to call a "local" JSP I'd prefer to use a forward. This is faster and your Clients won't have to initiate a new request:
    Here's some sample code:
    public class MyPortalComponent extends AbstractPortalComponent
    private static final String PATH_INDEX_JSP = "jsp/index.jsp";
    * Forward the request to the corresponding JSP.
    * @param request The request.
    * @param response The response.
    private final void forwardToJSP(IPortalComponentRequest request, IPortalComponentResponse response, String jspPath)
      // get the JSP as resource object and include it in the response
      IResource jspResource = request.getResource(IResource.JSP, jspPath);
      response.include(request, jspResource);
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    forwardToJSP(request, response,PATH_INDEX_JSP);
    So when you have more than one JSP you just use a URL Parameter and switch Case in doContent to call the appropriate JSP:
    Example:
    public class MyPortalComponent extends AbstractPortalComponent
    private static final String PATH_INDEX_JSP = "jsp/index.jsp";
    private static final String PATH_SECOND_JSP = "jsp/second.jsp";
    private static final String PATH_THIRD_JSP = "jsp/third.jsp";
    private final int getRequestAction(IPortalComponentRequest request) {
              int value = 0;
              String param = request.getParameter("request_action");
              if (param != null) {
                try {
                   value = Integer.parseInt(param);
                } catch (NumberFormatException e) {
                   value = 0;
              return value;
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    // get the requested action
    int request_action = getRequestAction(request);
    switch (request_action) {
      case 0 :                    
        forwardToJSP(request, response,PATH_INDEX_JSP);
        break;
      case 1 :       
        forwardToJSP(request, response,PATH_SECOND_JSP);          
        break;
      case 2 :
        forwardToJSP(request, response,PATH_THIRD_JSP);          
        break;
      default :     
        forwardToJSP(request, response, PATH_INDEX_JSP);
        break;
    Hope this helps
    (Reward Points for helpful answers are appreciated )
    Cheers

  • How to use UI elements in abstract portal component

    hi all
    i am new to portal development..i want to use different UI elements such as textbox,buttons using abstract portal component.can anyone telme how to use them.

    Yes Asusha
    You can use JSP , JSPDyn pages in Abstract portal component.
    You can call a Jsp file from the abstract portal component.
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
         com.sapportals.portal.prt.resource.IResource somePage =          
                   request.getResource("jsp", "pagelet/test.jsp");
                   response.include(request, somePage);
    Then you can made your desired UI in JSP.
    Hope this helps..
    Cheers
    Chinmaya
    Reward for helpful answers

  • Use WebDynpro JCO Destination in Abstract Portal Component

    Hello,
    I was wondering if it is possible to use a WebDynpro JCo Destination in an Abstract Portal Component? I have a portal component that make as JCO call to run an rfc. I get the MYSAPSSO2 ticket from the cookie and pass this in to the JCO client. This works fine. Now I need to be able to run this for anonymous users as well. I was hoping to be able to retrieve a WebDynpro JCo destination that is set up as a userid/password type and use this to make the connection to run my RFC. This way I could avoid having to store the userid and password somewhere and encrypt/decrypt  it etc...
    Thanks,
    Bert

    Yes Asusha
    You can use JSP , JSPDyn pages in Abstract portal component.
    You can call a Jsp file from the abstract portal component.
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
         com.sapportals.portal.prt.resource.IResource somePage =          
                   request.getResource("jsp", "pagelet/test.jsp");
                   response.include(request, somePage);
    Then you can made your desired UI in JSP.
    Hope this helps..
    Cheers
    Chinmaya
    Reward for helpful answers

  • Using JDO from webdynpro component.

    Hi,
    I am using JDO to access the database.I have created the persistance layer, businees layer following the tutorial "getting started with JDO".  they are using Servlets and html as front end. But i need to use webdynpro as front end.can we acess the methods in the business logic from the webdynpro component?
    If yes, can you please let me know how to access Database form webdynpro components?
    Thanks in Advance,
    Lakshmi.

    Hallo Lakshmi,
    It is technically possible to wrap JDO classes/interfaces using the new JavaBean ModelImport (read WebLog /people/david.beisert/blog/2004/10/26/webdynpro-importing-java-classes-as-model)
    But this is usually not desirable to achieve optimal scalability and performance.
    Why? JDO objects generally require holding locks of the persistent objects they represent. By binding these objects directly in Web Dynpro contexts, locks would remain attained as long as the user interaction is taking place. JDO theoretically could better adress this, but SAP's implementation currently does not allow attaching/detaching JDO objects from the transaction.
    => the best way of doing this, is by using JDO objects only as DataTransport objects. Someone familiar with JDO should know how this design pattern works. This means, that these JDO objects are not themselves persistent, but are only used to hold transient data. These JDO classes can be imported into Web Dynpro (using the JavaBean model) and bound to Web Dynpro contexts. But persisting the data means to hand the DTOs over to a service layer, which then copies the data, acquires the locks, and saves and commits the data to the persistent storage.
    No tutorials for such a scenario exist at the moment.
    Greetings, Bertram

  • Error Reading Property File in Portal Component

    Hello,
    I have created a portal component that calls an api that is located in a jar file.  The documentation on the Portal Component Structure specifies putting the jar file in the PORTAL-INF/lib directory, which I have done.  The problem is, my jar file reads a property file using ResourceBundle, but it doesn't find the property file.  I have placed the property file in the jar file, and throughout the portal component structure, but it just can't find it.  Has anyone else done something similar?  If so, where did you put your property file(s) for external jars that are used in the portal component.
    EP6 SP2 Patch27
    thanks,
    Keith

    Hi,
    I had similar issues and moved the property files to PORTAL-INF/classes.
    Best Regards
    Frank

  • Portal Component receives GET from other app out of the Enterprise Portal?

    Hello.
    I want to design a portal component, to which i can send GET-Parameters via URL.
    The sending application runs out of the enterprise Portal and has a simple HTML-form (The portal component generates HTML and JAVA-Script for a Flex Application in the Enterprise Portal which should point to a specific document named in the params. The params will be written into the generated HTML document after calling).
    Is this possible without authetification and how would the URL looks like, which is used to call the enterprise portal?
    Pls help me.
    With best regards
    Edited by: Björn Karpenstein on Aug 15, 2008 11:02 AM
    Edited by: Björn Karpenstein on Aug 15, 2008 11:03 AM
    Edited by: Björn Karpenstein on Aug 15, 2008 11:05 AM

    Hi Björn,
    you can access request parameters with the following code in the standard methods of your Portal Component:
              // IPortalComponentRequest request;
              request.getServletRequest().getParameter("ParamName");
    The direct URL of your Portal Component without a specific iView is:
    http://
    If your component should be directly accessable without authentication you must add the following property in your portalapp.xml in the the component-profile section:
          <component-profile>
            <property name="AuthScheme" value="anonymous"></property>
          </component-profile>
    Best regards,
    Stefan Brauneis

  • Event Handling in Abstract Portal Component

    Hi Friends,
    I am using HTMLB Classlib in an Abstract Portal Component to develop a Dropdownlistbox. Now I want to handle the event of change of selection in this dropdown. However, this event is not getting captured. Sample code is as follows:
    public class dropdownsimple extends AbstractPortalComponent
                           public void onClick(Event event)
                           public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
                                                    IPageContext myContext1 = PageContextFactory.createPageContext(request, response);
              Form myForm = myContext1.createFormDocument("CRMForm");
              GridLayout myGrid = new GridLayout();
              DropdownListBox drp = new DropdownListBox("drp");
              drp.addItem("Key 1","Item 1");
              drp.addItem("Key 2","Item 2");
              drp.setOnSelect("onClick");
                                                     myGrid.addComponent(1, 1, drp);
              myForm.addComponent(myGrid);
              myContext1.render();
    I am able to see the dropdown box along with values when I preview the PAR iView created from this component. Please let me know how to capture the event of change of selection in the dropdown?
    Edited by: Shetul Chothani on Jun 21, 2011 6:37 AM

    Hi,
    Change this line
    drp.setOnSelect("onClick");
    to
    drp.setOnSelect("click");
    and leave the line
    public void onClick(Event event)
    as it is, and it should work just fine.
    I.e., if you name your event "fooBar", the event handler should be named "onFooBar"
    Cheers,
    Robin

  • PortalRuntimeException in Business Object document iview No portal component associated with the following context

    Hi all,
    We are stumped with a problem in our QA Enterprise Portal (7.3.1 Sp7) that throws a portal runtime error when we preview a Business Objects document iview.  The Business Objects Server versions are 4.0 SP5 and/or 4.1 SP3.
    The error is caught in the the defaultTrace file, /usr/sap/QNW/J00/j2ee/cluster/server0/log
    [EXCEPTION]
    com.sapportals.portal.prt.runtime.PortalRuntimeException: There is no portal component associated with the following context:
    pcd:portal_content/com.summit.SES_BI/com.summit.iviews/Daily_Margin
    at com.sap.portal.prt.component.PortalComponentContext.<init>(PortalComponentContext.java:93)
    Here is what we have tried
    * Confirmed the iviews exist in the PCD, by browsing to the content folders and right lick, preview on the iview.
    * Our PRD and DEV systems work correctly and are on same versions of EP Runtime and java. 7.3.1.7.0.201..
    * Occurs with all Businessobjects iviews from the QA portal and all doc types, webis, dashboards. Tried creating new iview.
    * Reapplied the com.sap.businessobjects.iviews.templates.epa to the Portal from t he BI 4.1 SP3 distribution
    * Deleted and recreated the BI portal system connector using the SAP BOBJ system template set path to http://bi-qas:8080/BOE
    * Set the embed key value in the BI system connector property and in the custom global.properties file, restarted tomcat and SIA services
    * Set permissions for everyone end user on the content folders and the BI system connector
    * Confirmed Single sign on configured correctly between BI and Portal
    * Confirmed that the QA BI server is configured correctly by directing the working DEV Portal to the QA BI server.
    * Performed actions in note 1709737
    We are certainly stuck and the defaultTrace file is not very informative.  Any suggestions are greatly appreciated
    Lee Lewis

    This is resolve with note 1615838  - SAP Netweaver Enterprise Portal 7.3 iView creation with BI 4.0 results in exceptions.
    The note includes a file portalapp.xml that need to be inserted into com.sap.businessobjects.iviews.par that is included in the BI server distribution.
    Then deploy the ear file.....
    Odd thing is that the note mentions 4.0 and we are on 4.1 SP3...
    Environment
    SAP BusinessObjects BI Platform 4.0 SP02 Patch 4 or lower
    SAP Netweaver Enterprise Portal 7.3
    Lee Lewis

  • Difference between Abstract portal Component and JSPDyn page.

    Hi Experts,
    What is the difference between Abstract portal Component and JSPDyn page.
    Thanks,
    Jay.

    Hi,
    The PDK provides two methods for creating a portal component:
    Abstract Portal Component
    The Abstract Portal Component class offers a lean method for writing HTML commands to the Web client as well as for basic event handling. It is an implementation of the IPortalComponent, which is the central abstraction of the Portal Component API.
    DynPage
    The Page Processor Component, which extends the Abstract Portal Component, returns a DynPage. It provides more sophisticated event handling. Controls that produce events (such as buttons and checkboxes) have an event attribute that contains the name of the event handling method. This event handling method is invoked by the DynPage when it occurs.
    The JSPDynPage is an implementation of the DynPage and allows the use of the DynPage in combination with JSP (Java Server Pages).
    The PDK documentation and examples focus on the DynPage. Easier event handling and the separatation of content development (JSP) from application development (Java) make the DynPage a better choice for components with interaction and changing content.
    For more details, Refer thes thread,
    https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.basic.portalcomponentimplementation/docs/jspdynpage.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0b3e9d5-b2af-2a10-20ba-9f6ce6b1a27f
    Hop it helps..
    GS
    Edited by: Sathishkumar GS on Apr 14, 2008 2:07 PM

  • Creating iViews Based on Remote Portal Component iViews

    Hi,
         Does anybody know if Portal 7.0 EHP 2 supports creating a local iview for a remote transactional iview? I saw this SAP Help link, but it is not really clear on Transactional iviews.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/f7/34fe8694c84512a2c62cc6d145736e/frameset.htm
    Thanks
    Sathish

    Hi Prasanna,
    this needs some clarifying concerning wordings:
    1.) An iView is an "instance" of a portal component. Within the Portal, you have deployed different applications, each app consists of one ore more components (and/or services, but services are faceless).
    2.) The "traditional" way to implement such a component is to do it directly via HTMLB, JSPDynPages etc. Deploy this app within the portal and then you can create an iView build directly on this component.
    3.) Alternatively, you have components at hand, which import other applications / or web stuff. The most simple for example is an URL-iView. This is an iView using a component which just retrieves the content from some URL given. A more complex example is the ApplicationIntegrator, which does the same plus passing login params etc.
    4.) One possibility is to integrate WebDynpro-Applications via a specific WebDynpro iView. The combination of this has the added value that from WebDynpro Applications you are able to use the Portal Services, so you have a far more tight integration.
    5.) With all this at hand, the rest should be self declaring: Yes, you can develop "normal" J2EE-Apps, based on "good old JSP/Servlet + EJB" technology and integrate it via URL/AppIntegrator iViews. But you can also use WebDynpro for your frontend and EJB's for your backend with the advantage of tighter integration.
    Hope it helps
    Detlev

Maybe you are looking for

  • Unable to drag imported CD tracks to a playlist.

    All of a sudden I am unable to track imported CD tracks to a playlist in iTunes On my Mac Pro.  This is the first time I've had this problem. Any suggestions would be greatly appreciated. Thanks

  • Audio Synch

    I converted a VOB file to DV using MPEG Streamclip and then imported into FCE. The audio is now out of synch with the video. HELP! THanks!

  • Reference comp in dynamic internal table using CL_ALV_TABLE_CREATE

    Hi, I am using CL_ALV_TABLE_CREATE to create a dynamic internal table. Everything works fine, but there is one problem with it. How can i create a component in the internal table that is actually a REF TO a certain data type. i.e. later i would like

  • Unkown error -39

    Whenever I try to sync my iPhone I always get an error message saying "...'s iPhone cannot be synced. An unknown error occurred (39)." Any idea what this is?

  • Identify the Queue Name Based on the Datasource

    Hi Experts, How do we find the Queue name ( say for 2LIS_03_BF) in LBWQ based on Datasource/Extractor (2LIS_03_BF). Thanks, Satya