Workaround for printing in JavaFX - printing

Ok, so I've actually completed my program in JavaFX and everything is working nicely, but I have two reports that I need to be able to print, and wouldn't you know it? JavaFX doesn't support printing!
I've been trying to work around this by way of making a JFrame that imports all the data from JavaFX, but it keeps NOT displaying the JFrame and giving me the following error:
2013-07-25 16:58:05.334 java[2150:707] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
I assume this happens because the same instance of JRE can't run FX and display a Swing JFrame at the same time? Because the same code WILL work if run on it's own (just doesn't have the data from the FX app to display in the reports).
So my question is, is there a workaround that does not entail me re-writing all my FX code to Swing? The printer being used is a generic/text only dot matrix printer, so I was trying to import the data to the JFrame because then it would be easy to print the entire frame of text. Perhaps my JFX report generator could open the JFrame in a new JRE? or is there a way to get it to work in the same JRE? I do need it to be seamlessly integrated into the existing system so the user can generate the report from the JFX GUI and have it print automatically rather than generate the report, then go to another (Swing) GUI to print it.
Help!
Ok, so I tried the suggested answer of using the beta release of Java 8, but now nothing works. I get the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/javafx/main/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Java Result: 1

Use Java 8, it supports printing for JavaFX.
Java 8 also supports embedding a SwingNode in a JavaFX app, if you wanted reuse your existing Swing based reporting code.
Thanks, but the official release of Java8 is like a year away, isn't it?
Java 8 release date is currently 2014/03/18.
Unsupported major.minor version 52.0
Looks like you compiled the app with Java 8, then tried to run it on Java 7.
See related:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
Is there no other way around this problem?
None that I would recommend.

Related

How to run Derric

I'm trying to run Derric with command
import lang::derric::testparse;
I followed all instructions and got everything to work with eclipse and Rascal. I am running the rascal console with Derric. I have tried downloading older versions of eclipse, used windows 7, and windows 10. Nothing is working, I even read the rascal tutorial on modules to see if everything looks right and it does. I need it to work for a school assignment, if someone can get it to run can you tell me under which circumstances (i.e eclipse version, windows version, steps taken) to run the program?
rascal>import lang::derric::testparse;
Error: Cannot import module lang::derric::testparse
Time: 484ms
ok
rascal>
It's suppose to say ok at the end, and then I can run command generate().
Hi #yoyo great that you are trying Rascal, but you need to give more explanation about what you are trying to do. There are potentially two main causes of the message you get:
the module is correct but it cannot be found, or
the module is incorrect (e.g. it does not even parse correctly).
It would therefore be helpful if you show
where lang::derric::testparse is located in your file system, and
to show its contents.
As a side question: is there any relation with the Derric language (a DSL for file formats) Jeroen van den Bos has been working on a few years ago?

νz (z3opt): Unable to make an Optimize object using Java API

I'm trying to use Max-SMT using the Java API. Below is my attempt:
Optimize opt = ctx.mkOptimize();
opt.Add(hardConstraints);
for(BoolExpr c : C){
opt.AssertSoft(c, 1, "group");
}
However, there is a runtime error in the first line, where opt is created.
Caused by: java.lang.UnsatisfiedLinkError:
com.microsoft.z3.Native.INTERNALmkOptimize(J)J at
com.microsoft.z3.Native.INTERNALmkOptimize(Native Method) at
com.microsoft.z3.Native.mkOptimize(Native.java:5237) at
com.microsoft.z3.Optimize.(Optimize.java:265) at
com.microsoft.z3.Context.mkOptimize(Context.java:3036)
I'm using the latest version of Z3 from Github, downloaded on Sept 30th.
On OSX, make sure that the System Integrity Protection doesn't interfere with your work. In this setting it may remove the DYLD_LIBRARY_PATH environment setting from your environment when it starts the JVM, which has the effect that *.dylib can't be found.
For Z3-specific information see Z3 Java API fails to detect libz3.dylib. For general info about SIP see About System Integrity Protection on your Mac. I haven't found a good way to tell OSX that Z3 is "safe" yet without disabling SIP altogether.

Fortify 4.2 SSC Error Processing

I’m using fortify 4.2 (SCA version: 6.2). I’m having hard time to upload an fpr file to the SSC. I always get “Error Processing” and I cannot tell what the problem is. I’ve opened the fpr file with auditworkbench and checked the Certification: it is valid.
Furthermore, I have a plenty of Scan errors and the majority is labeled with error code 1103 with the following description: Translator execution failed. Translator returned status 139.
Any leads?
PS: I’m scanning a large application which includes different modules written in C, C++ and JAVA.
Based on your comment about the two files:
myFile.h
myFile.H
I am suspecting that the database in the back-end of SSC is case-insensitive?
Starting with Fortify 4.30 (or possibly 4.40) SSC started enforcing that database collation be case-sensitive (before this time it was stated it should be but was not enforced).
You need to upgrade the version of Fortify that you are using to one of the newer versions (current latest is 16.10). The SSC install documentation will contain instructions on migrating your SSC database from case-insensitive to case-sensitive.
The 139 error usually means that you are using a newer version of C/C++ than Fortify supports. Currently we are using C++14 or higher and getting the error with 19.2.

Maven support for Resin 4

I can not get the resin-maven-plugin working. Actually I want to test my web app on different App Servers (Jetty, Tomcat, JBoss, Glassfish all work great) by executing resin:run.
I tried the snapshots and final versions, but all have problems. The latest versions report:
Cannot find setter, adder nor field in com.caucho.maven.MavenRun for
'contextRoot'
There is a bug report about this issue, but Caucho is not supporting this plugin anymore.
So here my questions:
Is there a working version available?
If not, where can I find the source code (and then fix it myself)

Selenium IDE 1.2.0 is throwing errors with smartGWT 2.4

I'm trying to create test cases with Selenium on a GUI built using smartGWT2.4 I have told Selenium where to find the user-extensions for both core and IDE. The problem is it keeps throwing a Unexpected Error Exception. It cannot find autWindow.isc. Then it points me to line 17 within the user-extensions.js. I've researched and could not find a solution to this problem. Is this a known problem, is there a solution? I can get Selenium to work if I roll back the IDE to a later version, but I wanted to use Webdriver. If anyone has any solutions please let me know.

Resources