RazorSQL not working? - java

I am using RazorSQL and when I run it from my terminal it's not opening and throws the following exception:
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:218)
at load.RazorSQL.main(Unknown Source)
1389939280395: Unable to show launch screen: null
1389939280577: Attempting to load . . .
java.lang.ExceptionInInitializerError
at com.jgoodies.looks.plastic.PlasticLookAndFeel.<clinit>(Unknown Source)
at load.c.z(Unknown Source)
at load.c.<init>(Unknown Source)
at load.c.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at load.RazorSQL.main(Unknown Source)
Caused by: java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getScreenResolution(HeadlessToolkit.java:227)
at com.jgoodies.looks.LookUtils.isLowResolution(Unknown Source)
at com.jgoodies.look
It was working earlier but suddenly it has stopped working. What I can infer from the exception is that it's giving a swing error so it's GUI error. It's unable to open razorsql.png which is the opening icon.
Anyone has any idea about why is it not working?

It seems to me that this error has nothing to do with razorsql. Check for java graphics lib is properly installed in your system or not.
To be more sure install JRE. I hope that should solve your issue. Ubuntu has capability to install headless java.
sudo apt-get install openjdk-6-jdk
sudo apt-get install openjdk-6-jre

For cross-platform use, RazorSQL relies on the host platform's available Java installation. See Using Headless Mode in the Java SE Platform for details about why the GUI throws HeadlessException in the absence of an X window client. Some alternatives are discussed here.

Related

Java NoSuchMethodError for regex.Matcher.results() when running .jar file

When I run my app as a .jar file, it returns the below error:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrc
der.java:61)
Caused by: java.lang.NoSuchMethodError: java.util.regex.Matcher.results()Ljav
til/stream/Stream;
at SalesToExcel.start(SalesToExcel.java:108)
at SalesToExcel.main(SalesToExcel.java:45)
... 5 more
However, it works when I run it inside of the Eclipse IDE. Any ideas? I'm not sure if I'm somehow missing a proper jar file even though java.utils.regex should come included in rt.jar. Is there a way to check if this is missing somehow when I package the jar?
So, this is your problem. java.util.regex.Matcher.results is in Java since Java 9 and you are running the .jar with Java 8.
Eclipse runs with Java11.
Install as default JRE at least Java9 in your OS (Windows ?).

Google App Engine DataNucleus 3.1.1 Unexpected Exception Error

Trying to find a way to get rid of this error on eclipse.
DataNucleus Enhancer (version 3.1.1) : Enhancement of classes
Encountered a problem: Unexpected exception
Here is the log
java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)
... 2 more
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.datanucleus.enhancer.asm.ASMClassEnhancer.getClassNameForFileName(ASMClassEnhancer.java:272)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:727)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258)
... 7 more
I have two versions of java, one is 1.8.0_25, the other is 1.7.0_46
this is my path
C:\Program Files (x86)\Java\jre7\bin;;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;
and as a default I use the jre7 on eclipse, dont know what else to mention here. I found no solutions clearly explained here or on the other websites rather than trying to change the java version, tried all java instances on my computer, uninstalled and installed again. I am guessing it may be about java and datanucleus compability issue, but currently using the java7 and the plugins i am using were downloaded automatically from eclipse so no clue. If you need any clarifications, ask me out please.
If you are using Java 8, you need to set the compiler compliance level to 1.7 in project properties. You will also need to change the java facet version
Note that (GoogleAppEngine Enhancer Error Code 1:)
App Engine doesn't work with Java 1.8. Try doing it again, with Java 1.7
Setting Java 1.7 in Project settings solves me the problem.
Well like I have guessed, it is all about the compatibility issue. If you are getting this error, make sure EVERYTHING your eclipse AND your computer use is the same version of java everywhere. What I mean is you need to check;
In eclipse, from the top menu choose Project->Properties, then make sure all the versions of java used by eclipse are the same.
AND
AND
and of course your environment variable should point to the same version that eclipse uses.
Hope this helps. Post comments if you found it unclear. Getting errors before even started coding sucks :p

Conditional java.lang.NoClassDefFoundError in Webstart application

We have a webstart swing application running on our multiple remote desktop servers for a lot of customers. Suddenly, on one of our servers the customers started getting a java.lang.NoClassDefFoundError. Not on startup, the applications starts up fine, but when doing specific tasks, eg sending a mail through our software, it popups up in the console like this:
java.lang.NoClassDefFoundError: pos/MailSenderInterface
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
......
Caused by: java.lang.ClassNotFoundException: pos.MailSenderInterface
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 56 more
The problem is, this only happens on ONE of our servers. On all the other servers the webstart application runs just fine! But on this single terminal server, I get the error, even though the java version is the same, and the link to the jnlp-file is the same.
I have of course tried deleting temporary internet files in the java control panel, to no avail.
I then started toying around a bit, and found out something very strange.
Our customers start the application from an icon pointing to a batch-file in c:\drift
This batchfile only contains the following:
#start javaws http://ourserver/ourapplication.jnlp
Typing the link outside the batch-file gives the same error. Then I typed cd .. so that my current path was c:\ instead of c:\drift and started javaws from there. And surprise, no errors! I then tried cd drift again and the error occured again. I have tried this many times now, with the same result. So somehow the path from WHERE I start javaws have something to say for if I get the NoClassDefFoundError or not. But neither c:\ or c:\drift contains any .jar-files (although subdirectories may). I am very perplexed by this. What on earth is wrong? Our java version is 1.7.0_67
Aha! The path c:\drift\ actually had a directory "pos" from a couple of years back, with an old version of MailSender.class but with no MailSenderInterface.class Deleting this directory solved the problem. :-)
(Remember that the error was about a missing pos/MailSenderInterface)
Apparently the newest javaws in java 1.7.0_67 tries to load classes from a subdirectory of the place where you started javaws if such a directory is found, instead of loading the files from the correctly downloaded jar-files.

Using tess4j, ghostscript and Java with Eclipse on mac

I am trying to get tess4j working in a simple test application to perform OCR on a pdf file but receive the following error and cannot fathom out how to resolve it:
Exception in thread "main" java.lang.RuntimeException: Unable to load library 'gs': dlopen(libgs.dylib, 9): image not found
Please download, install GPL Ghostscript from http://sourceforge.net/projects/ghostscript/files and/or set the appropriate environment variable.
at net.sourceforge.vietocr.PdfUtilities.convertPdf2Tiff(Unknown Source)
at net.sourceforge.vietocr.ImageIOHelper.getIIOImageList(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at Test.main(Test.java:11)
I have got eclipse to print out my path file as it sees it and it contains /usr/loca/bin/gs (checked as correct with which gs) as needed and I can happily run gs from the terminal. Any ideas on how to get this working?
The code is shown in the image at https://dl.dropboxusercontent.com/u/61920208/Screen%20Shot%202013-09-02%20at%2013.44.24.png
Thanks in advance for any help
As per the suggestion, reinstalling ghostsrcipt (via ports rather than the dmg)sorted this out for me.

JProfiler UnsatisfiedLinkError when starting

I just downloaded and installed a trial JProfiler version from jprofiler_linux_7_0_1.sh. The strange fact is that there's no prompt for inputting license information in the installing process. But everything seems to be fine, until I try to run the profiler:
# sh ./bin/jprofiler -c
(The -c is to run jprofiler in console. I have read somewhere on Internet, but not sure that's true. Anyway, the result is still the same.)
Here's the results I get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/jdk1.6.0_26/jre/lib/amd64/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
at java.awt.Component.<clinit>(Component.java:566)
at com.install4j.runtime.splashscreen.JavaSplashController.show(Unknown Source)
at com.install4j.runtime.launcher.SplashEngine.showSplashScreen(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
I have come to /opt/jdk1.6.0_26/jre/lib/amd64/xawt; it does have libmawt.so, but no libXext.so.6. I tried to uninstall jprofiler and install it again, but the same error occurs.
Does anyone have a clue what's happening here?
You cannot run the JProfiler GUI in console mode. The argument -c is only for running the installer in console mode.
To set up profiling on a headless machine, run
bin/jpintegrate
To control a profiled process that does not have a JProfiler GUI attached ("offline profiling") run
bin/jpcontroller
Check that you have got libxtst in your operation system. To install it, you can do something like this: "sudo apt-get install libxtst6:
PS: You could also try to use YourKit Java Profiler with evaluation license.

Categories