Running javafx from java without jfx sdk installed

I need to run jfx application on client's computer(without jfx sdk installation and outside the browser) from a java code.
I also need to path parameters from java to javafx and to get return value.
What i did:
1) put a.html, a_browser.jnlp and a.jar files on the server.
2 )run javafx application from java by swt.browser.setUrl(server address/a.html)
To pass parameter:
I know single option to pass parameter - create a1.html, a2.html ... an.html for each possible parameter value and javafx will read this parameter by FX.getArgument("parameter"). This solution is ok in my case. But i don't know how to return value back to java.
thank you

Problem solved. I used
Context context = FXLocal.getContext();
FXClassType instance = context.findClass("loginscrean.PlayerAdapter");
ObjectValue obj = (ObjectValue)instance.newInstance();
PlayersObserver po = (PlayersObserver)obj.asObject();
po.RestartPlayersList();
in java method which was trying to connect and in RestartPlayersList(); I used FX.deferAction(function() {  method content  });
I dont't know whether it is a right way of doing it but seems to be working.
P.S. The reason why application hanged was being careless with synchronization which as a result caused a dead lock.

Similar Messages

  • Call javafx from java

    hi!I know how can I call java class from javafx, but now I need call to javafx from java. How can I do that?
    thanks

    You can use java reflection API to access fx objects as you can see here:
    (Supressing try/catch statements)
    Java Class
              Class c = NewClass.class.getClassLoader().loadClass("javafxapplication2.Main");
                Object main = c.newInstance();
                 Class[] types = new Class[]{};
                 Method met = main.getClass().getMethod("getTeste", types);
                 System.out.println(met.invoke(main, new Object[0]));JavaFX Class
    package javafxapplication2;
    public class Main{
    function getTeste(){
        return "teste";
    }Edited by: Erich_Oliveira on Jan 27, 2010 12:39 PM

  • How to connect from java without using oracle client installation

    hi ,
    Please tell me how to connect from java without using oracle client
    Thanks & Regars

    http://www.orafaq.com/wiki/JDBC#Thin_driver

  • Problem in connecting external URLs from Java ME Platform SDK 3.0

    Hello all,
    I am building a mobile application using Java ME Platform SDK 3.0. My application needs to connect to external web services. I have finished development of first module and it is running perfectly from actual mobile device. But the problem is:
    While developing the application I am used to test it with given mobile Emulators in Java ME Platform SDK 3.0. During this test I am not able to connect to external web service if I am testing if within local intranet using proxy server. To solve this I have configured Proxy Setting in the IDE at:
    Tools Menu -> Options -> General -> Manual Proxy Settings and given HTTP Proxy Server and it's Port. The same proxy settings are there in all web browsers in my machine.
    But It is giving error like:
    Unknown error 10054 during socket::read
    Strange thing is that the same application is running perfectly If my PC is not in Intranet and connected to internet directly.
    Please help me that how can I set proxy settings in Java ME Platform SDK 3.0 to get in working?
    Any suggestions regarding this will be helpful for me.
    Thanks to spare some time and read my post,
    Tejas.

    Hi Tejas,
    it should work. I tested it right now and my proxy was used without any problems. The way how you set proxy settings is correct.
    Could you try following to verify that it is a proxy problem or not, please?
    1. run demo application "Demos" (from Start Page or File->Open Sample Project)
    2. choose "HttpView" midlet and start it
    3. choose "cnn"
    4. if proxy is set correctly, you will see page source; otherwise you will get an error message
    If the demo runs fine, the problem is probably somewhere else in the communication.
    There is one limitation in proxy settings. Only proxy without username and password is supported. Isn't it your case?
    Regards,
    Radko

  • Running javac from java

    I have created a program which generates code that needs to be compiled while running the program. Currently I am doing it using Runtime.exec() but I don't like the dos window that appears. If there is any way to hide the dos window or compile another way, let me know? Thanks
    This is how I am currently doing it:
    String exec = "javac " + Filename;
    Runtime r = Runtime.getRuntime();
    Process p = r.exec(exec);
    try {
    int exitVal = p.waitFor();
    if (exitVal != 0){
    InputStream stderr = p.getErrorStream();
    InputStreamReader isr = new InputStreamReader (stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null)
    Sytem.out.println(line);
    catch (java.lang.InterruptedException ie){ie.printStackTrace();}

    You can do the following:
    1. Use class generation API to generate ready class. But you must care about syntax or VM will generate errors on load.
    2. Use compiler in SDK from Java. Below is my code:
          File classesDir = new File(home, "classes");
          File javaSource = new File(source.getParent(), className+".java");
                new sun.tools.javac.Main(System.err, "javac").
                  compile(
                    new String[]{
                      "-d",
                      classesDir.getPath(),
                      "-classpath",
                      classesDir.getPath(),
                      javaSource.getPath()
                  );where javaSource is file to be compiled and classesDir is a directory where compiler emits classes.
    The first way is faster, but the second is preferred because you can see intermediate sources. Oh, in second case you must have /java_home/lib.tools.jar file in your classpath. Thats all, enjoy :))

  • Close a running application from java........

    Hi all
    I have opened an application say MSWORD from my java class using Runtime.getRuntime(), Now on close button i need to close the application and on the save button of the application i even want to save the application from java command
    The question is HOW????
    please reply,
    Thanx,
    Amitt

    can I open the konsole from java??Yes.
    First you must figure out how to do that from the command line yourself. That has nothing to do with java.
    Note that that how you do that MUST account for the fact that the "command line" is actually a shell. Some commands must be run by running the shell as the actual command and then passing the desired command as an option to the shell (the actual command.)
    Again you can google for examples.

  • Running Fop from JAVA program

    Hi all,
    this may be a rookie question....hope you can help.
    I can run Fop (0.18.0) perfectly from the command line. I created a style
    sheet (xsl file), which converts the xml file. On the command line, I input
    the xsl file, the xml file, and state the name for the pdf file.
    Now I'm trying to run Fop from within method in my JAVA program. This
    doesn't seem to work. Here's the code. Can someone tell me what I'm doing
    wrong? Is it okay to run Fop this way? My classpath is set up properly
    (it runs on the command line).
    Here's the code..............Thanks in advance for any help.
    String [] pdfParams = new String[6];
    pdfParams[0] = "-xsl";
    pdfParams[1] = xslFile;
    pdfParams[2] = "-xml";
    pdfParams[3] = xmlFile;
    pdfParams[4] = "-pdf";
    pdfParams[5] = pdfFile;
    org.apache.fop.apps.Fop.main(pdfParams);
    Regards,
    Suryakant.

    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    One thing that jumps out at me is that you're calling waitFor() and then trying to read the process' stdout. But waitFor waits for the process to die, so the stream is no longer there when you try to read it.
    See this:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to run Perl from Java

    Hi,
    I have a program written in Perl. I want to run the Perl program using Java. If there is a command which can allow me to call the perl program from Java program, please advise me.
    regards

    The most easy way is to use Runtime class to call "perl" to run your perl script.
    String sCmd = "c:\\yourPerlScriptLoc\\yourPerlScript.pl";
    Process p = Runtime.getRuntime().exec(sCmd);

  • How to invoke javafx from java code

    hi all,
    i'm trying to invoke my .fx class from java class, but getting exception.
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    javax.script.ScriptException: compilation failed
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:255)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:145)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:136)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at myclockproject.Main2.main(Main2.java:34)
    I read in article http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/ about including javafxc.jar in classpath .. could some one tell me what classpath he meant, i have included it in my environment variable and also project libraries .. still getting error :(

    coolsayan.2009 wrote:
    thanx.is communication api required?but is the communication api available for windows?its available for linux and sparc??Are you referring to the COMM API that is referenced in the first link when you google - the one entitled "How to Send SMS using Java Program (full code sample included)"? If so, Here: [http://java.sun.com/products/javacomm/|http://java.sun.com/products/javacomm/]
    what to do in serverside?is any change required in web.xml or any jndi setup in serverside if i call the java class from a jsp page?I don't know, are you planning on making your class available through JNDI?

  • Run sqlldr from Java

    Hi,
    Trying to run sqlldr from a java Runtime.exec() object. Command line looks good and works if you run it by hand on a console/terminal.
    [cmd-line]
    /oracle/product/10.2/bin/sqlldr userid=usr/pwd@SID control=./app/ctl/office-dept.ctl
    [cmd-line]
    So I kick off the java process and it reaches the command and starts to run it...Then the process just hangs. It never returns...There's no progress either as I monitor the database table for records to be loaded.
    JDK 1.6.0
    Oracle 10.2
    Unix AIX 5.3
    [log-file]
    2011-08-25 12:38:30,777 [main] DEBUG the.weekly - hasTaskStatus()...Complete...Return Status [true] for [null]
    2011-08-25 12:38:30,777 [main] DEBUG the.weekly - Running command [ /oracle/product/10.2/bin/sqlldr userid=usr/pwd@SID control=./app/ctl/office-dept.ctl ]
    [log-file]
    Same Java class that is running this command line works with other command line tools, so I'm pretty sure the Java code is OK. The sqlldr logfile gets emptied, but then never gets any output. I get nothing.
    tia,
    adym

    This is solved...turns out my Java class wasn't quite as correct as I wished...
    Had to move my getErrorStream() and getInputStream() readers above the .waitFor() call...
                            // runConsoleCommand( true ); /* wait for the command to finish  */
                            // OUTPUT : Process the command output...
                            while ((lrowLine = getCommandOutput().readLine()) != null) {
                                getLog().debug( lrowLine );
                                // SCAN : test the output for a success state...
                                if ( lrowLine != null ) {
                                    if ( lrowLine.contains(getCommandSuccess()) ) {
                                        lblnDone = true;
                                        lstrResults = "1";
                            // OUTPUT : Process the error output...certain
                            // commands and command tools may route error
                            // and output into the same stream...
                            while ((lrowLine = getErrorOutput().readLine()) != null) {
                                getLog().debug( lrowLine );
                                // SCAN : test the output for a success state...
                                if ( lrowLine != null ) {
                                    if ( lrowLine.contains(getCommandSuccess()) ) {
                                        lblnDone = true;
                                        lstrResults = "1";
                            exitValue = lrunCommand.waitFor();hth,
    adym

  • Run EXE from JAVA program

    Does somebody know whether it is possible to run some program with extension EXE from JAVA program?

    Yes sombody knows. Yes it's possible. Have a look at Runtime#exec.

  • Running VBS from Java

    Hi ,
    I want ro run a VBS file from Java but i don`t how.
    please help
    Thanks
    Eli

    If you want to know whether Java can interpret and execute vb script then the answer is no.
    If you want to get the operating system to execute the vb script then the answer is yes.
    Look up the Runtime library.

  • Run program from Java

    Hi all,
    I need to run Cygwin (program which executes shell scripts on Windows) from Java,
    and run some script with Cygwin. Is it possible with Runtime.exec() run Cygwin and
    pass them some script to run?

    I also run into the same problem.
    My problem is i want to run Windows Xp's cmdshell throught java and pass it some parameters.
    I know there is a third party jar which can do it.
    So there must be some way,although maybe not too easy.

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • Java App Platform SDK install fails

    A few days ago I was able to install the Java App SDK, deploy test projects, etc.
    Then, for some unknown reason, I was not able to undeploy/remove. Out of frustration, I uninstalled the server, and tried to reinstall, but every attempt fails.
    This is the log. Any ideas?
    INFO - start JRE installation
    INFO - end JRE installation
    INFO - Start Sun Java System Message Queue configuration
    INFO - End Sun Java System Message Queue configuration
    INFO - unpacked jar file: C:\Sun\SDK\lib\admin-cli.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-cmp.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-deployment-client.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-ext.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-jstl.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-rt.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-tags.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\appserv-ws.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\com-sun-commons-launcher.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\j2ee-svc.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\javaee.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\sun-appserv-ant.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\lib\deployment\sun-as-jsr88-dm.jar.pack.gz
    INFO - Start core server configuration.
    ERROR - default domain creation returned following exception: abnormal subprocess termination: Detailed Message:'�' is not recognized as an internal or external command,
    operable program or batch file.
    '?' is not recognized as an internal or external command,
    operable program or batch file.
    INFO - End core server configuration.
    INFO - Start Java DB Configuration.
    INFO - End Java DB Configuration.
    INFO - Start samples configuration.
    INFO - End samples configuration.
    INFO - Start Java EE 5 samples configuration.
    INFO - End Java EE 5 samples configuration.
    INFO - unpacked jar file: C:\Sun\SDK\blueprints\bpcatalog\lib\bp-ui-14.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\blueprints\petstore\lib\bp-ui-14.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\blueprints\petstore\lib\bp-ui-5.jar.pack.gz
    INFO - unpacked jar file: C:\Sun\SDK\blueprints\petstore\lib\lucene-core-2.0.0.jar.pack.gz
    INFO - Start OpenESB installation.
    INFO - Addon jar getting installed: jbi-installer.jar
    INFO - Main class invoked: com.sun.jbi.installer.OpenEsbInstaller
    INFO - End OpenESB installation.
    INFO - Start Access Manager installation.
    INFO - Addon jar getting installed: am-installer.jar
    INFO - Main class invoked: com.sun.am.AMInstallerMain
    INFO - End Access Manager installation.
    INFO - Start Portlet Container installation.
    INFO - End Portlet Container installation.

    I've installed jdk-1_5_0_04-linux-i586.bin with no problems and I also run FC4.
    I forget where I downloaded that from but if you google it many people host it.

Maybe you are looking for

  • Holy Cow! Seven days to copy my iPhone library to a new external HD?

    Wow - I've just begun to move my iPhoto Library File (about 80GB - over 12,000 photos and videos) from the internal HD of my black MacBook running Lion, to a new external WesternDigital My Book with 1TB of space.   I did check the info for the new dr

  • My Macbook Pro is out of storage space, what should I do?

    I take tons of pictures and that is what's sucking up all of my memory. I currently have a 2011 Macbook Pro OS X Lion Version 10.7.4. 4 GB memory 2 GHz processor. Now that I look at the "About This Mac" it says all of my storage is "Other" with 0 KB

  • For the regulars...

    Over the past year or so I have been asked a lot of questions about recording at 24bit, levels and various sample rates. Because of this I wrote a short (just under 3800 words) document on the subject and have now posted it as a blog (due to friends

  • Missing backups/lack of space with Time Machine

    Hello, I am having trouble with Time Machine since I updated to Mavericks.  Time Machine tells me that I have insufficient space on my external hardrive (1TB) even though in Time Machine it only has one full backup.  If I Get Info on the drive it say

  • Stock Transport Order with Delivery and Billing Document/Invoice

    Dear Experts, We have implement the process in our system as required on SAP document: http://help.sap.com/saphelp_47x200/HELPDATA/EN/4d/2b911d43ad11d189410000e829fbbd/frameset.htm The problem is that when creation the PO the Shipping tab does not ex