I am trying to run a test app in griffon. I can create the app, but when I go to run it I get the following error(s):
2013-01-25 11:12:02,352 [main] INFO griffon.swing.SwingApplication - Initializing all startup groups: [test1]
2013-01-25 11:12:05,702 [AWT-EventQueue-0] ERROR org.codehaus.griffon.runtime.builder.UberBuilder - An error occurred while building test1.Test1View#63935d75
java.lang.RuntimeException: Failed to create component for 'application' reason: java.awt.HeadlessException
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:97)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this$3$invokeFactoryMethod(UberInterceptorMetaClass.groovy)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass$this$3$invokeFactoryMethod.callCurrent(Unknown Source)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:168)
at test1.Test1View.run(Test1View.groovy:11)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:152)
at org.codehaus.griffon.runtime.builder.UberBuilder.build(UberBuilder.groovy:160)
at org.codehaus.griffon.runtime.core.AbstractMVCGroup$1.run(AbstractMVCGroup.java:129)
Caused by: java.awt.HeadlessException
at griffon.swing.SwingUtils.createApplicationFrame(SwingUtils.java:133)
at griffon.swing.AbstractSwingGriffonApplication.createApplicationContainer(AbstractSwingGriffonApplication.java:99)
at griffon.core.GriffonApplication$createApplicationContainer.call(Unknown Source)
at griffon.swing.factory.ApplicationFactory.newInstance(ApplicationFactory.groovy:54)
... 8 more
2013-01-25 11:12:05,714 [main] ERROR griffon.util.GriffonExceptionHandler - Uncaught Exception
java.lang.RuntimeException: Failed to create component for 'application' reason: java.awt.HeadlessException
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeFactoryMethod(UberInterceptorMetaClass.groovy:97)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.this$3$invokeFactoryMethod(UberInterceptorMetaClass.groovy)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass$this$3$invokeFactoryMethod.callCurrent(Unknown Source)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:168)
at test1.Test1View.run(Test1View.groovy:11)
at org.codehaus.griffon.runtime.builder.UberInterceptorMetaClass.invokeMethod(UberInterceptorMetaClass.groovy:152)
at org.codehaus.griffon.runtime.builder.UberBuilder.build(UberBuilder.groovy:160)
at org.codehaus.griffon.runtime.core.AbstractMVCGroup$1.run(AbstractMVCGroup.java:129)
Caused by: java.awt.HeadlessException
at griffon.swing.SwingUtils.createApplicationFrame(SwingUtils.java:133)
at griffon.swing.AbstractSwingGriffonApplication.createApplicationContainer(AbstractSwingGriffonApplication.java:99)
at griffon.core.GriffonApplication$createApplicationContainer.call(Unknown Source)
at griffon.swing.factory.ApplicationFactory.newInstance(ApplicationFactory.groovy:54)
... 8 more
Any insight you can give would be great.
My set up is:
Kubuntu Linux 12.10 64-bit
------------------------------------------------------------
Griffon 1.2.0
------------------------------------------------------------
Build: 11-Jan-2013 09:10 AM
Groovy: 2.0.6
Ant: 1.8.4
Slf4j: 1.7.2
Spring: 3.2.0.RELEASE
JVM: 1.7.0_09 (Oracle Corporation 23.2-b09)
OS: Linux 3.5.0-22-generic amd64
Thanks!!
ironmantis7x
As mentionioned in the docs at http://docs.oracle.com/javase/6/docs/api/java/awt/HeadlessException.html , this should be a problem with keyboard, mouse or display.
Assuming you did not force "-Djava.awt.headless=true", this is most likely caused by a missing connection to a X-server.
Type
echo $DISPLAY
in a terminal window. Usually this outputs ":0". Make sure that variable is set (happens automatically for terminal windows), and try starting a very basic X application, such as "xterm". If that works, the griffon app should launch and display.
Found it!!!
I needed to have the JRE installed and I didn't. It was looking for a dependency that I needed.
Related
I'm trying to sign my application on Windows 10 using the following command.
java -jar signapk.jar platform.x509.pem platform.pk8 not_sign.apk sign.apk
And it gives me the following error, please help me !!
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.conscrypt.OpenSSLBIOInputStream.(OpenSSLBIOInputStream.java:34)
at org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:119)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:220)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:216)
at org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.java:94)
at org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:272)
at java.security.cert.CertificateFactory.generateCertificate(Unknown
Source)
at com.android.signapk.SignApk.readPublicKey(SignApk.java:184)
at com.android.signapk.SignApk.main(SignApk.java:1007) Caused by: java.lang.IllegalArgumentException: Failed to load any of the
given libraries: [conscrypt_openjdk_jni-windows-x86_64,
conscrypt_openjdk_jni]
at org.conscrypt.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:160)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:49)
at org.conscrypt.NativeCrypto.(NativeCrypto.java:53)
... 9 more
I found some solutions but they are all using Linux instead of Windows. Because of the limitation of my company, Windows is a must.
During a course it was installed JDK on my computer in order to be able to run eXist database. After this, after executing the command java -jar fileName.jar I get the following error.
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 com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
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(Thread.java:835) Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no
suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
... 1 more Exception in thread "main" 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(Thread.java:835)
Windows 10
java -version
openjdk version "12.0.2" 2019-07-16 OpenJDK Runtime Environment Adopt
OpenJDK (build 12.0.2+10) OpenJDK 64-Bit Server VM Adopt
OpenJDK (build 12.0.2+10, mixed mode, sharing)
From your log its clear that you'r using JDK-12, and it seems that your jar is developed with JDK-8 where this version of JDK contains the JavaFx library.
But Oracle is removing JavaFX from the JDK-11, so it is no longer present in the JDK-11+, instead you have two solutions :
use JDK-8 which contains this JavaFx,
or include the JavaFx package or dependency in your project check the link
I uninstalled JDK 12 (it was listed in the Apps as AdoptOpen... with no 'java' keyword), then installed both jdk8 and JRE 8. Now I can run both eXist database and the other .jar software (the developer told me that was indeed the issue with JavaFx.
I am attempting to build a new project with gradle, junit, and jmock. When I run my build, I get this stack trace:
com.heavyweightsoftware.daybook.ws.TypeCodeWsTest STANDARD_ERROR
java.lang.IllegalStateException: Native library for Attach API not available
in this JRE
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.ru
nTestClass(JUnitTestClassExecuter.java:80)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.ex
ecute(JUnitTestClassExecuter.java:49)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.p
rocessTestClass(JUnitTestClassProcessor.java:64)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.process
TestClass(SuiteTestClassProcessor.java:50)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionD
ispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionD
ispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(Con
textClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocat
ionHandler.invoke(ProxyDispatchAdapter.java:93)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestCl
ass(TestWorker.java:106)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionD
ispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionD
ispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(Messa
geHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.
onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableE
xecutorImpl.java:40)
Caused by: java.lang.UnsatisfiedLinkError: no attach in java.library.path
... 14 more
Gradle Test Executor 1 finished executing tests.
com.heavyweightsoftware.daybook.ws.TypeCodeWsTest > testGetTypeCodes FAILED
java.lang.ExceptionInInitializerError
at com.heavyweightsoftware.daybook.ws.TypeCodeWsTest.testGetTypeCodes(Ty
peCodeWsTest.java:40)
Caused by:
java.lang.IllegalStateException: Native library for Attach API not avail
able in this JRE
at mockit.internal.startup.AgentLoader.getVirtualMachineImplementati
onFromEmbeddedOnes(AgentLoader.java:78)
at mockit.internal.startup.AgentLoader.loadAgent(AgentLoader.java:46
)
at mockit.internal.startup.Startup.verifyInitialization(Startup.java
:172)
at mockit.Invocations.<clinit>(Invocations.java:26)
... 1 more
Caused by:
java.lang.NoClassDefFoundError: Could not initialize class sun.tools
.attach.WindowsVirtualMachine
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unk
nown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at mockit.internal.startup.AgentLoader.getVirtualMachineImplemen
tationFromEmbeddedOnes(AgentLoader.java:70)
... 4 more
So I looked and found these questions: JMockit ERROR - Native library for Attach API not available in this JRE and jmockit: Native library for Attach API not available in this JRE error
And I've made the changes in eclipse, but this error happens even when running outside of eclipse and so it's not the eclipse settings.
Here's the output of java -version from the command prompt:
C:\Users\thom\git\daybook\WebServices>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
This is part of gradle build --info:
Executing task ':test' (up-to-date check took 0.193 secs) due to:
Value of input property 'candidateClassFiles' has changed for task ':test'
Starting process 'Gradle Test Executor 1'. Working directory: C:\Users\thom\git\
daybook\WebServices Command: C:\java\bin\java.exe -Djava.security.manager=jarjar
.org.gradle.process.internal.child.BootstrapSecurityManager -Dfile.encoding=wind
ows-1252 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp C:\Users\th
om\.gradle\caches\2.4\workerMain\gradle-worker.jar jarjar.org.gradle.process.int
ernal.launcher.GradleWorkerMain 'Gradle Test Executor 1'
Successfully started process 'Gradle Test Executor 1'
Gradle Test Executor 1 started executing tests.
Which tells me it's running java from c:\java\bin which is the right install. I looked and this directer has javac in it, which I think confirms that it's a JDK and not a JRE.
Any input, oh wise above wise?
I added c:\java\jre\bin to my path and the build started working again.
For 3 days now, I have been trying to install glassfish 4.1 on eclipse Luna version 4.4.1. I first installed the plugin from eclipse marketplace then added it in my runtime using jdk 8. I also made jdk my default since eclipse default uses jre. I have to point out that I have been been using glassfish on netbeans and tomcat on eclipse but I decided to play around with glassfish on eclipse. Every information I got on the internet didn't fix my issue.
Below is the error I got in the console. Right now, this is driving me nuts so I have decided to come to you for direction.
Thanks
Launching GlassFish on Felix platform
ERROR: Unable to create cache directory: C:\Program Files\glassfish-4.1\glassfish\domains\domain1\osgi-cache\felix
ERROR: Error creating bundle cache. (java.lang.RuntimeException: Unable to create cache directory.)
java.lang.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:131)
at org.apache.felix.framework.Felix.init(Felix.java:640)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException: org.osgi.framework.BundleException: Error creating bundle cache.
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:90)
Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
at org.apache.felix.framework.Felix.init(Felix.java:645)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:131)
at org.apache.felix.framework.Felix.init(Felix.java:640)
... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:170)
at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157)
at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112)
... 6 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.newFramework(OSGiGlassFishRuntimeBuilder.java:241)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:135)
... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=192m; support was removed in 8.0
Run Eclipse or any other IDE you use in Administrator mode.
Works for me.
I think your comment deserves to be posted as the main answer but I have been trying to mark your comment as answer but I wash't able to. So I decided to post post your comment here and then back it up with my own experience.
Answer by unwichtich:
I guess this is a similar problem. The cause may be that you have installed Glassfish in c:\Program Files. You can try to move your Glassfish installation to a directory where your normal user account has full access rights but you then have to change the path to the Glassfish installation in Eclipse.
My own experience:
Turns out that all the problems I had with the glassfish server (including exit code 1 error) was because glassfish could not handle folder names with spaces in it. So I moved the glassfish-4.1 folder from C:\Program File\glassfish-4.1.. path to C:\ glassfish-4.1.. It wiped all my tears away. This is really important in eclipse and netbeans IDEs (if you are installing the netbeans that does not come with a glassfish bundled zip).
I had the same problem and fixed it by installing Glassfish under C:\ instead of C:\Program Files. Try that.
use JDk 7 instead of JDK 8 am also faced the same issue i just changed to jdk7 its working now.
I'm going slowly mad.
I'm on windows 7 64 bit, using the latest SonarQube and runner 2.3.
I have SonarQube running against port 9000.
When I try to run sonar-runner.bat I get:
C:\myRoot\SonarQube\SonarQubeRunner\sonar-runner-dist-2.3\sonar-runner-2.3
SonarQube Runner 2.3
Java 1.7.0_45 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Runner configuration file: C:\myRoot\SonarQube\SonarQubeRunner\sonar-runner-dist-2.3\sonar-runner-2.3\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\myRoot\SonarQube\sonar_examples\sonar-examples-master\projects\languages\php\php-sonar-runner\src\.sonar
INFO: SonarQube Server 4.0
14:18:52.103 INFO - Load batch settings
14:18:52.196 INFO - User cache: C:\Users\myName\.sonar\cache
14:18:52.212 INFO - Install plugins
14:18:52.602 INFO - Install JDBC driver
14:18:52.602 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1.700s
Final Memory: 4M/74M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
ERROR: Caused by: com.mysql.jdbc.Driver
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
When I collect the debug info I get:
yadda, yadda ...
... 32 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
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 java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420)
... 37 more
I have a file called mysql-connector-java-5.1.26.jar at:
C:\myRoot\SonarQube\sonarqube-4.0\sonarqube-4.0\extensions\jdbc-driver\mysql
I can't think why it's not being found.
My .properities file is fairly simple.
ANY advice would be much appreciated.
Thanks for reading.
I had the same error message on my Jenkins setup using Linux Mint Debian Edition. I used SonarQube Runner 2.3 and SonarQube Server 4.1.1
ERROR: Unable to execute SonarERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'
ERROR: Caused by: com.mysql.jdbc.Driver
Here I read to restart the SonarQube server, which solved the issue for me.
I know it's trivial but that's all there was to it in my case and it's easy to overlook the little things.
if you are trying with your local Mysql data base then use these codes in your sonar.properties file of sonarcube.
# Permissions to create tables, indices and triggers must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username=root
sonar.jdbc.password=root
#----- MySQL 5.x
# Comment the embedded database and uncomment the following line to use MySQL
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonardb?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
the last two line code is not specified in any of the sonar tutorials for Mysql.
And finally make sure you have created SONAR_RUNNER_HOME with proper value and the path variable entry up to the bin directory.