I have a dev PC with Win7 and Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode) installed and a test server with Ubuntu and OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1 ~12.04.1). I also have a Grails application with a jasper plugin to print some pdf files. While it works on the dev PC, on the test server it fails with this exception:
ERROR errors.GrailsExceptionResolver - NoSuchMethodError occurred when processing request: [GET] /test/printer/print
com.lowagie.text.pdf.PdfWriter.setRgbTransparencyBlending(Z)V. Stacktrace follows:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [print] of controller [com.***.PrinterController] caused exception: Runtime error executing action
I have read so far that this may be caused by an inapropriate version of iText library, but the same itext.jar is included into the plugin on both machines. I'll appreciate any ideas that may help make this plugin work
Finally discovered that the project had a pdf 0.6 plugin that contained an itext 2.0.8 library which was used instead of the expected itext 2.1.7
Related
I am learning spark. And trying to run a simple spark app that output 5 dataframe rows without installing spark. I know that one can run spark app without installing spark. The app is throwing below error and I could not resolve the issue. I have tried solution posted on snowflake to similar problem but in vain. Below is the error log for your reference.
Using below softwares:
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2022-09 (4.25.0)
Build id: 20220908-1902
java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Microsoft-25199 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Microsoft-25199 (build 11.0.12+7, mixed mode)
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.spark.unsafe.array.ByteArrayMethods.<clinit>(ByteArrayMethods.java:54)
at org.apache.spark.internal.config.package$.<init>(package.scala:1095)
at org.apache.spark.internal.config.package$.<clinit>(package.scala)
at org.apache.spark.SparkConf$.<init>(SparkConf.scala:654)
at org.apache.spark.SparkConf$.<clinit>(SparkConf.scala)
at org.apache.spark.SparkConf.set(SparkConf.scala:94)
at org.apache.spark.SparkConf.set(SparkConf.scala:83)
at org.apache.spark.sql.SparkSession$Builder.$anonfun$getOrCreate$1(SparkSession.scala:916)
at scala.collection.mutable.HashMap.$anonfun$foreach$1(HashMap.scala:149)
at scala.collection.mutable.HashTable.foreachEntry(HashTable.scala:237)
at scala.collection.mutable.HashTable.foreachEntry$(HashTable.scala:230)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:44)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:149)
at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:916)
at net.jgp.books.spark.ch01.lab100_csv_to_dataframe.CsvToDataframeApp.start(CsvToDataframeApp.java:32)
at net.jgp.books.spark.ch01.lab100_csv_to_dataframe.CsvToDataframeApp.main(CsvToDataframeApp.java:21)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module #35dab4eb
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
at org.apache.spark.unsafe.Platform.<clinit>(Platform.java:56)
... 16 more
I tried the solutions here Why am I seeing `java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible` on a mac
I tried uninstalling and reinstalling java again. I am a newbie.
Try adding the below to your Spark session builder
SparkSession.builder()
// your setting
.config(
"spark.sql.extensions",
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions"
)
We recently migrated from java 8 to openJdk11. Now I am trying to test my application on windows and ubuntu with using openJdk installed on both OS. I'm able to run it on ubuntu. But same is not executing in windows10 with java11.Error_Message:
java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Unknown Source)
It is possible that JDK, which you have installed on your Windows system, doesn't include JavaFX and you should install it externally.
Read more here:
Where can I get pre-built JavaFX libraries for OpenJDK (Windows)
or
https://stackoverflow.com/a/19529820
or
Javafx: No toolkit found exception
.
I am not sure how the differnences between Linux and Windows come into place, but in general com.sun.javafx.tk.Toolkitis not accesible anymore since Java 9. So the behaviour on Windows throwing an exception is correct, and you need to find another solution for whatever you are using theToolkit-class for.
I recently installed openJDK 9 under Ubuntu 17.10 and it seems like IntelliJ IDEA has trouble with it.
Whenever I create a new project IntelliJ can find the JDK, but it seems like it's not configuring it the right way. Here is how it looks like
when I create a HelloWorld.java example it looks like this
and it says 'Can't resolve symbol 'String''.
Everything works fine when I compile via terminal and even with Eclipse.
When I type 'java --version' it says
openjdk 9-Ubuntu
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
Is there a way to fix this problem?
The problem is related to Debian packaging of openjdk-9 in the lib/jrt-fs.jar file. This file is compiled incorrectly.
This bug is reported here and there is a more complete Answer here.
If you insist to make use of openjdk you might wait for the new versions or try to build it from the source using the recommended options on the launchpad.
I am having problems with all of the 2.2.x versions of Android Studio on my Mac. I have downloaded the 2.2.2.0, and when I run the app, I can see the icon comes up in the Dock briefly, and then goes away.
OS X:
Yosemite (10.10.5)
System Java:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
Note: This is the ONLY JRE I have on my system
Console Error:
10/22/16 11:03:21.548 AM studio[953]: allVms required 1.8*,1.8+
10/22/16 11:03:21.552 AM studio[953]: Cannot load JVM bundle: Error Domain=NSCocoaErrorDomain Code=3585 "The bundle “OpenJDK 8” couldn’t be loaded because it doesn’t contain a version for the current architecture." (dlopen_preflight(/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: mach-o, but wrong architecture) UserInfo=0x7f845610 {NSLocalizedRecoverySuggestion=Try installing a universal version of the bundle., NSFilePath=/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib, NSLocalizedFailureReason=The bundle doesn’t contain a version for the current architecture., NSLocalizedDescription=The bundle “OpenJDK 8” couldn’t be loaded because it doesn’t contain a version for the current architecture., NSDebugDescription=dlopen_preflight(/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: mach-o, but wrong architecture, NSBundlePath=/Applications/Android Studio.app/Contents/jre/jdk}
Any suggestions would be greatly appreciated, as I've been trying to figure this out for quite some time.
Try install Java SE 1.8
Add JAVA_HOME to PATH in mac
$ touch .bash_profile
In bash_profile, add
export JAVA_HOME=`/usr/libexec/java_home`
$ echo $JAVA_HOME
You will see something like
/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home
Since Android Studio v2.2 (AS) uses its own bundled OpenJDK 8, any other installed JDKs are not the issue. The solution is to install AS (either dragging from the mounted DMG or unzipping) anywhere except the Applications folder.
For whatever reason, when AS resides in Applications, it raises the error posted in the question. I would be very interested to know the reason, but after wasting countless hours, I am simply relieved it is running.
I configured jmeter to run the test distributed using Azure Windows Virtual Machines. All machines are using windows.
The test ran successfully using the GUI mode and I can get the result saved on master
However when I try to run the test from the console jmeter -n -t plan.jmx -r the console says:
Error in rconfigure() method java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: org.apache.jmeter.JMeter$ListenToTest
I' ve configured all the virtual machines (server and clients) like:
Java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Jmeter version 2.13
Jmeter Plugins 1.31
Any ideas what could be the issue?
Thanks
EDIT
I Downgrade Java version to 1.7 and now the error says
Error in rconfigure() method java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: org.apache.jmeter.threads.RemoteThreadsListenerTestElement
Can Jmeter Plugins the cause of the issue?
EDIT - FIXED
I changed Plugin version from 1.31 to 1.21 and now works!!!.
However I think, and i'm just guessing here, the error happens when I ran the test from GUI and then on the console. Probably GUI leaves a socket open or something like that, not sure.
Anyway this combination works
Java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
Jmeter version 2.13
Jmeter Plugins 1.21 (only Standard Version)
Check the logs in jmeter.log (inside bin folder) file and if you have somewhere an error like this:
2018-09-17 14:41:32,097 ERROR o.a.j.e.ConvertListeners: Error replacing class org.apache.jmeter.threads.RemoteThreadsListenerTestElement by wrapper: class org.apache.jmeter.threads.RemoteThreadsListenerWrapper java.rmi.RemoteException: Cannot start. yout-pc-name is a loopback address.
Then start the jmeter by giving:
./jmeter -Djava.rmi.server.hostname=your_ip_address
I was struggling with:
NotSerializableException: org.apache.jmeter.threads.RemoteThreadsListenerTestElement
The problem in my case was:
Caused by: java.net.BindException: Address already in use (Bind failed)
This error info did not appear in the standard output, just the log file.