Exception when accessing PCD object from WD code

Hi All,
I'm trying to implement iview properties for a Web Dynpro project according to the code on "Maximizing Web Dynpro for Java"  book.
However, I'm getting "null" exception when running the following method:
public IAttributeSet getRoleAttributeSet(boolean reloadIt) {
    if (reloadIt) {
      roleAttributeSet = null;
    if (roleAttributeSet == null) {
      try {
        Hashtable env = new Hashtable();
        env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
        env.put(Context.SECURITY_PRINCIPAL, WDClientUser.getCurrentUser().getSAPUser());
        InitialContext iCtx = new InitialContext(env);
        roleAttributeSet = (IAttributeSet) iCtx.lookup(iViewPath);
      } catch (Exception e) {
    return roleAttributeSet;
The line "roleAttributeSet = (IAttributeSet) iCtx.lookup(iViewPath);" causes the exception.
I saw several examples in SDN but none of them worked for me.
examples like this: /message/2222425#2222425 [original link is broken]
I used this blog: /people/daniel.wroblewski/blog/2006/07/30/everything-you-wanted-to-know-about-the-pcd
and this PDF: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/314ae7a5-0c01-0010-c198-9c7c5e8cee46
But get the same exception.
I tried to set the iview path with & without "pcd:" prefix - didn't help
I added the "PORTAL:sap.com/com.sap.portal.pcd.glservice" to my project - didn't help.
Also, I tried using ASPECT_ADMINISTRATOR instead of ASPECT_SEMANTICS and get the IAttributeSet by using IADMInbase interface - didn't help either.
I used this code:
IAdminBase result =(IAdminBase)iCtx.lookup(objectName);
IAttributeSet myIview = (IAttributeSet) result.getImplementation(IAdminBase.ATTRIBUTE_SET);
Can someone provide me STEP BY STEP solution for getting IAttributeSet of an iview through Web Dynpro code.
The iview path exists.
I tested the code on EP6 SP16 & SP17.
Thanks,
Omri

Hi Bharathwaj,
I tried using the sharing references:
PORTAL:sap.com/com.sap.portal.ivs.api_iviewf and
PORTAL:sap.com/com.sap.portal.pcd.glservice
both didn't help
I have 'com.sap.portal.ivs.api_iview_api.jar' under the 'lib' folder.
Omri

Similar Messages

  • Exception when instantiating Context Object from Server Faces

    Hi guys,
    I am creating a Webproject whereby I uses Java Server Faces (with Sun Creator) to call a Session bean on my business logic layer located on a local weblogic server. The codes I use to look up JNDI is as follows:
    InitialContext initialContext;
    Properties prop = new Properties();
    prop.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
              "weblogic.jndi.WLInitialContextFactory");
    prop.put(javax.naming.Context.PROVIDER_URL, "t3://localhost:7001");
    initialContext = new InitialContext(prop);This piece of code works fine when I call from a console application, however, once I shift the codes to the managed bean of my server faces, I get the following exception :
    Description:  An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: javax.faces.FacesException
      #{Login.btn_login_action}: javax.faces.el.EvaluationException: org.omg.CORBA.DATA_CONVERSION: vmcid: SUN minor code: 214 completed: No
    Possible Source of Error:
       Class Name: com.sun.faces.application.ActionListenerImpl
       File Name: ActionListenerImpl.java
       Method Name: processAction
       Line Number: 78 If I comment away this code:
    ' initialContext = new InitialContext(prop);'
    The code will run fine, but of course I will need to instantiate my Context object to look up JNDI. I am not sure if it is because I cannot initiate the Context object within the managed bean of server faces. A search in google does not yield any results too.
    Any inputs are welcome, thnks a lot [:)]

    Hi Bharathwaj,
    I tried using the sharing references:
    PORTAL:sap.com/com.sap.portal.ivs.api_iviewf and
    PORTAL:sap.com/com.sap.portal.pcd.glservice
    both didn't help
    I have 'com.sap.portal.ivs.api_iview_api.jar' under the 'lib' folder.
    Omri

  • Nwdi-managed access of pcd-objects from java web dynpro

    Hi,
    im am trying to access portal pcd-objects from a java web dynpro component (namely getting and setting personalized iview properties). for locally managed web dynpro components this works fine with the code below.
    when i try the same with a nwdi managed web dynpro component i run into problems regarding references to used dcs. for instance, i need to reference used dc SAP_JTECHS/tc/epbc/pcm/adminapi/java because the build needs tcepbcpcmadminapijava.jar which is inside the mentioned dc. but access permissions of this dc don't allow the dependency. when i try to "add used dc ..." in nwds i get the error message: illegal dependency: access list does not allow use of ...
    has someone any solution for this problem? are there other ways of accessing pcd-objects from java web dynpro (nwdi managed!)?
    thanks
    heiko
    private static void savePersonalizationData(String value) {
         try {
              IAttributeSet attributeSet = (IAttributeSet) getIview(IVIEW);
              attributeSet.putAttribute(ATTRIBUTE, value);
              attributeSet.save();
         } catch (Exception e) {
    private static Object getIview(String pcdPath) throws Exception {
         Hashtable env = new Hashtable();
         env.put(
              com.sap.portal.directory.Constants.REQUESTED_ASPECT,
              com.sap.portal.pcm.admin.PcmConstants.ASPECT_SEMANTICS);
         env.put(
              Context.SECURITY_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         env.put(
              IPcdContext.PCD_PERSONALIZATION_PRINCIPAL,
              WDClientUser.getCurrentUser().getSAPUser());
         InitialContext iCtx = new InitialContext(env);
         return iCtx.lookup(pcdPath);

    Hi Kust,
    To access the PCD objects the code you used looks ok for me but your main issues is related to the dc access permissions. This thread discussed about the similar issue. Please review this below thread.
    /message/979328#979328 [original link is broken]
    Regards
    Krishna Reddy

  • Accessing an object from a different server

    Hi,
    I am making a program that will access an object from a different server.
    I have a program that when I run calls a jsp page running on Server A which in turn should request an object A from Server B.
    I am relatively new to Java and jsp. What would my best course of action be.
    Thanks in advance,
    Brian

    Or RMI?OK, sounds good, I will look up some RMi on the site.
    Thanks, will prob have more questions for you later.

  • Access file object from flex web app

    Hi all,
    I want to access file object from flex web app. What should i do?
    I have to take array from my XML. In XML there will be only dir path. So for taking file name from dir i have to access it and have to perform for loop on that dir.
    What should I do?
    Any Ideas?
    Thanks,
    -CK

    Hi Michael
    My question is that I dont want to give name of images in XML file.
    In XML file there will be only path of image directory. So I need to find all image name from that image directory.
    Thats why I want to access file object.
    Any ideas?    

  • Bought a new Canon MG7540 printer to replace the old HP A618. When printing vector objects from Illustrator, they look like graphics from dandy (8 bits) ... no smooth, all cubes ... if do raster than print perfectly.  Who knows how to treat it? No well to

    Bought a new Canon MG7540 printer to replace the old HP A618. When printing vector objects from Illustrator, they look like graphics from dandy (8 bits) ... no smooth, all cubes ... if do raster than print perfectly.  Who knows how to treat it? No well to rasterize vector before each printing. OS - MacOs 10.10.

    Have you read the User's Guide for that printer?  Odds are you will get reasonable prints.  However, it is a photographic printer.  That said, it should print excellent quality photographic files.  To get smooth lines in Illustrator, try Preferences > Use Anti-Aliased Artwork.  That will smoothen the output.  If, for some reason, that does not work, try Print > Save As PDF > open PDF in Reader and print from there.  Check the User's Guide for media sizes available for your particular printer.  Setup your artboard to the size page you want the image to print on.  Use View > Show Page Tiling ( to see where the page's printable area lies.  Align the page with the artboard using the Page tool.

  • How to access COM+ Objects From JSP

    Friends,
    We have a requirement to access COM+ objects from JSP. Please guide me on this.
    Thanks in advance.
    Tarani

    Sanyam wrote:
    if there is any .dll extension file, how can we read that file in labview?
    You can use Call Library Function node to call that dll file and use it in LabVIEW. Read the help and you will get more details.

  • Accessing java objects from within javascript

    Hello,
    Anyone with an idea of a useful toolkit for accessing java objects from within javascript will be much appreciated.
    Thanks in advance,
    Antana.

    What do you mean by accessing Java objects? Do you mean interacting with an applet via JavaScript? Something else?

  • Can u access Oracle9i Reports objects from Java Code?

    Hi,
    How can you access Oracle9i Reports (Rel 2) objects like Body, DataSource, Groups etc from Java Code?
    What are the available APIs?
    I went thru the APIs at http://otn.oracle.com/products/reports/htdocs/getstart/docs/Javadocs/oracle/reports/plugin/definition/package-summary.html
    However various constructors stated in these APIs are using classes from "oracle.reports.definition" package which are difficult for me to locate.
    For eg. Report constructor is using oracle.reports.definition.RWReport and there is no API documentation available for RWReport class.
    Please suggest me the site for the above APIs or the method to get a reference to "Report" instance.
    Thanks
    Rakesh.

    Thanks Tugdual for your quick reply.
    Thats exactly what I am trying to do. I want to develop a utility which can have a subset of Report Developer's functionality.
    Currently using Reports Developer & Report Wizard, I can create a report by providing SQL statement and few parameters (like Report Style, Calculated Fields, Template file etc). I want to put all these parameters in a XML file and run my java utility (based on the APIs which I am looking for) which will use these XML parameter file and generate a '.rdf' file.
    Also, could you please suggest me the site for oracle.reports.definition package API or the way to get a reference to oracle.reports.plugin.definition.Report instance.
    Thanks,
    Rakesh

  • Error when accessing Tuxedo Services from Weblogic

    Hi,
    I have a stateless session bean deployed on Weblogic 10.3.5 . I have a WTC Server configured to connect to my Tuxedo server.I have all the local and remote AP's set on this server also.
    Now I am trying to access Tuxedo server from a method in my deployed EJB. Method looks like this
    ========================================================================================
    Context ctx;
         TuxedoConnectionFactory tcf;
         TuxedoConnection myTux; // For now we get it via NEW until the Factory works
         TypedString myData;
         Reply myRtn;
         int status;
         System.out.println("getData called, converting " + toConvert);
         try {
         ctx = new InitialContext();
         tcf =
         (TuxedoConnectionFactory) ctx.lookup("TuxedoConnectionFactory");
         } catch (NamingException ne) {
         // Could not get the tuxedo object, throw TPENOENT
         throw new TPException(TPException.TPENOENT,
         "Could not get TuxedoConnectionFactory : " + ne);
         myTux = tcf.getTuxedoConnection();
         myData = new TypedString(toConvert);
         System.out.println("About to call tpcall");
         try {
         myRtn = myTux.tpcall("TOUPPER", myData, 0);
         } catch (TPReplyException tre) {
              System.out.println("tpcall threw TPReplyExcption " + tre);
         throw tre;
         } catch (TPException te) {
              System.out.println("tpcall threw TPException " + te);
         throw te;
         } catch (Exception ee) {
              System.out.println("tpcall threw exception: " + ee);
         throw new TPException(TPException.TPESYSTEM, "Exception: " + ee);
         System.out.println("tpcall successfull!");
         myData = (TypedString) myRtn.getReplyBuffer();
         myTux.tpterm(); // Closing the association with Tuxedo
    ========================================================================================
    I get following error when i call the above method from my client for EJB.
    ========================================================================================
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not get TuxedoConnectionFactory : javax.naming.NameNotFoundException: Unable to resolve 'TuxedoConnectionFactory'. Resolved ''; remaining name 'TuxedoConnectionFactory'
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
         at sfsb3.ReplicableSFSB_6ri454_ReplicableSFSRemoteIntfImpl_1035_WLStub.getData(Unknown Source)
         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:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
         at $Proxy0.getData(Unknown Source)
         at test.TestDemoClient.main(TestDemoClient.java:37)
    ========================================================================================
    I need to resolve this quickly please.
    Thanks for any help
    Regards,
    Awais

    I'm not very familiar with Tuxedo unfortunately.
    I recommend that you post here:
    Could not get TuxedoConnectionFactory, setting up AP's incorrectly?
    You could also start with the code here:
    Where to Download weblogic.wtc.jatmi Library/Package
    And follow the instructions here:
    http://download.oracle.com/docs/cd/E21764_01/web.1111/e13756.pdf

  • Class not Found when accessing Proxy class from backing bean in VC.

    Hi All,
    I'm attempting to access a class of a webservice(generated as a proxy) within my ADF application and invoke the method within a backing bean of the View Controller(bean scope : backing bean). The proxy has generated an ObjectFactory class among other classes. When I access this Object factory class from within the backing bean, the application throws a Class not found error.
    I don't know where the error lies since I've declared the View Controller of the ADF application dependent on the Proxy and I've imported the class and accessing it within a backing bean. How would you suggest I approach resolveing this.
    JDev : 1.1.1.4
    Thank you.
    Regards
    PP.

    Hello Arun,
    Thank you for suggesting a Data control, but my requirement isn't to drag and drop the method as a button. It's more of a behind the scnes updating data via a database adapter requirement.
    I've resolved the issue. turns out, my deployment archive didn't include the proxy.jpr. Once included it works likea charm.
    Thanks
    PP.

  • Accessing stage objects from other objects

    I have drawn colored rods which I have placed in the library and have put one of each on the stage with instance names like
    blueRod_mc, etc.
    I place them around with time-line code like
    blueRod_mc.x = 300.0;
    I have now created an Actionscript class called Problem.
    I build a new object from Problem which I have called Riddle.
    But when I put blueRod_mc.x = 300.0 in a method (of Problem),
    I get the message that blueRod is not accessible.
    So I tried
    stage.blueRod_mc.x = 300.0;
    That did not work either.
    What does work? How can I modify properties of stage objects like blueRod from
    within an AC3 object like Riddle?

    public class Problem {
      private var number1:String ="";
      private var number2:String ="";
      private var rigor:Number = 1;
         // rigor: -1 is 3 steps, -2 is 4-5 steps, -3 is 6-7 steps
      private var step:Number = 1;
      private var numSteps:Number = 3;
      private var solving:Number = 0;
      private var true1Length:Number;
      private var true2Length:Number;
      private var tuple = new Array(6);
      public function Problem():void  {
       // constructor code
       var i:Number;
       var j:Number;
       for (i = 0; i < 6; i++) {
                     tuple[i] = new Array(3+5);
                     for (j=0; j < 3; j++) {
                       tuple[i][j] = new Array(8+7);
       buildIt();
       planIt();
    Just insert bolded code where you need to.

  • How to access form objects from different class?

    Hello, I am new to java and i started with netbeans 6 beta,
    when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
    i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
    Question>
    How can i access jTextField1 value from different class that i created in the same project?
    please help. and sorry for such newbie question.
    Thanks Mike

    hmm now it says
    non static variable jTree1 can not be referenced from static context
    My code in ClasWithFormObjects is
    public static void setTreeModel (DefaultMutableTreeNode treemodel){
    jTree1.setModel(new DefaultTreeModel(treemodel));
    and in Class2 it is
    ClasWithFormObjects.setTreeModel(model);

  • Illustrator Application Window Resizes When Opening Smart Object from PSD

    Hi All, I've taken a vector graphic created in AI CS4 and pasted it into my PSD CS4 doc as a smart object. When the original AI file was created the application window was set as I preferred it, filling my screen. When I double click the Smart Object in PSD to edit it back in Illy, the window that contains the application has been switched off of the fill screen mode and is quite a bit smaller. I know it's small but now I have to click the maximize icon in the application bar to get Illy to fill the screen again. It wouldn't be so bad once, but the application window resizes itself every time I punch back into the smart object from PSD.
    Any ideas on how I can get the AI environment from switching around on its own??
    Win 7, CS4, all patches current, Dual 22" montiors
    thnx,
    jeff

    I just want to point out that when you open the smart object of course it is not the same file as the original but an embedded copy of it.
    That might also have something to do with this issue and might also be a photoshop issue with the smart object and one reason might be that Photoshop is see the image as resolution and Illustrator sees it as a dimension and the teams might be able to do something about this but might not actually be aware of it unless you file a report even if it is not a bug it would then be a feature request.
    They might not be able to do anything about it but then there might be a clever engineer with an idea, so it might be worth the report.

  • Exception while accessing com port from servlet

    I am trying to access communication port from a Servlet using java communications api's.
    But Following exception was thrown
    Caught java.lang.NullPointerException:name can't be null while loading driver com.sun.comm.Win32Driver
    The SecurityManager do not allow that opeartion.
    java.security AccessControlException:access denied (java.io.FilePermission c:\j2sdk1.4.1\jre\lib\javax.comm.properties delete)
    at java.security.AccessControlContext.java:270) at java.security.AccessController.checkPermission(SecurityManager.java)
    at java.lang.SecurityManager.checkDelete()
    at java.comm.CommPortIdentifier.getPortIdentifiers(CommportIdentifier.java)
    Please help me.Tell me what to do.how to successfully access a communication port from a Servlet.

    Hi there. I am also facing the problem accessing com port via servlet. if u have the solution, kindly forward to me at [email protected]
    many thanks

Maybe you are looking for