CORBA/Webstart application doesn't work with Java7u55 anymore - java-7

My CORBA/Webstart application using an alternative ORB implementation (OpenORB) doesn't work with Java7u55 anymore.
The following exception occurs:
Error org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation org.openorb.CORBA.ORBSingleton vmcid: 0x0 minor code: 0 completed: No
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation org.openorb.CORBA.ORBSingleton vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.ORB.create_impl_with_systemclassloader(Unknown Source)
at org.omg.CORBA.ORB.init(Unknown Source)
at org.openorb.CORBA.kernel.OpenORBLoader.init(Unknown Source)
at org.openorb.CORBA.ORB.set_parameters(Unknown Source)
at org.omg.CORBA.ORB.init(Unknown Source)
...
Caused by: java.lang.ClassNotFoundException: org.openorb.CORBA.ORBSingleton
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)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
... 17 more
I think a a change in orb.omg.CORBA.ORB.init() is the reason the class for the ORB implementation wasn't found anymore as SystemClassLoader is used here now to create the ORB instance instead of current Thread's ContextClassLoader as before.
As a workaround I've copied the Jar containing org.omg.CORBA API of the ORB implementation I'm using to <jre-home>/lib/endorsed/ expecting that it will be used instead but still the implementation in rt.jar is used.
Any ideas how to work around this problem?

Finally I found a workaround which doesn't work for the currently used OpenORB but for JacORB (3.4).
Oracle obviously updated the release notes suggesting to configure only the org.omg.CORBA.ORBClass property but to ommit org.omg.CORBA.ORBSingletonClass which means the default singleton implementation shipped with Java will be used which is visible for the SystemClassLoader.
This may not work with all ORBs and in fact it doesn't work with OpenORB as it checks org.omg.CORBA.ORBSingletonClass but my application works without problems with the mentioned version of JacORB now.

there should be several workarounds:
specify the following VM args when launching your app: -Djava.endorsed.dirs=/path/to/your/corba_library_jars_folder
specify the following VM args when launching your app:
-Xbootclasspath/p:/path/to/your/corba_lib.jar:/path/to/your/corba_lib2.jar:...
copy your jars into $JAVA_HOME/jre/lib/endorsed directory (create it if it doesn't exist)

Related

JavaFX 11 Error intializing QuantumRenderer when running custom JRE image on Windows

I have built my app with JavaFX 11 and now I need to distribute it. I have chosen to distribute it in two ways: cross-platform fat-jar (I know, I know, it is discouraged, but that is not the point) and platform specific image created with jlink.
I am building on Linux Mint 20.1. I am using Maven and creating runtime image with javafx-maven-plugin. I have JDKs for both platforms on my Linux machine and pointed to the corresponding jmods folder in pom.xml.
The built fat-jar works on both Linux and Windows where both have installed the latest Java SDK (11.0.12).
The image for Linux also works without problems.
However, the image for Windows does not run and the output of -Dprism.verbose=true is this:
B:\Data\sjsm\releases\1.0\sjsm-1.0-win\bin>sjsm-1.0-launcher.bat Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.UnsatisfiedLinkError: no prism_sw in java.library.path: [B:\Data\sjsm\releases\1.0\sjsm-1.0-win\bin, C:\WINDOWS\Sun\Java\bin, C:\WINDOWS\system32, C:\WINDOWS, C:\Program Files\Eclipse Foundation\jdk-11.0.12.7-hotspot\bin, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0\, C:\WINDOWS\System32\OpenSSH\, C:\Program Files\dotnet\, B:\xampp\php, B:\MinGW\bin, C:\Program Files\Microsoft SQL Server\120\Tools\Binn\, B:\Git\cmd, B:\Matlab R2020a\bin, B:\Microsoft VS Code\bin, C:\Users\User\AppData\Local\Microsoft\WindowsApps, B:\xampp\php, ., .]
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
at java.base/java.lang.System.loadLibrary(Unknown Source)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(Unknown Source)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(Unknown Source)
at javafx.graphics/com.sun.prism.sw.SWPipeline.lambda$static$0(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.prism.sw.SWPipeline.<clinit>(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
I got the same response when I tried to run the project from source on Windows. (I copied the project to Windows, installed maven, and it would not even run with javafx:run, let alone jlink with javafx:jlink)
I have tried many links on Google and none of them works, People either have something missing in their installation (I have everything installed at least as far as I have found) or the issue pops up in a different situation (when packaging a fat-jar for example, or running their application from IDE).
What I have not tried so far is creating the image by hand from command line, since I have read many times that it is discourage compared to using a build tool like Maven.
What can I try next?
java.lang.UnsatisfiedLinkError: no prism_sw in java.library.path
Means you're definitely missing some dlls from your library path, although this could only be a part of the problem.
When you download javafx sdk for windows from this link, you get a zip with the following structure:
The bin folder contains all the natives you need to run JavaFx (on windows, or the platform you downloaded the sdk for)
Note that you don't always need all the natives, jfxwebkit.dll for example is only needed when you work with javafx-web.
You need to extract them somewhere and add the folder you extracted them in to the library path when you run the java program
java "-Djava.library.path=path_to_natives" -classpath "your_classpath" <Your main class>
I have managed to solve this. The javafx-maven-plugin expects in <jModsPath> a colon separated list of paths to ALL jmods, not just the standard oridinary JDK. It pulls what's missing out of maven repository I think but ignores all platform clasifiers.

JMeter Hbase scan sampler fails with ClassNotFoundException exception

I'm trying to use Hadoop/Hbase sampler to connect and scan the tables created in Hbase, however my test is failing with the following messages.
Checked the configuration of Hadoop/Hbase all the service are running and listening to the appropriate port. (zookeeper is running and listening to 2181).
2016/04/02 15:44:04 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration
at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<init>(DefaultMetricsSystem.java:37)
at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.<clinit>(DefaultMetricsSystem.java:34)
at org.apache.hadoop.security.UgiInstrumentation.create(UgiInstrumentation.java:51)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:217)
at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
at org.apache.hadoop.security.KerberosName.<clinit>(KerberosName.java:79)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:210)
at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:185)
at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:237)
at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:482)
at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:468)
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.apache.hadoop.hbase.util.Methods.call(Methods.java:37)
at org.apache.hadoop.hbase.security.User.call(User.java:590)
at org.apache.hadoop.hbase.security.User.callStatic(User.java:580)
at org.apache.hadoop.hbase.security.User.access$400(User.java:51)
at org.apache.hadoop.hbase.security.User$SecureHadoopUser.<init>(User.java:397)
at org.apache.hadoop.hbase.security.User$SecureHadoopUser.<init>(User.java:392)
at org.apache.hadoop.hbase.security.User.getCurrent(User.java:140)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionKey.<init>(HConnectionManager.java:435)
at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:180)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:155)
at org.apache.hadoop.hbase.client.HTableFactory.createHTableInterface(HTableFactory.java:36)
at org.apache.hadoop.hbase.client.HTablePool.createHTable(HTablePool.java:265)
at org.apache.hadoop.hbase.client.HTablePool.findOrCreateTable(HTablePool.java:195)
at org.apache.hadoop.hbase.client.HTablePool.getTable(HTablePool.java:174)
at com.atlantbh.jmeter.plugins.hbasecomponents.config.HBaseConnectionVariable.getTable(HBaseConnectionVariable.java:43)
at com.atlantbh.jmeter.plugins.hbasecomponents.samplers.HBaseScanSampler.sample(HBaseScanSampler.java:94)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 35 more**
The problem is on your JMeter side. As the error message states:
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
which means that HBase Scan Sampler requires Apache Commons Configuration library, but looks like Hadoop plug-in does not provide it in its zip package. Try to ask on their forum if they are willing to fix it.
For now as a workaround you can:
Download commons-configuration2-2.0-bin.zip from the site
Unzip it
Copy commons-configuration2-2.0.jar into .../apache-jmeter/lib
Restart jmeter

UnsatisfiedLinkError with Oracle OTT utility

I am trying to run Oracle's Object Type Translator Utility (OTT) and getting below error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\oraclexe\app\oracle\product\11.2.0\server\bin\ocijdbc11.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3516)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3512)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:266)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:162)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at oracle.ott.Konnection.getTheConnection(Konnection.java:102)
at oracle.ott.Konnection.<init>(Konnection.java:39)
at oracle.ott.Doit.main(Doit.java:107)
at oracle.ott.c.CMain.main(CMain.java:9)
It was working fine few months ago and no idea why this is giving error now.
So, I figured out finally that there was some issue with the old setup of instant client 11_2.0, so i installed new instant client 11_2.2 and set all the required environment variables and it works perfectly fine.

Tomcat 7 : Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

I have installed tomcat7 in my windows xp pc and on starting the service, i cannot access localhost:8080 in my browser and found the following in tomcat7 log files.
2013-05-15 15:00:30 Commons Daemon procrun stderr initialized
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number
in class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Tomcat 7 requires a minimum of Java 6. The most likely cause is that you are trying to run Tomcat on Java 5 or earlier.
The alternative is that you have added something to your Tomcat install that has been compiled with a later version of Java that you are running. In this case, get a clean Tomcat install running first and then deal with the class version problem (either by running Tomcat with a later version of Java or by recompiling whatever it is you have added for Java 6 or earlier).

Why is WEKA not running from the command line?

I apologize, this seems like it is really simple but I can't seem to get it.
I've downloaded the Windows version of WEKA and installed it, but I can't seem to call it from the command line.
I've added a WEKAHOME environment variable, pointing to the directory containing weka.jar, and added that to my path with /weka.jar appended to it..
I am trying this command: java weka.classifiers.j48.J48 -t %WEKAHOME%/data/iris.arff
I then get the following error output.
Exception in thread "main" java.lang.NoClassDefFoundError:
weka/classifiers/j48/ J48 Caused by: java.lang.ClassNotFoundException:
weka.classifiers.j48.J48
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) Could not find the main class: weka.classifiers.j48.J48. Program will exit.
What can I do to fix this?
It's because of this weka.classifiers.j48.J48, that is an error in the Weka documentation, it should be: weka.classifiers.trees.J48
(Note: the comments below are no longer relevant. The answer here works, and remember to set the classpath as Thomas Jungblut says below.)

Resources