Launch App with Native Process
Hi,
I want to launch serproxy application (http://www.lspace.nildram.co.uk/freeware.html) using native process in adobe air. But it seems not working.
Here is my code:
protected function launchSerproxy():void{
if(NativeProcess.isSupported){
var serproxy:File = File.applicationDirectory;
serproxy = serproxy.resolvePath("serproxy/serproxy.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = serproxy;
var process:NativeProcess = new NativeProcess();
process.start(nativeProcessStartupInfo);
// connect to the com port
setTimeout(connect,1500,"127.0.0.1",5339);
Flex did not return any error or problem on runtime. What should I do to have Adobe Air load and run serproxy? Thanks.
I think you just missing the working directory.
"nativeProcessStartupInfo.workingDirectory = File.applicationDirectory;"
Similar Messages
-
Conversion Error: I/O error while communicating with native process
Hi,
I am trying to use Oracle Outside In Technology Image Export for conversion of images. I am trying to run the example ExportTest that comes with the downloaded SDK.
I get the below error while running the ExportTest example.
Conversion Error: I/O error while communicating with native process .
Am I missing any settings?
Please guide to the right forum if this is not the one for posting queries on Oracle Outside In Technology Image Export.
Thank you.Hi Revanth,
I am using Image Export 8.3.7 and I am trying to run the java class "ExportTest" that is in the location sdk\samplecode\ExJava\Examples\ExportTest\src of the download.
My input folder has one jpg - puzzle.jpg (this is just a simple jpg), I am trying to convert it to TIFF. ExportTest.java uses the classes in Export.jar . Export.jar is located in the sdk\samplecode\ExJava\Examples\ExportTest . You can see source files of the Export.jar at location sdk\samplecode\ExJava\Java API\src of the download. I am running the 'ExportTest' by providing the arguments (input folder, output folder and ix.cfg - this file comes with the download). So now when I run this class I was getting the error I mentioned in this post. Inorder to find more details about the error I modified the 'Export.java' (at sdk\samplecode\ExJava\Java API\src\com\outsideinsdk) just to printStackTrace when the exception occurs and rebuilt the 'Export.jar' and ran the 'ExportTest.java'.
And below is the stack trace that I got :
java.io.IOException: CreateProcess: nullexporter.exe "inputpath_u=AGkAbgBwAHUAdA
BcAHAAdQB6AHoAbABlAC4ASgBQAEc=" "outputpath_u=AG8AdQBwAHUAdABcAHAAdQB6AHoAbABlAC
4ASgBQAEcALgBUAEkARgBG" "outputid=FI_TIFF" "fallbackformat=FI_TEXT" "tiffcolorsp
ace=24BitRGB" "preferoitrendering=false" "tiffcompression=Packbits" "mapbuffersi
ze=8192" "defaultprintfontheight=20" "graphicwidthlimit=0" "reordermethod=off" "
unmappablechar=0x002A" "timezone=0" "graphicheightlimit=0" "defaultmarginleft=14
40" "ssshowheadings=false" "quickthumbnail=false" "graphicoutputdpi=0" "ssdirect
ion=AcrossandDown" "defaultmarginbottom=1440" "ssshowgridlines=false" "dbshowhea
dings=false" "readbuffersize=2" "whattoexport=all" "graphicsizelimit=0" "imagewa
termarkopacity=0" "blue=-1" "handlenewfileinfo=no" "outputid=FI_TIFF" "lzwcompre
ssion=enabled" "usedocpagesettings=true" "defaultmarginright=1440" "numberofstat
callbacks=0" "dbfittopage=NoScaling" "tempbuffersize=2048" "pdffilterreorderbidi
=no" "imagecropping=nocropping" "defaultmargintop=1440" "documentmemorymode=larg
e" "m?
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)
at com.outsideinsdk.Export.convert(Export.java:262)
at com.outsideinsdk.ExportTest.convert(ExportTest.java:142)
at com.outsideinsdk.ExportTest.main(ExportTest.java:214)
hope this helps to find the problem.
Thank you -
Publishing air apps with native extension with Flash CS6 on Windows
Hi all,
is there any trick to publish air apps with Flash CS6 on Windows?
I tried all native extensions from devnet, but nothing work to me.
I read on Mac is possibility to specify the iOS SDK folder in publish
settings, but on Windows it´s missing.
Is there anybody who has some experiences with publishing apps
with native extensions for iOS and Android with windows Flash CS6?
Thanks for all advices.I sympathize. I recently found a native alert for iOS and Android that's working with Flash CS6 on Windows with AIR 3.2.0.2070 but not AIR 3.2.0.2060. You can get the ANE here:
http://www.jampot.ie/ane/
Haven't tried the other ones. Let us know if you decide to try them.
The sample code they have on the page doesn't work with the native alert. Here's the code I created - it's a document class for a .fla that has one dynamic TextField and one Button component on the stage :
http://pastebin.com/DsxR9nJ4 -
With Apple discontinuing support jre 7 on its mountain lion, i am trying to find a way to launch my mac apps with oracle jre7. There are two situations occuring to me.
1. Oracle jre7 could be before hand installed and my app should be able to detect and launch
2 Or Bundle the oracle jre 7 with my Mac app and get into lauching it on mountain lion without any issues.
Is there a better way or apple providing support in this regards.
Help appreciated.Thanks NickClark_uk,
I am able to install the java 7, but the Mac app i am trying to launch is unable to detect the oracle jre 7 and works fine with app store jre's. So we may need to bundle the jre or modify our apps to detect the installed JRE.
I was looking at what would be the better approach in order to have my Mac app run with oracle jre 7.
Thanks -
Error "cannot locate object' launching app with Web Start
Hello,
I receive the error shown below when launching a Java application and cannot figure out where to begin with debugging. It was developed under Netbeans 5.0.
You can recreate the error by launching this application:
http://www.mikenaglich.net/ztest17.jnlp
Error text and JNLP file follow. I am really puzzled and would appreciate any help. Thanks.
Mike
Error Text
========
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
The system cannot locate the object specified. Error processing resource 'http://www.netbeans.org/jnlp/DTD/jnlp.dtd'.
App JNLP File
===========
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN" "http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
<jnlp codebase="http://www.mikenaglich.net" href="ztest17.jnlp">
<information>
<title>ztest17</title>
<vendor>Mike Naglich</vendor>
<homepage href="www.mikenaglich.net"/>
<description> </description>
<icon href="default"/>
<offline-allowed/>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
</resources>
<resources>
<jar download="eager" href="dist/ztest17.jar" main="false"/>
</resources>
<resources locale="" os="">
<jar download="eager" href="dist/lib/swing-layout-1.0.1.jar" main="false" version=""/>
</resources>
<application-desc main-class="ztest17.Main"/>
</jnlp>I receive the error shown below when launching a Java
application and cannot figure out where to begin with
debugging. There are a number of problems, potential problems,
redundancies and illogicalities in that JNLP file.
...It was developed under Netbeans 5.0. Uh-Huh. I am coming to recognise those
(damnable) NetBeans JNLP files.
You can recreate the error I don't think I need to, your error output and JNLP
file are quite instructive..
...by launching this
application:
http://www.mikenaglich.net/ztest17.jnlp
Error text and JNLP file follow. I am really puzzled
and would appreciate any help. Thanks.
Error Text
========
The XML page cannot be displayed
Cannot view XML input using style sheet. Please
correct the error and then click the Refresh button,
or try again later.
The system cannot locate the object specified. Error
processing resource
'http://www.netbeans.org/jnlp/DTD/jnlp.dtd'.
1) Whenever you see a message from Java,
JavaWS, or an application saying words the the
effect of 'cannot find..', try checking the URL of the
resource in a browser. If a browser comes
up '404' (not found), then the Java tool or app.
will be unable to access it either.
That is the first and fundamental problem with that
JNLP. The DOCTYPE element is not strictly needed
in a JNLP, and I would recommend removing it entirely
rather than try and hunt down any NetBeans DTD.
With the way NB writes JNLP's, I would not trust
a DTD written or controlled by them, in any case.
App JNLP File
===========OK.. I recommend replacing the current JNLP
with the one below, here is a summary of the
changes I made..
- removed DOCTYPE line with reference to '404' DTD
- compacted resource elements, removing empty attributes
- changed ztest17.jar to main='true'
- removed redundant 'download="eager"' attributes as well
as main="false" and version="" from swing-layout.. jar element
- removed broken(?) <icon> element and empty <description>
- changed homepage href to relative
Some of them are guesses, but I'd give it a 90%+
chance of working, if written like this.
<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="http://www.mikenaglich.net" href="ztest17.jnlp">
<information>
<title>ztest17</title>
<vendor>Mike Naglich</vendor>
<homepage href="/"/>
<offline-allowed/>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<resources>
<j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
<jar href="dist/ztest17.jar" main='true' />
<jar href="dist/lib/swing-layout-1.0.1.jar" />
</resources>
<application-desc main-class="ztest17.Main"/>
</jnlp> Note that a glance inside the ztest17.jar supports
it contains a manifest file tat specifies the main class,
so it might be possible to remove main='true'
altogether - best not for the moment, though. -
Single instance app with native packaging
Is there any way to allow only one instance of the app to run with javafx2 native packaging? Like an attribute in the build.xml or something?
I'm using the .exe for windows and the .dmg for mac.
Appreciate your help.There is no simple deployment build switch that I know of for achieving a single instance app.
A couple of ideas (none of which I have tried).
Perhaps you could use the SingleInstanceService:
http://www.oracle.com/technetwork/articles/java/fxbest-1583679.html "Ensuring Only One Instance of the Application Is Started"
http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/examples.html#SingleInstanceService "SingleInstanceService"
It is a jnlp api based service though and I'm not sure if such a service would be available to a packaged app (maybe it would require including the jre/lib/javaws.jar file with your app or something like that).
You could write out a lock file when the app starts.
On unix (i.e. mac/linux) the lock could include the process pid for your app. On startup, check if there is a process with the lock pid currently running, if so, don't startup and perhaps send an interrupt signal to the existing app notifying it that the user tried to start a new instance.
On windows you could read and write the lock value value from the registry.
To get rid of the OS specific stuff surrounding this, perhaps this kind of lock logic could be implemented using the Java Preferences API:
http://docs.oracle.com/javase/7/docs/technotes/guides/preferences/index.html
Intellij Idea is open source and and seems to have this kind of functionality, so you could check how they do it. -
I'm trying to write a simple BASH script that will laungh an program, but that program needs command line arguments.
When I put it in quotes it says it can't find the file, if I don't use quotes then it won't run the program with the command line arguments. How can I launch a program using a BASH script with command line arguments?
Thanks in advance#!/bin/bash
/Users/name/Desktop/Directory/app -f configfile -
BASH - Launch App with arguments
I'm trying to write a simple BASH script that will laungh an program, but that program needs command line arguments.
When I put it in quotes it says it can't find the file, if I don't use quotes then it won't run the program with the command line arguments. How can I launch a program using a BASH script with command line arguments?
Thanks in advanceWrong forum. Try https://discussions.apple.com/community/mac_os/mac_os_x_technologies#/?tagSet=10 48
-
I have read a lot of docs, but havent found even one simple tutorial witch creation of simple process with some participants and some logic...
All i want is to have some start point - for example simple SOA application example where is implemented just very simple process witch 2-3 participants and with very basic logic, for example:
PROCESS START
- participantA has a task in his worklist, he do something and then task goes to worklist of participantB
- participantB , he has choice: a) accept task, do something ->PROCESS ENDS b) or denies task and then task goes back to participantA (and everything starts again)
Thats all...
Thx a lotI appreciate your offer, thx :)
i did your tutorial about human task few days ago, and thats all. Your tutorial was written in very very good way (simple and very clearly explained, so I knew what i did). So now Im looking for articles writen in exactly same style - simple "for dummies" tutorial about some basic interaction between roles/participants - thats alll I want. i wrote some example in my first post...
Today i started to do some examples from links above from Anuj, they are quite good written, but also quite complex...So if u have something better, u're welcome ;)
Edited by: user1175491 on Aug 3, 2010 1:42 PM -
Launching apps with Applescript
I'm like a drunk driver wheb it comes to Applescript.
I use Final Cut Pro to edit video and have a time tracker program to keep track of the time I spend editing. Is there an Applescript that will launch the time program when I launch Final Cut Pro?
thanks for the help.I am a bit crippled at the moment when writing scripts as my mac is currently in for repairs, so am using my parents windows pc.
I believe there are a number of ways of attacking this problem. Either have a small program always open checking for final cut launch or have a small application that launches both your time tracking program and final cut.
i prefer the second method as it free up systems resources (not much but i always prefer having as little open as possible in regards to background processes). SO i would use something like this:
tell application "Time Tracker"
activate
tell application "Final Cut Pro"
activate
end
end.
I would save it as an application named so it where final cut pro is, and then always use this applciation to launch final cut pro.
However if you launch final cut another way, for example open up a document file that launches final cut pro then this method will not work and the first method described would be a better way of achieveing this. However i am at best a confident novice in regards to applescript and being hindered by not having my mac to try it out on, i can only give pointers.
I believe this will check every 5 seconds for an instance of final cut pro. You can make the time intveral shorter or longer if you wish. I think the option you want to save it as is called "always open" and then in system preferences - accounts - login items select the script.
if process "Final Cut Pro" exsists then
activate application "Time Tracker"
delay 5
end
As i said before this may not work correctly and can only check when my iMac comes back from being repaired (new screen, logic board and psu, so basically replaced but inside the same case). I am sure someone else will step in and offer help in the mean time if i have got something wrong. -
Communicating with native processes in AIR
This question was posted in response to the following article: http://help.adobe.com/en_US/as3/dev/WSb2ba3b1aad8a27b060d22f991220f00ad8a-8000.html
var stdOut:ByteArray = process.standardOutput;
IDataInput not assignable to ByteArray -
Native Process Not Supported in Flash Builder 4.1
Hi,
I am using Flash Builder 4.1 and I am trying with native processing with the example from http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.h tml. When I tried to run the project in Flash Builder, it shows "NativeProcess not supported.". However, after I export release build, the application is working properly.
How can I have the native process to be able to run in Flash builder? So that it will be easier for me to test and troubleshoot the application. Thanks.You need to add the following line in your ***-app.xml file for debugging mode
<supportedProfiles>extendedDesktop</supportedProfiles>
and
<supportedProfiles>extendedDesktop desktop</supportedProfiles>
for release build -
Native Process calling TabTip.exe not working on Windows 8
Hey,
I'm desperately trying to get the nice Touch Keyboard to display on Windows 8 for my AIR App.
Looking at this article http://sukantadas.wordpress.com/2012/10/16/executing-exe-file-from-desktop-through-adobe-a ir/ it seems possible, and it works nicely on my windows 7 machine, beit that TabTip.exe is a slightly different keyboard on Win7.
Over to windows 8, I can't get it to work for love nor money. ('m testing on this http://www.samsung.com/us/business/computing/tablet-pcs/XE700T1C-A03US).
It works fine if I wrapp the SWF with MDM.ZINC - Mdm.System.exec("C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe"); but then I'm out of the AIR SDK and stuck with MDM Zinc; which doesn't even recognise MouseDown events on Windows 8 (touching the screen).. but that's another story - http://www.mdmforum.com/forum/index.php?showtopic=29963
Please can someone help me as I've been pulling my hair out..I lost my password to respond.
Thanks for helping me out. I found out how to do it in ASP.net though. I use the app for native process because I was having some huge issues with AIR.
Thanks again
My code below. I took into account Windows 8
Imports System.Threading
Imports System.Runtime.InteropServices
Module Module1
Sub Main(ByVal sArgs As String())
If sArgs.Length = 0 Then
Console.WriteLine("<-no arguments passed->")
Else
Dim i As Integer = 0
If i < sArgs.Length Then
If sArgs(i) = "1" Then
If My.Computer.FileSystem.FileExists("C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe") Then
Process.Start("C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe")
Else
Process.Start("c:/windows/system32/osk.exe")
End If
ElseIf sArgs(i) = "0" Then
Dim TouchhWnd As New IntPtr(0)
Dim hWnd As New IntPtr(0)
TouchhWnd = FindWindow("IPTip_Main_Window", Nothing)
PostMessage(TouchhWnd, WM_SYSCOMMAND, SC_CLOSE, 0)
End If
End If
End If
End Sub
Dim WM_SYSCOMMAND As Int32 = 274
Dim SC_CLOSE As UInt32 = 61536
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
End Module -
I upgraded my new iPad (iPad 3) to IOS 6 and everything went well except Siri won’t launch apps. When asked say “launch Facebook” Siri responds with “it doesn’t look like you have an app named Facebook” and I get the same results when trying to launch any app. Siri works for everything else it just won’t launch apps. Any ideas? Thanks.
I have this same problem... Seems like nobody else does. Siri won't launch any apps for me, including native apps.
-
Reading native process standard output stream with ProcessBuilder
Hi,
I'd like to launch an native process (windows application) which writes on standard output during its running.
I'd like to view my application output on a JTextArea on my Java frame (Swing). But I do get all process output
on text area only when the process is finished (it takes about 20 seconds to complete). My external process is
launched by using a ProcessBuilder object.
Here is my code snippet with overridden doInBackground() and process() methods of ProcessBuilder class:
@Override
public String doInBackground() {
jbUpgrade.setEnabled(false);
ProcessBuilder pb = new ProcessBuilder();
paramFileName = jtfParameter.getText();
command = "upgrade";
try {
if (!(paramFileName.equals(""))) {
pb.command(command, jtfRBF.getText(), jtfBaseAddress.getText(), "-param", paramFileName);
} else {
pb.command(command, jtfRBF.getText(), jtfBaseAddress.getText());
pb.directory(new File("."));
pb.redirectErrorStream(false);
p = pb.start();
try {
InputStream is = p.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
jtaOutput.setText("");
while ((line = br.readLine()) != null) {
publish(line);
} catch (IOException ex) {
Logger.getLogger(CVUpgradeFrame.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(CVUpgradeFrame.class.getName()).log(Level.SEVERE, null, ex);
jtaOutput.setText("");
jtaOutput.setLineWrap(true);
jtaOutput.append("Cannot execute requested commmad:\n" + pb.command());
jtaOutput.append("\n");
jtaOutput.setLineWrap(false);
return "done";
@Override
protected void process(List<String> line) {
jtaOutput.setLineWrap(true);
Iterator<String> it = line.iterator();
while (it.hasNext()) {
jtaOutput.append(it.next() + newline);
jtaOutput.repaint();
//Make sure the new text is visible, even if there
//was a selection in the text area.
jtaOutput.setCaretPosition(jtaOutput.getDocument().getLength());
How can I get my process output stream updated while it is running and not only when finished?
Thanks,
jluke1) Read the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and implement the recommendations. Although it is concerned with Runtime.exec() the recommendations still apply to Process generated by ProcessBuilder.
2) Read about concurrency in Swing - http://java.sun.com/docs/books/tutorial/uiswing/concurrency/ .
3) Use SwingUtilities.invokeLater() to update your GUI.
Maybe you are looking for
-
A question about error with jasperserver for pdf and Apex
I have created a pdf report on jasperserver and I can call it from apex via a url and it displays fine. The url is this format {http://server:port/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Apex/deptemp&output=pdf&deptNo=#DEPTN
-
Procedure with out parameter in if-then-else condition
Hi, I want to fetch the out parameter of a procedure inside another procedure that has if-then-else condition. <<Proc1_start>> if .. then <<proc2_>> --- with out parameter end if; <<proc1_end>> How to do this... Thanks.
-
Hi all, Please tell me steps to create the new BSP application page as we have SAP4.7. Regards,
-
I have signed up for eprint and have a printer code, but it is being rejected.
I want to be able to send photos from my cell phone to my printer to print...I have signed in and have a printer code, but it is being rejected. What do I do next? What is my printer email address?
-
I am trying to transfer movies I've purchased through iTunes from my Macbook Pro to my iPad. iTunes keeps telling me I need to authorize my computer to download the movies onto my iPad. I have "authorized" it several times, but each time I sync it, i