javafx jscript runtime error - java

When running the sample java fx applications or making my own fx application in netbeans I get a message before the software runs that is titled Microsoft JScript runtime error. The message says Automation server can't create object. After I press okay I can get to my application. I have set up my java proxy and netbeans proxy and don't understand why this stop pops up. This happens when running throught command line (java -jar syntax) or through netbeans, the only way to avoid it is by running the application as through the java webstart. I am behind a firewall, is this related to my message or am I chasing down the wrong path?

Related

Executing a Java program remotely from Java

Using Java on a client machine I wish to execute a different Java program on a server.
I have a Windows 7 laptop that I'm using as a client machine, and I wish to run a simple java program on a MacBook Pro (this will be the server) from the client. The program on the server will be stored there, so there won't be any need for uploading the code from the client.
I am already running some Java Selenium tests remotely using Seleniums remote web driver, however Selenium cannot do everything I want which is why I need to execute a simple java program that will use the robot class to trigger a few keyboard events.
Is this possible?
(Essentially I want to run a java program on a client machine that executes some keyboard events on a server machine.)
Usual way to upload a file using Selenium is the following:
driver.findElement(By.id(<uploadId>)).sendKeys(<pathToTheFile>);
I hope it should be enough and you don't want to test browser specific popup dialog.

Java Web Start doesn't launch my .jar without enabling the "show console"

As stated in the title, my software won't launch unless the "Show console" option is selected in Java settings. I'm not sure what kind of code you'd like me to post, so please ask.
When I try to run it, the Java dialog pops up and the progress bar that loads the software completes before it closes. When the console is up, the software finally loads and displays afterwards. Without the console, nothing happens.
I've tried to run the web start on different computers, and they all had the same problem. The console doesn't print out any error messages, so I don't have anything to use for debugging the problem.
Some information about the software:
It's a JavaFX project, compiled using Oracle jdk 1.7.0_65 on OS X with Netbeans. It requires full security permission, and all jars (I use a bunch of libraries) are being signed using a key store from a trusted vendor.
EDIT
I tried to launch my program through console using the following command: javaws -viewer http://www.website.com/software.jnlp, and - without launching my software - it returned the following result to the terminal:
java.lang.NullPointerException
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1003)
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:998)
at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:993)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1749)
at java.awt.EventQueue.invokeLater(EventQueue.java:1245)
at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1290)
at com.oracle.deploy.update.UpdateCheck.updateStateChange(Unknown Source)
Could this be of any help?
For others who might have this problem, this is what caused it for me:
I had a thread running in the background that would show the stage once it was done loading all the assets. This stopped the whole thing from executing, so I had to change the loading logic inside of my code instead to allow for the primary stage to use the show-method in the UI-thread.

Cannot run two instances of java webstart

I am unable to run more than one instance of java webstart at any given time.
For example, I am unable to run both the production & QA instance of an application at once, both of which are launched via java webstart. Additionally, I am unable to run the java webstart cache viewer at the same time as either the production or QA instance of my application.
I am however able to run any of the above three webstart launches when they are run in isolation of each other. When I try to bring up a second option, I see the 'Java Loading...' screen which then disappears and nothing happens.
Additionally, I have tried to delete the webstart cache (via the java webstart cache viewer) and I receive the following error regardless of which JRE I point to:
"Bad installation. Error invoking Java VM (execv)
'path to my javaw.exe'"
I expect both the problems I mention above are interlinked. I do not believe I have changed any configuration recently and I have been happily running java webstart for years.
Has anyone seen such a problem before?
Thanks,
Jack
EDIT: When the second instance of webstart attempts to run, during the display of the 'Java Loading...' screen I can see in the task manager that a new javaw.exe process is spawned. This process almost immediately dies though. I'm not sure how to inspect the failure in that process, but I expect it is similar to the failure when trying to clear my cache through the webstart cache viewer.
You may be able to use javaws from the command line to run a second instance in -offline mode. The verbose option is handy, too.
javaws -offline -verbose MyApplication.jnlp
I think it is because both instances of the application use the same folder as current working directory. I do not remember exactly but it is somewhere under user home and the folder contains the application name or something...
So, if this is correct the solution is to change the application name like "My Application - QA" vs. "My Application" used on production.
The name is somewhere in jnlp.xml.
The reason may be the startup parameters for client java/javaw, which do not allow to run more than one instance of Java. For example because of set debug port. These parameters can be set in the command line or in the Java Control Panel -> Java -> button View.

How can I use a GUI debugger on the Prolog code that runs inside a Java app through JPL?

I'm developing a Java+Prolog application through the JPL bridge. The main application is in Java and it calls the Prolog code using Query.oneSolution("doPrologStuff(here)")
I tried running the GUI debugger/tracer using Query.hasSolution("gtrace") but it throws an exception:
Exception in thread "main" jpl.PrologException: PrologException: error(existence_error(procedure, /(gtrace, 0)), context(:(system, /('$c_call_prolog', 0)), _0))
at jpl.Query.get1(Query.java:336)
...
(Same goes for "guitracer")
Calling gtrace. works well when I run the Prolog code in swipl directly.
When I try Query.hasSolution("trace") it lets me debug the code using the text console, but that's not what I'm looking for. Any ideas how to enable the GUI debugger?
I'm using Eclipse on Ubuntu to develop, but I can try other tools if that helps :)
You need to attach Prolog's graphical environment (xpce). You can do that by loading
the file swi('swipl.rc'). The next question is whether or not event dispatching happens.
That depends on the setup. If you use the latest 5.11.18/5.10.4 versions, you can set the
Prolog flag xpce_threaded to true, which causes SWI-Prolog to run the development tools
in their own thread (currently only works on Unix/Linux systems).

Netbeans webservice client works only when running from IDE

Using Netbeans 6.8 and metro 2.0 I have written a simple application that makes calls to a webservice and displays the results in java swing components. When I run the application in the Netbeans IDE (using F6), the application works perfectly.
However, when I attempt to run the compiled application from the .jar file in the dist folder, my swing UI comes up, but when I press the button that causes my web service to be called, nothing happens.
Anyone know how I can get this to work?
Try running in a terminal window (CMD.EXE) to see if there are any exceptions printed to the console.
Does your action listener work when stand alone? Confirm by printing a message to System.out.

Categories

Resources