How to set portal context using Java/JPDK api.

Hi,
I am in the process of converting pl/sql based database provider contect portlets to Java based JPDK. I ran into issue where the database provider portlet users were getting context auto matically. Now with Java/JPDK portlets , I am receiving no data found error, since the context is not set. The pl/sql is setting wwctx_private_api.set_context ('portal') to set the context. From Java if we call this api, it is taking a toll on the performance and the portlet times out.
Can any help how to set the context for a web provider using JPDK or any other better solution. Any immediate help is highly appreciated.
Thanks,
Rav.

Hi
We are trying to access content views for e.g portal.wwsbr_all_items s, portal.wwsbr_all_content_areas c,portal.wwsbr_all_folders f, from aweb provider portlet. When we do a select on those objects , we are getting java sql exception saying "ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "PORTAL.WWCTX_SSO", line 1745
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "PORTAL.WWCTX_SSO", line 1579
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "PORTAL.WWCTX_SSO", line 1834
ORA-06512: at "PORTAL.WWCTX_API", line 199
We need to know how to accesss the above views from a jsp based portlet.
A

Similar Messages

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How to print PDF files using java print API

    Hi,
    I was goign throw lot of discusion and reading lot of forums related to print pdf files using java api. but nothing seems to be working for me. Can any one tell me how to print pdf files using java api.
    Thanks in advance

    Mike,
    Can't seem to get hold of the example described in your reply below. If you could let us have the URL to get then it would be great.
    My GUI application creates a pdf document which I need to print. I want to achieve this using the standard Java class PrinterJob (no 3rd party APIs I'm afraid, commercial restraints etc ..). I had a stab at it using the following code. When executed I get the pretty printer dialog then when I click ok to print, nothing happens!
    boolean showPrintDialog=true;
    PrinterJob printJob = PrinterJob.getPrinterJob ();
    printJob.setJobName ("Contract.pdf");
    try {
    if (showPrintDialog) {
    if (printJob.printDialog()) {
    printJob.print();
    else
    printJob.print ();
    } catch (Exception PrintException) {
                   PrintException.printStackTrace();
    Thank you and a happy new year.
    Cheers,
    Chris

  • How to calculate call duration using java card API

    Hi,
    I am developing an application using Java card API. I want to calculate duration of otgoing calls in it. I am trying to start timer at the beginning of call in Call Control event. Can someone kindly check following code of Call control event? Here timerManagement function is sending proactive command for starting timer for 3 hours. Here I am asuming that maximum call will be of 3 hours. In callDisconnect event i can get current value of timer and use it to calculate duration of call. But this scenario is also not working.
    Problem is that during code execution program stuck at send command (proHdlr.send();) of timmerManagement function. I am sending postAsBERTLV command before starting timer so may be reason is that it is not possible to send proactive command while phone is busy.
    But I also cannot send postAsBERTLV after timerManagement function. Because it is mention in specification that "The EnvelopeResponseHandler content must be posted before the first invocation of a ProactiveHandler.send method or before the termination of the processToolkit, so that the GSM applet can offer these data to the ME (eg 9Fxx/9Exx/91xx). After the first invocation of the ProactiveHandler.send method the EnvelopeResponseHandler is no more available"
    Take a look at following code
                     * Method illustrating the use of the Call Control event.
                    private void callControlService() {
                                    /** @todo: Replace following sample code with your implementation */
                                    ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
                                    EnvelopeHandler envHdlr = EnvelopeHandler.getTheHandler();
                                    ProactiveResponseHandler rspHdlr = ProactiveResponseHandler
                                                                    .getTheHandler();
                                    EnvelopeResponseHandler envRspHdlr = EnvelopeResponseHandler
                                                                    .getTheHandler();
                                    durationCount = 0;
                                     // allow call with no modifications
                                    envRspHdlr.postAsBERTLV((byte)0x9F, (byte)0x00);
                                    // start clock using timer
                                    timerManagement(proHdlr, rspHdlr, (byte) 0x0, timer_id, tempBuffer);
                                    return;
                    }Please help me in this regard
    Thanks
    Yasir

    I am also unable to start timer in call connected event. I cannot send any proactive command while phone is busy. I am using Gemalto development Suite and there simulators (Simulation 2G chain).
    Is it limitation of simulator that you cannot send any proactive command while phone is busy?
    Is there any other work around for getting call duration?

  • How to send e-mail using java mail api

    Hi can anyone tell me how to send mail using the javamail api, in short if possible an example code.

    Theres already lots of this code in the forums, use the search bar to the left.
    Also, there is a dedicated javaMail forum which you will find useful (you are currently in a JSP forum)
    http://forum.java.sun.com/forum.jspa?forumID=43

  • How to set environment variables using java program

    Hi all
    I want to set environment variables on windows 98/200/xp system, such as path and classpath using a java program.
    How to do this using a java program.
    Any body plz helppppppppp.

    #1 05-02-2003, 07:38 AM
    Goodz13 Join Date: Jan 2002, Posts: 985
    Location: Halifax, NS, Canada
    Reputation:
    Java FAQ's and tutorials
    Java FAQ's
    Path and ClassPath:
    PATH
    In Windows 9x you would set it up in the autoexec.bat file
    ie.
    SET PATH=%PATH%;c:\jdk1.4.2\bin\;
    where c:\jdk1.4.2\ is the path where you installed Java.
    In Windows 2000 and XP
    Right click on My Computer->Properties->Advanced Tab->Environment Variables... Button.
    If you see a PATH in System Variables, click that and edit it. If you don't, you will need to create a new System variable.
    It should look something like this:
    %SystemRoot%\system32;%SystemRoot%;c:\jdk1.4.2\bin\;
    Any querry email me to [email protected]
    Answer by
    Rajasekhar Goli
    DS UNICS Infotech

  • How to receive HTML email using JAVA Mail API?

    Hello!
    I am developing WEB Mail System. There is a little problem. I am unable to receive mail in HTML format. The mail is being received in only text format currently. What method do i need to use to achieve this functionality currently i am using
    MimeMessage message = mail.getMessage();
    if(message.isMimeType("text/plain")){
    String str_message_body = message.getContent().toString();
    else
    Multipart multipart = (Multipart)message .getContent();
    Kindly advise me regarding that because i am in a state of fix right now and unable to proceed further.
    I will really appreciate a prompt response from you.
    Regards,
    Burhan Ramay.

    HTML is a text format too, so you do
    if(message.isMimeType("text/html")){
    String str_message_body = message.getContent().toString();
    }

  • How to dynamically configure JPA setting at runtime using java code?

    Hi,
    I am new to EJB 3.0 and JPA. I am trying to help my company to deploy the use of JPA in EJB3.0. Currently, i am trying out with OpenJPA in IBM Webshpere Application Server 7.0. We have four different WAS servers running for testing, system integration testing, user testing and production respectively, and in each region, the configurations for data source, JDBC username and password, schema, etc are different. So i think i would need to configure the JPA setting during runtime using Java code that determines which is the environment. And apparently i am stuck with the limited knowledge i have.
    1) I understand that i could override the JDBC in the persistence xml by creating entity manager using entity manager factory. But is it possible that i do similar thing by using inejction of persistence context on entity manager to obtain a container managed entity manager?
    2) Alternatively, it is possible to create multiple persistence unit in the XML and inject different PU to the entity manager, am i right? But how to inject dynamically since @PersistenceContext(unitName="xxx") only accepts constant declaration.
    3) Is it possible that the JDBC username and password are read from properties file?
    Thanks for your help in advance!

    Hi
    Thanks for the reply.
    Are you saying that i have to configure the data source authentication to the backend DB2 using the JAAS-J2C? Correct me if i am mistaken. I guess i am unable to do so as the application server setup only contains one data source, and the server hosted a number of applications. Every applications has their own JDBC username and password supply to the data source (the ID supplied at the DB2 side will decide which resource can access) and thus, i have to supply the username and password at runtime. Talked to the server guy and seems that it is not feasible to have seperate datasource for each applications as considered to the volume of applications hosted inside the server.
    Any suggestion?

  • How to do set apps context in java concurrent program

    Hi,
    Can any body help me in setting apps context in Java Concurrent program. I tried using AppsContext class and methods but did not work.
    Thanks for help in advance
    Pavan

    Go on Unix box at $JAVA_TOP/oracle/apps/iby/scheduler
    You will get class file FDExtractAndFormatting.
    Decompile it to get source code.
    Thanks, Avaneesh

  • How to access NTFS entries using Java

    I want to access and read the attributes of a file stored in the Master File Table of NTFS.
    How should I do it using Java. Is using native code and using JNI the only way or is there a package in Java that supports this?
    Thanks

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • How to set-up and use FAMILY Sharing

    Can someone please explain to me in detail how to set-up and use FAMILY Sharing, none of the information I have so far found in the documentation helps at all, in fact it puts you in a constant loop giving the same information over and over again
    We have quite a few devices from ipads, iphones and ipods and I need to set-up Family Sharing.
    We have our main Apple ID which is linked to our Payment method, I have now got my son a new iPad, I have created his Apple ID and set-up a link via FAMILY Sharing to our main Apple ID.
    From what I read we should be able to share our purchased Apps between family members.
    So I figured I would be able to get the Apps now via iTunes that are part of the FAMILY Sharing, however when I go into ITunes (latest version downloaded yesterday) I can only see the Home sharing menu item not FAMILY Sharing, so I cannot work out in Itunes how to get Apps that are FAMILY shared.  So ok I will try and get Apps directly via the Ipad using the App Store.  To test it is working I look for a known paid for App, I then go to download it and it is now asking me to pay for it again. 
    Can someone please explain to me in detail how FAMILY Sharing is supposed to work and how I get it to work please.
    Thanks for your help
    Greg

    Hey GregWr,
    Thanks for the question. The following resources provides some of the best information regarding Family Sharing. Included, you’ll find information on making sure the accounts are set to "Share my purchases”, as well as information on downloading Family Member purchases from the iTunes Purchased section. Please note that some applications are not shareable.
    Sharing purchased content with Family Sharing - Apple Support
    http://support.apple.com/en-us/HT201085
    Which purchased content can I share using Family Sharing - Apple Support
    http://support.apple.com/en-us/HT203046
    If you don't see your family's shared content - Apple Support
    http://support.apple.com/en-us/HT201454
    Thanks,
    Matt M.

  • How to set up shared use of "Contacts" data w/ 2 individual user accounts?

    How to set up shared use of application "Contacts" data for two individual user accounts?

    Link the contacts in one user account to a online cloud based system like Google or apples iCloud and then link the second user to that same online account. This could cause some slight problems if both people maintain their own online account to either of those systems on a phone or pad.

  • How do i use java printing api 1.4

    How can i print documents using jdk1.4 api.
    I have used the following program for printing.
    import java.io.*;
    import java.awt.*;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class Print2DtoStream implements Printable{
    public Print2DtoStream() {
    /* Use the pre-defined flavor for a Printable from an InputStream */
    DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
    /* Specify the type of the output stream */
    String psMimeType = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType();
    /* Locate factory which can export a GIF image stream as Postscript */
    StreamPrintServiceFactory[] factories =
    StreamPrintServiceFactory.lookupStreamPrintServiceFactories(flavor, psMimeType);
    if (factories.length == 0) {
    System.err.println("No suitable factories");
    System.exit(0);
    try {
    /* Create a file for the exported postscript */
    FileOutputStream fos = new FileOutputStream("out.ps");
    /* Create a Stream printer for Postscript */
    StreamPrintService sps = factories[0].getPrintService(fos);
    /* Create and call a Print Job */
    DocPrintJob pj = sps.createPrintJob();
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    Doc doc = new SimpleDoc(this, flavor, null);
    pj.print(doc, aset);
    fos.close();
    } catch (PrintException pe) {
    System.err.println(pe);
    } catch (IOException ie) {
    System.err.println(ie);
    public int print(Graphics g,PageFormat pf,int pageIndex) {
    if (pageIndex == 0) {
    Graphics2D g2d= (Graphics2D)g;
    g2d.translate(pf.getImageableX(), pf.getImageableY());
    g2d.setColor(Color.black);
    g2d.drawString("example string", 250, 250);
    g2d.fillRect(0, 0, 200, 200);
    return Printable.PAGE_EXISTS;
    } else {
    return Printable.NO_SUCH_PAGE;
    public static void main(String args[]) {
    Print2DtoStream sp = new Print2DtoStream();
    However when i run this program,it prints "example string" as used in g2d.drawString("example string",250,250) method above.
    What if i want to print content from any file.
    So anybody konwing this plz reply

    This is covered pretty well in the Java Print Service API Guide.
    You could start here http://java.sun.com/j2se/1.4.1/docs/guide/jps/spec/printing.fm1.html
    Basically, you have two choices - either you're going to throw a document at the print service, or you're going to print using Graphics2D commands. You also have the choice between printing to a printer, or to a stream. Mix and match for four combinations.
    Whether you can just take a raw document and send it to a printer via the document printing stuff depends on what print services you have installed. For the standard J2SE, it's pretty limited.
    If you're doing it via the Graphics2D approach, however, you can print anything you can draw. That's nice - it means you can use the same code to display stuff on the screen and print it.

  • How to set up and use AirPlay

    How to set up and use AirPlay

    Welcome to the Apple Community.
    AirPlay; When watching suitable content on the iPad, tap the screen to bring up the controls, tap the AirPlay icon and select the Apple TV. The content will then stream to the Apple TV.
    Mirroring; Double tap the home screen button, swipe the application panel to the right, tap the AirPlay icon and choose the Apple TV. The iPad screen will then be streamed to the Apple TV.

  • How to send mail attachments using java mail

    can any one help how to create mails attachments using java mail

    you can do it like this:
    Message msg = new MimeMessage(session);
    String fileAttachment = "c:/test.txt";
    Multipart mp = new MimeMultipart();
    BodyPart bp = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(fileAttachment);
    bp.setDataHandler(new DataHandler(fds));
    bp.setFileName(fds.getName());
    mp.addBodyPart(bp);
    msg.setContent(mp);
    ...

Maybe you are looking for

  • My macbook pro keeps crashing

    My macbook crash, airport card turns off or both happens. I upgrade to lion that didn't help. Jun 4 15:18:43 jeffs-MacBook-Pro loginwindow[50]: Login Window - Returned from Security Agent Jun 4 15:18:44 jeffs-MacBook-Pro loginwindow[50]: USER_PROCESS

  • Thunderbolt to ethernet - Network printing

    Hi there, I'm currently trying to get an employees Macbook pro 13" Retina 2013 integrated with a windows network. So far I have manged the boot camp installation and all other services have been integrated successfully; however it seems that our netw

  • Instructions to Tech Svs Dept in setting up Adobe Premiere in school firewall setting?

    Hi.  I work in a public high school in a very large school system.  While I have new computers w/8gb of ram and decent video and audio cards, our Adobe Premiere 9.0 software frequently stalls, freezes, won't open projects, etc. . . .  The problems ar

  • What is the need of ALE/ IDOC

    Hi All, What is the need of ALE/ IDoc and why we go for ALE?IDOC with conditions Let me know the answers if anyone have the solution Regards' Ramesh

  • Exchange 2003 will migrate to Exchange 2010 or Exchange 2013

    Hi, Exchange server is on exchange 2003 on windows 2003 R2.       I had an architecture of parent & child domain controllers, Where parent company is closed Down. But we have an additional Domain Controller of parent DC in our premise. Due to this fa