Server App Engine Standard at localhost failed to start - java

From eclipse, I created a Google App Engine Standard project and tried to Run it on local App Engine. It is not starting and throwing the below errors -
java.lang.NullPointerException
at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
at java.base/java.util.Properties.put(Properties.java:1316)
at java.base/java.util.Collections$CheckedMap.put(Collections.java:3636)
at com.google.appengine.tools.development.SharedMain.setTimeZone(SharedMain.java:219)
at com.google.appengine.tools.development.SharedMain.postServerActions(SharedMain.java:188)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:398)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:257)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:248)
Also note that I haven't made any changes to the project. It's the default that gets created.

This is likely an issue with your jdk version. What does javac -version report back? I run into the same stack trace with version 12. Switching to 1.8 works.
On MacOS, this answer helps: How to set or change the default Java (JDK) version on OS X?
Other platforms should have similar ways to switch versions.

This looks to be a JDK12 issue - it seems JDK12 is restricting the system properties exposed to programs, I've run into a similar issue with the OS version before.
I've reported it to Google, you can star it so they feel the weight of the matter: https://issuetracker.google.com/issues/140787205

Related

Why isn't VisualVM showing all the normal tabs?

Usually I see all these tabs in VisualVM for locally running Java programs:
However, I have one local program which is currently only showing me Overview and Monitor (even though it usually shows all those shown above):
Also interesting is that VisualVM itself doesn't present the Profile tab:
All three of the programs shown are running with the same JVM with the same Java Home.
What controls which tabs are shown for a particular program? How can I get them all back for my program showing just Overview and Monitor?
I have Visual VM 1.3.5 (latest at this date) and JDK 1.7.0_17.
I found that this was the issue of usage of wrong JDK version. In my case my application was running on 64bit JDK and I started VisualVM from 32bit JDK.
After starting VisualVM from the same JDK on which my application is running, everything was fine. Hope it will help you.
You might need to enable jmx ports on your app. Try adding these switches to your VM and see if the tabs appear again:
-Dcom.sun.management.jmxremote.port=6789 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
I've just removed ~/.visualvm and reran, See https://java.net/jira/browse/VISUALVM-598
As most of the people mentioned,
The issue was due to the version mismatch of virtualvm and your application.
additionally,
visualvm is bundled in oracle which supports jdk up to 9.
If you are using >9, please make sure you go for another profiler.
What worked for me was specifying the "Start profiling from" classes. If I left this blank, I didn't get the profiler tab. When I specified it, I did. I should probably note that this was a web application running under Tomcat, so I specified org.apache.catalina.startup.** as the starting class.
Check that proxy is disabled if you are running VisualVM for local application
I had a similar problem with missing profiler tab in VisualVM. I'm using Oracle JDK 1.8 and want to profile web application running on Tomcat 8 (JPA, Spring, Hibernate, Vaadin, etc).
I tried all above-mentioned solutions and many others found on the internet, but unfortunately, none of them solved missing profiler tab issue.
So I switched to Java Mission Control profiling tool (JMC + Flight Recorder) which is a part of standard Oracle JDK (from JDK 1.7 update 40) and it works great.
In my case, the issue was the usage of wrong JDK version. My App was running on jdk1.7.0_80, VisualVm running with jdk1.8.0_162.
Replacing the APP JDK version from 1.7.0_79 to 1.7.0_80 fixes the problem.

Netbeans Startup option 'sun.java2d.opengl=true' not recognised

I'm trying to tweak the performance of Netbeans on a rather old PC I am using. I've followed some of the suggestions here but the one regarding
sun.java2d.opengl=true
fails, giving
Unknown option -Dsun.java2d.opengl=true
I'm using Linux WattOS distro version 5, Java 1.7 and Netbeans 7.1.2. Has this option become obsolete now as the above page seems to refer to Java 5?
Are there additional steps I need to do to enable Netbeans to use openGL?
** Additional Info **
I realised that I should have used the option as
-J-Dsun.java2d.opengl=true
Although now I get a crash when I try starting Netbeans now. I've submitted a crash report so I'll wait and see what happens and post the result here.
Check with
java -version
what version of java you're using. This extension is only supported in the Sun JVM, and quite a few distros come with OpenJDK by default.

How to use the Play Framework with Google App Engine with locally installed Java 7?

I've just downloaded the latest version of the Play Framework (1.2.3) and am using it with the latest Scala plugin (0.9.1) and the Google App Engine module (1.4).
The default application works fine locally (at localhost:9000, the default port). I've also successfully published the default application to GAE using play gae:deploy.
However, when I go to the GAE remote URL, I get the standard error message:
Error: Server Error.
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
Here is the full stacktrace in the GAE logs: https://gist.github.com/1181257
I'm guessing the first error, the NPE, is due to something that can be easily fixed, so ignore that for now; however, note the second - critical - error, which says:
java.lang.UnsupportedClassVersionError: helpers/CheatSheetHelper$1 : Unsupported major.minor version 51.0
51.0 is (I think) the class version that the Java 7 compiler generates. Now, my question is simple:
How to force the Play Framework and its Scala plugin to compile the classes for GAE publishing using the -target 1.6 and -source 1.6 options, so that the output classes are 1.6 compatible, instead of the defaults, which make the local Java 7 installation generate 1.7 output classes?
Thanks.
[edit] As for the NPE, it seems that it's not thrown on Play 1.2.1 and the 0.9 version of the Scala plugin: Play framework with scala and GAE - again, this is just a side issue, the primary issue (getting Java 7 working) still stands. I've created a ticket for this: http://play.lighthouseapp.com/projects/74274-play-scala/tickets/45-nullpointerexception-on-google-app-engine
To get java 7 to work currently, you have to use the following configuration in your application.confirm file
java.source=1.6
See here for more details - VerifyError; Expecting a stack map frame in method controllers.Secure$Security.authentify
Java 7 is fully supported for Play 1.2.4 RC3 - give it a try and see if it solves your issues.
I just ran into the same issue. I'm running Java 7 and don't want to have all my other Java stuff run on 6 again. So, what I did was dump a copy of JDK 6 in a directory and then made a simple bash script to set the proper environment vars and call play. I then symlinked that script as "play" on my path. Now when play gets called it has a JDK 6 environment to run under without having to change everything else on the machine.
...less than ideal, but it works well enough and keeps everything clean.

I am not able launch JNLP applications using "Java Web Start"?

Up until recently, I was able to launch/open JNLP files in Firefox using Java web start.
Don't know what happened all of a sudden JNLP files stopped launching, a splash screen appears saying Java Starting... and then nothing happens. Even the Java Console in the browser and javacpl.cpl applet doesn't open.
Tried all possibilities: removed all older version and installed the latest JRE (java version "1.6.0_17"), still it doesn't work.
Done some googling for this problem, people suggested to start javaws.exe with -viewer option but same behavior (a splash screen appears saying "Java Starting..." and then disappears)
The problem is that I don't know any place (logs etc.) to look for to see what is causing the problem.
I am using WinXP SP3, and some of the screenshots below shows further info about my system.
I can provide any other detail if required but please help me solve this problem.
Have a look at what happens if you run javaws.exe directly from the command line.
I know this is an older question but this past week I started to get a similar problem, so I leave here some notes regarding the solution that fits me.
This happened only in some Windows machines using even the last JRE to date (1.8.0_45).
The Java Web Start started to load but nothing happened and none of the previous solution attempts worked.
After some digging i've found this thread, which gives the same setup and a great explanation.
https://community.oracle.com/thread/3676876
So, in conclusion, it was a memory problem in x86 JRE and since our JNLP's max heap was defined as 1024MB, we changed to 780MB as suggested and it was fixed.
However, if you need more than 780MB, can always try launching in a x64 JRE version.
i had the same problem here. go to your Java Control Panel and Settings... Uncheck 'Keep temporary files on my computer'. Apply changes and try again your .jnlp
Note: Tested on different machines; Windows Server 2012, Windows Server 2008 and Windows 7 64bit.
Java Version: 1.7++ since my jnlp app is built on 1.7
Please let me know your feedback too. :D
Java web start should be enabled.
Check if javaws (Java web start is enabled for your system), Use below command in console to open java control panel.
javaws -viewer
If javacpl does not open and gives you Could not find the main class:, it could be that Java is confused because of changes in deployment.properties (can be found in C:\Users\<username>\AppData\LocalLow\Sun\Java\Deployment on Win7). Delete that file and everything's fine.
This bug seems to be 6 years old, cf. An app should be able to ignore properties that have become obsolete over time, shouldn't it?
Although this question is bit old, the issue was caused by corrupted ClearType registry setting and resolved by fixing it, as described in this ClearType, install4j and case of Java bug post.
ClearType, install4j and case of Java bug Java
Do you know what
ClearType (font-smoothing technology in Windows) has in common with
Java (programming language and one of the recommended frameworks)?
Nothing except that they were working together hard at making me
miserable for few months. I had some Java software that I couldn’t
install. I mean really couldn’t – not even figure out reason or
reproduce it on another PC.
Recently I was approved for Woopra beta (site analytics service) and
it uses desktop client written in Java… I couldn’t install. That got
me really mad. :)
Story All of the software in question was similar :
setup based on install4j; setup crashing with bunch of errors. I was
blaming install4j during early (hundred or so) attempts to solve
issue. Later I slowly understood that if it was that bugged for that
long time – solution would have been created and googled.
Tracing After shifting focus from install4j I decided to push Java
framework. I was trying stable versions earlier so decided to go for
non-stable 1.6 Update 10 Release Candidate.
This actually fixed error messages but not crashes. I had also noticed
that there was new error log created in directory with setup files.
Previously I had only seen logs in Windows temporary directory.
New error log was saying following :
Could not display the GUI. This application needs access to an X
Server. If you have access there is probably an X library missing.
******************************************************************* You can also run this application in console mode without access to an
X server by passing the argument -c Very weird to look for X-Server on
non-Linux PC, isn’t it? So I decided to try that “-c” argument. And
was actually able to install in console mode.
Happy ending? Nope. Now installed app was crashing. But it really got
me thinking. If console works but graphical interface doesn’t – there
must be problem with latter.
One more error log (in application folder) was now saying (among other
things) :
Caused by: java.lang.IllegalArgumentException: -60397977 incompatible
with Text-specific LCD contrast key Which successfully googled me
description of bug with Java unable to read non-standard ClearType
registry setting.
Solution I immediately launched ClearType Tuner from Control Panel and
found setting showing gibberish number. After correcting it to proper
one all problems with Java were instantly gone.
cleartypetuner_screenshot Lessons learned Don’t be fast to blame
software problems on single application. Even minor and totally
unrelated settings can launch deadly chain reactions. Links Jave
Runtime Environment http://www.java.com/en/download/index.jsp
ClearType Tuner
http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
Woopra http://www.woopra.com/
install4j
http://www.ej-technologies.com/products/install4j/overview.html
I was also facing the same problem. To fix this to the following steps.
open Javaws from cmd runnig javaws -viewer command. A new window will open
Select the jnlp file which you want and click the run button.
Close the javaws viewer window.
Same solution worked as suggested by hpereira
The issue was due to JRE version was 32 bit and not 64 Bit
Check with java -version to see if your Java is 64 bit
C:\>java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) **64-Bit Server** VM (build 25.192-b12, mixed mode)
Is this an application to which you have the code? Java 6u14 included a change to the way it handles jar security that for us caused very similar issues. If your jars are signed and work with Java 6u13 or below, you might consider either refactoring your code to work around this update or requiring Java 6u13 or below. Unfortunately I don't recall exactly what we did to resolve the issue - it was panic mode at the time.
Again, if you have the code you have tools to work with. You can put in System.out.println statements in your startup routines - anything console output is displayed in the command window when you run the JNLP from the command line. Otherwise you might consider using a nice logger like log4j to get a better idea of the point of failure.
You may also consider removing the application entirely and downloading it anew. Java Web Start has a Control Panel applet that allows you to see the URL your app is downloading from (could be the wrong one), uninstall the app, set security options, etc.
I had the exact same problem. Turned out that the max-heap-size was set to 1024 and missing the unit. The configuration needed to be max-heap-size=1024m.
So apparently invalid memory configuration in the jnlp file will cause this exact behavior.
In my case, the problem was caused by starting my app from a shortcut on the public desktop (windows 7). As a result, as far as I can tell, the temporary files location was set to c:\users\public\etc. This resulted in the unable to write to cache detail. When I reset to defaults in the temporary files control applet, all worked fine.
In my case, Netbeans automatically creates a .jnlp file that doesn't work and my problem was due to an accidental overwriting of the launch.jnlp file on the server (by the inadequate and incorrect version from Netbeans). This caused a mismatch between the local .jnlp file and the remote .jnlp file, resulting in Java Web Start just quitting after "Verifying application."
So no one else has to waste an hour finding a bug that should be communicated adequately (but isn't) by Java WS.
This can also be due to environment variable CATALINA_HOME in your system. In our organization there were several cases where JNLP applications just refused to start without logging anything and emptying CATALINA_HOME solved the issue.
I had the environment variable set in the command prompt and it didn't appear in GUI. I'm not sure if setx command or register removal commands did the trick. Restart seems to be necessary after removing the variable.
I believe this is a security problem. If I download the jnpl file and execute it after a clean java 8 installation via javaws myfile.jnpl everything is working fine (I get multiple windows where I have to confirm some security problems).
I wanted to share the root cause for my issue. I was using High DPI in Windows and this caused JNLP to not launch. I had to turn off High DPI for this to work. Hope this helps.
Try Java Web Launcher, rather than Java Web Start Launcher. It worked for me.
Right-click on the JNLP file that is not opening and select Open With.
In the ‘How you want to open this File’ window, scroll down and click on Look for another app on this PC option.
When the File Explorer window opens, navigate to the following location:
C:\Program Files (x86)\Java\jre1.8.0_261\bin
or the folder for 64bit version
Select javaws.exe and click the Open button. This will open the JNLP file as intended.
Make sure to check the Always use this app to open .jnlp files.
That's all.

Java Jnlp CodeSigner Error

I am trying to run a java jnlp application from my computer. Every time I try launch the file I get the error java.lang.NoClassDefFoundError: java/security/CodeSigner
From searching Google it seems to be a common enough problem and is normally blamed on 'java 6'. I couldn't find a solution that doesn't involve rolling back to an older java version.
Does anyone know how fix this without reverting versions?
Looks like SUN JRE 1.6.0_14 was the last SUN JVM without that nasty bug... I'd install that version in parallel and use it more or less exclusively for jnlp applications, that still request Java 1.4. (guess you can't change the jnlp application so that it request a higher Java version)

Categories