Search Results

Search found 7738 results on 310 pages for 'calling convention'.

Page 10/310 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • new Stateful session bean instance without calling lookup

    - by kislo_metal
    Scenario: I have @Singleton UserFactory (@Stateless could be) , its method createSession() generating @Stateful UserSession bean by manual lookup. If I am injecting by DI @EJB - i will get same instance during calling fromFactory() method(as it should be) What I want - is to get new instance of UserSession without preforming lookup. Q1: how could I call new instance of @Stateful session bean? Code: @Singleton @Startup @LocalBean public class UserFactory { @EJB private UserSession session; public UserFactory() { } @Schedule(second = "*/1", minute = "*", hour = "*") public void creatingInstances(){ try { InitialContext ctx = new InitialContext(); UserSession session2 = (UserSession) ctx.lookup("java:global/inferno/lic/UserSession"); System.out.println("in singleton UUID " +session2.getSessionUUID()); } catch (NamingException e) { e.printStackTrace(); } } @Schedule(second = "*/1", minute = "*", hour = "*") public void fromFactory(){ System.out.println("in singleton UUID " +session.getSessionUUID()); } public UserSession creatSession(){ UserSession session2 = null; try { InitialContext ctx = new InitialContext(); session2 = (UserSession) ctx.lookup("java:global/inferno/lic/UserSession"); System.out.println("in singleton UUID " +session2.getSessionUUID()); } catch (NamingException e) { e.printStackTrace(); } return session2; } } As I understand, calling of session.getClass().newInstance(); is not a best idea Q2 : is it true? I am using glassfish v3, ejb 3.1.

    Read the article

  • Not getting an array as result (calling a webservice by AJAX-JSON)

    - by Pasargad
    I'm trying to get the result of my web service as an array and then loop over the result to fetch all of the data; what I have done so far: In my web service when I return the result I use return json_encode($newFiles); and the result is as following: "[{\"path\":\"c:\\\\my_images\\\\123.jpg\",\"ID\":\"123\",\"FName\":\"John\",\"LName\":\"Brown\",\"dept\":\"Hr\"}]" tehn in my Web application I'm calling the rest web service by the following code in the RestService class: public function getNewImages($time) { $url = $this->rest_url['MyService'] . "?action=getAllNewPhotos&accessKey=" . $this->rest_key['MyService'] . "&lastcheck=" . $time; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); if ($data) { return json_decode($data); } else { return null; } } and then in my controller I have the following code: public function getNewImgs($time="2011-11-03 14:35:08") { $newImgs = $this->restservice->getNewImages($time); echo json_encode$newImgs; } and I'm calling this `enter code here`controller method by AJAX: $("#searchNewImgManually").click(function(e) { e.preventDefault(); $.ajax({ type: "POST", async: true, datatype: "json", url: "<?PHP echo base_url("myProjectController/getNewImgs"); ?>", success: function(imgsResults) { alert(imgsResults[0]); } }); }); but instead of giving me the first object it is just giving me quotation mark (the first charachter of the result) " Why is that? I'm passing in JSON format and in AJAX I mentioned datatype as "JSON" ! Please let me know if you need more clarification! Thanks :)

    Read the article

  • IIS 6 404 error calling on localhost

    - by Paleta
    I'm kinda desperate here I have a Windows 2003 Server and when I try to call http://localhost I get a 404 error I have localhost configured to c:\inetpub\wwwroot\ and whatever file I create there it always shows a 404 This is what I see on the log file 2010-07-22 14:54:06 W3SVC1 127.0.0.1 GET / - 80 - 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) 404 0 3 I tried restarting IIS with no luck, the eventvwr shows no error whatsoever. Please any light will be appeciated

    Read the article

  • calling a different python interpreter from bash command line

    - by Dennis Daniels
    I have python 2.7 installed [user@localhost google_appengine]$ python Python 2.7 (r27:82500, Sep 16 2010, 18:03:06) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. I want to use the python 2.5.2 that is in this directory [user@localhost Downloads]$ ls |grep "Python-2*" Python-2.5.2 Python-2.5.2.tgz to run a python script in Khan Academy platform against a google app engine application sudo python sample_data.py -a ~/workspace/GAE/google_appengine/appcfg.py upload Currently, when running the last script 2.7 python complains a lot (Google App Engine runs on 2.5.2 mostly and 2.6 almost) I would like to do something like sudo python env set ~/Downloads/Python-2.5.2 sample_data.py -a ~/workspace/GAE/google_appengine/appcfg.py upload Is this possible? If yes, please point the way. If not, please suggest a way to call python2.5.2 WITHOUT having to uninstall python 2.7 many many thanks Dennis

    Read the article

  • script calling script as other user

    - by viktor tron
    Using CentOs, I want to run a script as user 'training' as a system service. I use daemontools to monitor the process, which needs a launcher script that is run as root: : #!/bin/bash exec >> /var/log/training_service.log 2>&1 setuidgid training training_command This last line is not good enough since for training_command, we need environment for training user to be set. : su - training -c 'training_command' gives 'standard in must be tty' as su making sure tty is present to potentially accept password. I know I could make this disappear by modifying /etc/sudoers a la Bash & 'su' script giving an error "standard in must be a tty" but i am reluctant and unsure of consequences. : runuser - training -c 'training_command' gives runuser: cannot set groups: Connection refused. I found no sense or resolution to this message. I am stuck. Is this something so hard to achieve? I appreciate all insight and guidance to best practice.

    Read the article

  • calling perl script from mysql trigger

    - by Bahareh
    I want to call a perl script inside a mysql after insert trigger. but my trigger does not work.I find this solution from google. here is my code: DROP TRIGGER IF EXISTS 'tr1'// CREATE TRIGGER 'tr1' AFTER INSERT ON 'username' FOR EACH ROW begin SET @result=sys_exec(CONCAT('/usr/bin/perl /etc/p1.pl')); end // and my p1.pl code: #!/usr/bin/perl open(MYFILE,'>>/etc/data.txt'); print MYFILE "BOB\n"; close MYFILE; thanks.

    Read the article

  • Google Chrome calling nypost.com every ~5 seconds

    - by TonyM
    I'm using Chrome 21.0.1180.49 beta on Mac OS X 10.7.4. Did some Googling and can't figure this out. I visited a page on nypost.com earlier this morning. Just noticed that Little Snitch is reporting that nypost.com is being called every 4-6 seconds or so. I closed the tab after reading the story, a few hours ago. I created a rule in Little Snitch denying access to nypost.com, but Chrome is apparently still connecting to it. (1) Why? and (2) How can I put an end to this? Thanks in advance for any thoughts.

    Read the article

  • Calling the LWRP from the Exception Handler

    - by Sarah Haskins
    Is it possible to call out to a Provider (LWRP) from a Chef Exception Handler? I think my Provider is out of scope, but I don't know if what I am trying to do is possible? or advisable? Here is my provider code (cookbooks/config/provider/signal.rb): action :failure do Chef::Log.info("Yeah success") end Here is my exception handler code (exception_handler/handlers/exceptionHandler.rb): require 'chef/handler' config_signal "signal" do action :nothing end class Chef class Handler class LogCollector < Chef::Handler notifies :failure, resources(:config_signal => signal) end end end Also, if anyone has a good recommendation for general reading about scope in the context of Chef I'd appreciate it.

    Read the article

  • Memeory Leak in Windows Page file when calling a shell command

    - by Arno
    I have an issue on our Windows 2003 x64 Build Server when invoking shell commands from a script. Each call causes a "memory leak" in the page file so it grows quite rapidly until it reaches the maximum and the machine stops working. I can reproduce the problem very nicely by running a perl script like for ($count=1; $count<5000; $count++) { system "echo huhu"; } It is independent of he scripting language as the same happens with lua: for i=1,5000 do os.execute("echo huhu") end I found somebody describing the same issue with php at http://www.issociate.de/board/post/454835/Memory_leak_occurs_when_exec%28%29_function_is_used_on_Windows_platform.html His solution: Firewall/Virus Scanner does not apply, neither are running on the machine. We can also reproduce the issue on other Developer Machines running XP 64, but not on XP 32 Bit. The guilty guy for the allocation is C:\WINDOWS\System32\svchost.exe -k netsvcs which runs all the basic Windows services. Does anybody know the issue and how to resolve it ?

    Read the article

  • Setup automated calling during an ETL failure

    - by Ryan M
    Just started working on a large data warehouse project that runs some large ETLs every night. In the event of an error I receive an email, but I was hoping to somehow create something that will automatically call me, so I don't have to wake up and check my email at 4 every morning to make sure the ETLs finished properly. I know I can setup an SMS pretty easily, but I don't think that will be enough to wake me up :) Anyone have any experience trying to do this before?

    Read the article

  • Is there an established convention for separating Windows file names in a string?

    - by Heinzi
    I have a function which needs to output a string containing a list of file paths. I can choose the separation character but I cannot change the data type (e.g. I cannot return a List<string> or something like that). Wanting to use some well-established convention, my first intuition was to use the semicolon, similar to what Windows's PATH and Java's CLASSPATH (on Windows) environment variables do: C:\somedir\somefile.txt;C:\someotherdir\someotherfile.txt However, I was surprised to notice that ; is a valid character in an NTFS file name. So, is the established best practice to just ignore this fact (i.e. "no sane person should use ; in a file name and if they do, it's their own fault") or is there some other established character for separating Windows paths or files? (The pipe (|) might be a good choice, but I have not seen it used anywhere yet for this purpose.)

    Read the article

  • What is the convention for the star location in reference variables?

    - by Brett Ryan
    Have been learning Objective-C and different books and examples use differing conventions for the location of the star (*) when naming reference variables. MyType* x; MyType *y; MyType*z; // this also works Personally I prefer the first option as it illustrates that x is a "pointer type of MyType". I see the first two used interchangeably, and sometimes in the same code I've seen differing uses of both. I want to know what is the most common convention It's been a very long time since I've programmed in C (15 years) so I can't remember if all variants are legal for C also or if this is Objective-C specific. I'd prefer answers which state why one is better than the other, as how I explained how I read it above.

    Read the article

  • Capture SOAP Envelope (C# WinForm calling .ASMX external vendor service)

    - by NealWalters
    I'm calling a third-party vendor's external SSL web service from a .NET 3.5 client (WinForm). The vendor has asked me to send them the Soap Header to verify why things aren't working. I used WireShark to capture packets, but since the web service is SSL, the packets are encrypted. Is there a few magic lines of code to add to my C# client to save or display the Soap Envelope either right before I call their web/method or right after?

    Read the article

  • How to find strong name signature without calling LoadAssembly

    - by Todd Kobus
    When reading a Windows PE file directly, I can't seem to find the strong name signature of a delay signed assembly. I can get to the CLR Header and read all those entries. Is the information in the MetaData directory specified within the CLR header? If so does anyone have an example of how to read this table? I am not interested in calling SN.exe or loading the assembly.

    Read the article

  • Finding all Stored procedures calling a function

    - by Abhishek Jain
    Hi, How can I find out all the stored procedures that are calling a particular user defined function in SQL Server 2005. Or how to assign a defult value to a parameter in a user defined function so that when a stored procedure calls that function and does not pass any value to that parameter function assumes the default value. Regards, Abhishek jain

    Read the article

  • calling Stanford POS Tagger maxentTagger from java program

    - by Akansha
    Hi. I am new to Stanford POS tagger. I need to call the Tagger from my jva program and direct the output to a text file. I have extracted the source files from Stanford-postagger and tried calling the maxentTagger, but all I find is errors and warnings. Can somebody tell me from the scratch about how to call maxentTagger in my program, setting the classpath if required and other such steps. Please help me out.

    Read the article

  • Calling via adb in Power shell

    - by Imran Nasir
    As you may know, the command for calling via adb is: .\adb.exe shell am start -a android.intent.action.CALL tel:"656565" This works well but when I use textbox, it takes garbage value... .\adb.exe shell am start -a android.intent.action.CALL tel:$textbox1.Text I have tried this also but failed $button21_Click={ #TODO: Place custom script here $textbox1.Clear .\adb.exe shell am start -a android.intent.action.CALL tel:$textbox1.Text } Please help

    Read the article

  • Calling COM Library From XBAP

    - by Benny
    I am trying to call an old COM library from my XBAP and continue to receive the following exception: System.AccessViolationException was unhandled Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I have tried adding the HKLM value for RunUnrestricted to no avail. I don't get anything else but this error when calling the library. Any ideas? (This library even works from a pure ASP.NET app)

    Read the article

  • calling Greasemonkey functions from web page

    - by well son
    Hi Can I call function() of my custom Greasemonkey from my page? For example, I created a GM script that contains do_this() function. I want my-web-site.com call the do_this() function. But I can't. I know, I can by doing unsafeWindow.do_this() but doing so prevents me from calling GM_xmlhttpRequest(). Any ideas?

    Read the article

  • calling actionScript 2 function from C# help!

    - by phancuong87
    I want calling actionScript 2.0 function from c# , I using ExternalInterface.addCallback; In flash: ExternalInterface.addCallback("test", function (text : String) : Void { //code }); in C#: I using shockwave flash object player.CallFunction("" + "myString" + ""); but error: Error HRESULT E_FAIL has been returned from a call to a COM component. in C# I using cs4 and VS2008, please help me!

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >