InitialContext from server-side applications

Just a question to see if what I am doing is correct.
According to this link:
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_design.html#1031811
if you are an internal client of an ejb you should use
Context ctx = new InitialContext();
instead of having to specify all the parameters like
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(h);
I am trying to connect to a connection pool from within an ejb. This
ejb is running in the weblogic server and the connection pool is in the
same server and is restricted to use by a special account that we
setup. If I just get the context by calling new InitialContext() and
then get the dataSource through this context, I won't have access rights
to the connection pool. So what I did was to provide everything but the
provider_url to get the context. Example:
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(h);
This way I provide everything but the URL to the weblogic server. The
reason I do this is because we have multiple weblogic servers and since
we don't want it to tied to only one server, I leave out the url and
assume that the InitialContext() will be gotten from the local server,
basically whichever server it is running on. It seems to work fine
right now. My concern is if the way I am explaining things is correct
and if what I am doing sounds logical.
Any input on this would be appreciated.

If you do not specify the properties, it defaults to the user guest. This
is a simplification that is useful if you have users logging in through
servlets/JSP.
Thanks,
Michael
Michael Girdley
BEA Systems Inc
"Senthil Kumar S" <[email protected]> wrote in message
news:[email protected]...
There is no restriction that u should not populate properties to get
initialContext.
U are doing the right way.
bhavin patel wrote:
Just a question to see if what I am doing is correct.
According to this link:
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_design.html#1031811
if you are an internal client of an ejb you should use
Context ctx = new InitialContext();
instead of having to specify all the parameters like
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(h);
I am trying to connect to a connection pool from within an ejb. This
ejb is running in the weblogic server and the connection pool is in the
same server and is restricted to use by a special account that we
setup. If I just get the context by calling new InitialContext() and
then get the dataSource through this context, I won't have access rights
to the connection pool. So what I did was to provide everything but the
provider_url to get the context. Example:
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
Context ctx = new InitialContext(h);
This way I provide everything but the URL to the weblogic server. The
reason I do this is because we have multiple weblogic servers and since
we don't want it to tied to only one server, I leave out the url and
assume that the InitialContext() will be gotten from the local server,
basically whichever server it is running on. It seems to work fine
right now. My concern is if the way I am explaining things is correct
and if what I am doing sounds logical.
Any input on this would be appreciated.

Similar Messages

  • From server-side application, launch client-side file?

    Are either of these possible?
    From a word document hosted by terminal server and accessed via SGD: user clicks on a hyperlink to C:\file.doc and it launches that file on the user's computer using that user's copy of MS word (rather than on the app server)?
    From a document management system hosted by terminal server and accessed via SGD: The system stores the file path of documents on the user's local area network. When the user wants to launch a file, he clicks on a button and that launches the file on his local area network using his local copy of MS word (just a thought: would involve passing the path from the app server to SGD server then to the local computer. Maybe via the tcc client?)
    Am thinking of several applications of this kind of thing, these are just 2 examples. Would really help us build server-side apps that run as if they are local (and would definitely up our license count of SGD). Thank you

    Are either of these possible?
    From a word document hosted by terminal server and
    accessed via SGD: user clicks on a hyperlink to
    C:\file.doc and it launches that file on the user's
    computer using that user's copy of MS word (rather
    than on the app server)?http://docs.sun.com/source/819-6255/attr_scottatrylocalwindowsapplication.html
    From a document management system hosted by terminal
    server and accessed via SGD: The system stores the
    file path of documents on the user's local area
    network. When the user wants to launch a file, he
    clicks on a button and that launches the file on his
    local area network using his local copy of MS word
    (just a thought: would involve passing the path from
    the app server to SGD server then to the local
    computer. Maybe via the tcc client?)
    Am thinking of several applications of this kind of
    thing, these are just 2 examples. Would really help
    us build server-side apps that run as if they are
    local (and would definitely up our license count of
    SGD). Thank you

  • How to send Subtopic Message From Server-Side to Client ?

    I’m new at flex and i have a new question about Flex
    Message Service.
    How to send messages from Server-Side Java Code with
    Subtopic?
    For example.
    I customed a Flex Message Adapter in Tomcat Server , with
    this Adapter , i can send message to Client with following code .
    ---------------------Send message to Client------------
    MessageBroker msgBroker =
    MessageBroker.getMessageBroker(null);
    String clientID = UUIDUtils.createUUID(false);
    AsyncMessage msg = new AsyncMessage();
    msg.setDestination("CustomMsgServiceDes");
    msg.setClientId(clientID);
    msg.setMessageId(UUIDUtils.createUUID(false));
    msg.setTimestamp(System.currentTimeMillis());
    msg.setBody(clientID + "this is my message from server! \n");
    msgBroker.routeMessageToService(msg, null);
    ---------------------Send message to Client------------
    But i want send a message that have Subtopic to the Client ,
    How to do ?
    Thank you for reply.

    There's a white paper that talks about this subject -
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=8f1eb6ea

  • How can i dispaly an Error Message from Server Side To form

    Hi All,
    How can i dispaly an Error Message from Server Side To form side .
    i try several ways nothing succed.
    i put the error in stack and after call the procedure from form i added
    Qms$Trans_Errors.Display_Messages;
    and because it is an error not informantional error the error screen displayed and enter
    in infinite loop acts like flashing .
    can any one help me please i use C/S Headstart6i and Designer 6i
    thanks alot
    radi

    hi,
    thanks alot lauri.
    yr code work only using information message but in error message its still the same .
    the error window still flash and enter in infinite loop of executeing the same triggers.
    thanks again
    radi

  • Need FMS Guru! to Read substitution.xml from Server Side Apps

    I know how to read XML file from HTTP using XML.load(url),
    but there are some config node i need to read from substitution.xml
    from conf folder. Seems like XML.load doesn't allow accessing
    Physical path from "D:\Program Files\Adobe\Flash Media Server
    3\conf" - I am new in FMS Development, I dont know how to access
    them from Server side. Help pls.

    Thanks by your help Shanu.
    Nevertheless, finally I tryed the easiest way (pass the parameter with 'GET'). Moreover I found why my code wasn't working. It was a fool thing. I though PDA connect throught a proxy, but it wasn't true. Whatever.
    Regards.
    FSG.
    The final script on the xml-report is:
    <report type="Validacion Online" required="false" multiple="false" attachments="false" scriptref="store://this/reportdef/script[@name='ValidacionOnlineValidation1']">
         <field sortid="0" id="Poliza" inputtype="textbox" label="Poliza" rows="1" wide="false" required="false"/>
    </report>
    <script name="ValidacionOnlineValidation1" script="if (0 == 0)
    var szURL="http://URL/vonline/vonline?parameter1=";+Poliza.value;                         
    var m_HttpReq = new ActiveXObject("Pocket.HTTP");                                             m_HttpReq.timeout = 15000;
    var m_HttpResponse = m_HttpReq.GetResponse(szURL,"");
    window.alert(m_HttpResponse.string);
    if (m_HttpResponse.statusCode==200)  {....}
    else {....}

  • Copy a .swf file from server side to client using signed applet

    Hello All,
    I already have my applet signed and its working pretty well. However I want to know how can I import a .swf file into clients machine. The .swf file initially is on server side, my applet checks whether this .swf file exists already on client machine. If not it copies it to his machine.
    I know how to chk if the file already exits on client machine but I am not sure how to copy this .swf file to his machine if its missing.
    May be I need to set some input buffers from server side and then copy them to his machine.
    Can some one throw some light on this issue ??

    Hello to all Java Code Masters out thr,
    I am trying to copy a .swf file from server side to client side, however I am unsuccessful in writing the correct data. By correct data I mean that , the data does gets saved on the client side in the .swf file, and the size of the .swf file on client side is as expected, but some how I don't know why the data is not the same as expected.
    I tried opening up both the swf file, one which is on server side and the other which is on client side. And both looked different in the notepad.
    When I opens up the client side .swf file on browser it shows nothing while the .swf file on server side worked fine.
    Here is a snap shot of the two .swf files when opened in notepad:
    clientside.swf
    &#22339;&#2131;&#51395;&#40056;&#48612;&#28681;&#56220;&#6234;&#31352;&#65363;&#27474;&#26039;&#46793;&#52076;&#11698;&#45679;&#32228;&#9617;&#45643;&#52076;&#54002;&#56237;&#62930;&#57181;&#27635;&#46965;&#48804;&#30062;&#60407;&#31086;&#2937;&#37359;&#28873;&#49741;&#8252;&#10112;&#503;&#8501;&#16164;&#43397;&#16140;&#10313;&#8264;&#537;&#13737;&#16956;&#43411;&#586;&#4917;&#43544;&#22918;&#4216;&#49632;&#40179;&#64495;&#64206;&#44335;&#61334;&#19077;&#57113;&#61099;&#53246;&#52863;&#52855;&#52985;&#32246;&#63967;&#27542;&#13055;&#32611;&#52219;&#26476;&#56728;&#25064;&#57340;&#63580;&#65317;&#56023;&#32706;&#57446;&#19865;&#24183;&#40928;&#65057;&#61684;&#25313;&#64294;&#45864;&#44950;&#25919;&#7115;&#8035;&#44004;&#31973;&#18921;&#32575;&#18967;&#25451;&#63915;&#44668;&#30262;&#32651;&#11230;&#60116;&#21241;&#51902;&#30302;&#2462;&#38913;&#38887;&#2904;&#47227;&#11350;&#25775;&#35978;&#25879;&#38313;&#61967;&#15065;&#8627;&#33840;&#11456;&#12040;&#52418;&#33633;&#6640;&#63050;&#65270;&#39008;&#42184;&#40462;&#49876;&#16324;&#15399;&#60051;&#62263;&#26562;&#19076;&#47084;&#16512;&#51385;&#58710;&#13280;&#42314;&#13071;&#55199;&#17948;&#14772;&#61464;&#8985;&#9032;&#16254;&#42612;&#16367;&#47121;&#16212;&#60451;serverside.swf
    CWS�� x���     p��ZxzS�Rk�e��l��-o��}�%K�l�������]��ku���nu��nyy���pM�< �'�5!$����I
    (H �
    5<B
    ��J5��Yx��������/����J������w����}���
    k�2c��lg���a��\�%��serverside.swf is what I expect to be saved, but clientside.swf is what i get.
    Below is a code snippet which I am trying :
      public void writeswftoclient(String swfcontent) {
        String userHome = System.getProperty("user.home" );
        String ImoracleDirectory = userHome + "\\MyFolder";
        File fdirectory = new File(ImoracleDirectory);
        if(!fdirectory.isDirectory()) {
          fdirectory.mkdir();
        String playlist = ImoracleDirectory + "\\clientside.swf";
        File fplaylist = new File(playlist);
        try {
          Writer output = null;
          output = new BufferedWriter(new FileWriter(fplaylist,true));
          *System.out.println(swfcontent);*
          *output.write(swfcontent);*
          output.close();
        catch (Exception e) {
          System.out.println("Cannot create or write to the playlist");
      }In above code I am trying to write the string swfcontent, which contains the data shown above in serverside.swf, to clientside.swf.
    Interesting thing is that I am doing System.out.println(swfcontent); just before writing the data to clientside.swf using output.write(swfcontent);. And System.out.println does print the write data on the java console. However I dont know out of what reason the data doesnt get written correctly on the client's computer.
    Kindly help me in this plzzzzzzzzzz.

  • Developing server-side applications using dreamweaver

    We are having issues developing server-side applications using dreamweaver for our client's website www.uuee.org.. They are building oracle database driven worldwide directory for Egyptian expatriates. Any help is highly appreciated.

    You made 3 statements. What is the question?  What do you need help with?

  • How to trigger navigation to a portal iView from server side event handler

    Hi,
    I am modifying the workset map application. I have created custom URL links under each iView which should navigate to different iViews depending on some business logic. So I had to provide a custom event handler for these iVIew links and the path to the next iview is dynamically created by the code in the event handler. Once the new PCD path is generated, the event handler should trigger a navigation to that PCD object. Which APIs can I use to trigger this navigation from the server side event handler? I have done this before in webdynpro where we used WDPortalNavigation (.absoluteNavigation or .relativeNavigation). Is there something similar that i can use in this case (i.e. when developing a simple Portal Application from an AbstractPortalComponent)?

    Hi,
    On my understanding of your requirement.
    the best solution what i think is use Object Based Navigation(OBN).
    Is much suitable to your requirement.
    Moreover you can use
    1.Relative navigation
    2.Absolute navigation.
    In the same way how you used in web dynpro.
    Same thing can be done in abstract portal component also.
    Try using that.
    Thanks & Regards,
    Lokesh
    Edited by: lokesh kamana on Aug 11, 2008 7:23 AM

  • How to get path of image from server side in form of URL

    Hello,
    I want to access images stored on server side local folder. How do I create a URL for that. Images in the folder changes dynamically, so I should be able to display the new modified images. Please help me.
    Thanks in advance

    Are you asking from client side to access server (local folder) images...
    if yes
    where the security goes....
    please be in detail...

  • Calling PL/SQL from Server Side Rule

    Hi there,
    I'm wanting to call a PL/SQL procedure from a server side rule created within collaboration suite using the oesrl command line utility. I have seen examples of the XML rule which should do this together with the appropriate PL/SQL
    &lt;account qualifiedName="UM_SYSTEM" ownerType="system"&gt;
    &lt;rulelist event="relay"&gt;
    &lt;rule description="Retention Rule" active="yes"&gt;
    &lt;condition negation="no" junction="and"&gt;
    &lt;condition&gt;
    &lt;attribute tag="rfc822to"/&gt;
    &lt;operator caseSensitive="no" op="contains"/&gt;
    &lt;operand&gt;instigate.com&lt;/operand&gt;
    &lt;/condition&gt;
    &lt;/condition&gt;
    &lt;action&gt;
    &lt;command tag="call"/&gt;
    &lt;parameter&gt;RulesPackage.archive_message&lt;/parameter&gt;
    &lt;parameter&gt;test1&lt;/parameter&gt;
    &lt;parameter&gt;Archive&lt;/parameter&gt;
    &lt;/action&gt;
    &lt;/rule&gt;
    &lt;/rulelist&gt;
    &lt;/account&gt;
    The above should call the Procedure RulesPackage.archive_message when an email to anyone at instigate.com arrives in OCS. I have written and tested an appropriate package. However, I have been unable to get the rule to execute and call my PL/SQL when I send an email to trigger it.
    I have written rules which do not invoke external packages without any trouble.
    I believe the problem is that I need to register the PL/SQL package with the rules engine somehow, before the rule can find it, but I am uncertain how to do this, or even if that is indeed what I need to do.
    Any help would be most appreciated as the documentation doesn't go into too much detail.
    I am using OCS R2.
    Regards
    Oliver

    Could you please check the structure of the procedure "RulesPackage.archive_message" ? It may fail due to procedure structure.
    The structure should be similar to the below example
    PROCEDURE archive_message
    (p_event IN NUMBER,
    p_sessionid IN NUMBER,
    p_msgobj IN es_mail.mail_message_obj,
    p_param1 IN VARCHAR2,
    p_param2 IN VARCHAR2,
    p_status OUT NUMBER) AS
    BEGIN
    /* Code for Archving */
    END;
    Relevant URL:
    http://download-west.oracle.com/docs/cd/B25553_01/mail.1012/b25459/ad_email_custact.htm#sthref677 (Please check Step 2 of "A Custom Action Written in Java")

  • Mail not moving messages or deleting from server until application quitted

    I have an Outlook.com email account. When I delete messages or move them in Apple Mail, the change is not reflected on the server until I quit the program completely. This isn't happening with other actions. Mail is immediately marked as read or flagged on the server for example. When I move or delete messages in Mail they actually show up in both the original location and the new location until the application is quitted.
    Anything I can do to fix this?
    OSX Mavericks 10.9.1
    Apple Mail 7.1

    Hi Thomas
    Yes...personal folders are mailboxes I've created to organize my mail. I know as a fact that this messages still are on the server even after moving them to "personal folders". anyway I think i can get around this issue by rightcliking on the account and then getting account information. I can then filter by "removed from my mac". at that stage there's an option to select those messages and "delete from server"...I think this will work...will try now.
    Thanks for your help

  • How to start streaming from server side after applet initialized on client

    Hi,
    I am using JSP for on demand streaming server.
    I have included an applet in jsp page which start new player on client side after on streamreceive event.
    But my problem is how to give call to server that applet on client side has been initialized and now streaming can go on.
    Is there any method / way to call class file which will start streaming?

    Oracle is designed to support connection from client to server. The client originates the connection.
    If you want the server to initiate the connection, you need to make the server pretend it is a client. Oracle even does this internally, when they want to use 'External Procedures'
    You may also use Oracle's Message Queue mechanism, called 'Advanced Queueing' to use a 'publish subscribe' model instead of a connection model. That is discussed in the Advanced Queue manual in the documentation at http://docs.oracle.com
    Finally, you can explore the possibility of using RMI from the database, as discussed in the Java related documentation at the same location.

  • Blackberry Z10 has deleted all my emails from all my accounts..​.also it has deleted emails from server side (OS Rev. 10.1.0.418​1)

    It's happened a bad thing.
    My Z10 (OS 10.1.0.4181) has decided to delete, from all my email account , each emails from july to today!!!! It's unacceptable!!! I have paid 700 Euro for a smartphone that delete my email?! It has deleted also emails from the server!!!
    WTF!!!
    Who pay for damage that I had?! So Blackberry, wake up! I am so disappointed!
    I pretend an answer from blackberry!!! Now!!!!

    Hey alexsgv,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    What type of email accounts are added to the BlackBerry Z10?  Are they all POP3 and IMAP accounts?  Also when a message is removed from the BlackBerry smartphone it will remove it from the mail server, this is by design.
    Did you do any software updates recently?
    I look forward to your reply.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • Running other server-side applications with JSP

    Hi,
    I'd like to know, if is possible run with JSP (Servlet, or JavaBean) other application, which support COM. I used something like this in JavaScript:
    application=new ActiveXObject("excel.application");
    and I had all possibilities of its API. I'd like to use excel as data source for user-friendly data input.
    Thanks for all suggestions

    Hi,
    I don't realy understand your question.
    If your javascript work using activeX, this code is executed on the client side (like the excel application and the excel file).
    You can, with a JSP, generate the html page that contain the script.
    Where is the problem ?

  • How to know which table affected at server side application.

    Hello all,
    I am new to sql developer and I am accessing oracle database 11g of some xyz company and there application from other machine.
    I want to know that is it possible to monitor there application, that on saving/retrieving data which tables are used and what sql statements that forms(in application) are using.
    If it is possible then please tell me how ?
    I have used Sql monitor Toad to trace such statements on the same machine.
    But I cant use toad, all I have sql developer.
    Thanks

    [sorry, deleted irrelevant wrong answer]

Maybe you are looking for

  • Can't find offline media for a saved project.  Premiere Element 13.  I'm just a novice

    I'm just a novice. I've tried to open an older project and it states that media is off line.  I haven't be able to get it back in order to burn another copy of the project.

  • EDI cable for 1820M in Malaysia

    Hi There!!! Anybody knows where can I get a new EDI cable for my 1820M in Malaysia??? It seems like very difficult to get the cable easily locally and the AudioDock can't work with a good EDI cable. It will be appreciate if anybody can help me out as

  • "FALSE" text showing up with opacity enabled

    Hello All, I like spry very much because it makes my web development experience really easy. I have a small problem though and it involves the spry horizontal menu. When i set opacity to a certain value for the container of my submenu, a "FALSE" text

  • Several items incorrect in note 1482402, manually uninstall BPC 7.5

    The gist of this note is correct, since it is basically the same procedure as for previous versions, however, details are wrong: The installation directory is referred to as c:\BPC when it is most likely c:\PC_MS The screen shot shows deleting a fold

  • SDN Access not working - Valid Serial from Amazon Package

    i cannot access the sdn using my login info and the license from the amazon special for studio creator. i try and it goes blank again. no error message nothing. I am starting to feel ripped off. Someone please help.