Java Jnlp CodeSigner Error - java

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)

Related

Server App Engine Standard at localhost failed to start

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

how publish java webapp on vps server, i tried by it doesn't work

I want deploy java webapp on vps server with ubuntu. I installed jdk, jre and tomcat, but when i try to see tomcat standard welcome page it returns error: org.apache.jasper.JasperException: Unable to compile class for JSP. Here is the link to my server: http://something.nazwa.pl:8080.
How can i repair this error and how properly prepare vps to java application?
I had never been using Linux,so it is difficult to me.
Ok. Try to set the JDK 8 of oracle or OpenJDK 8. Becasue from the Site of Apache Tomcat
Building Apache Tomcat requires a JDK (version 8) to be installed. You
can download one from
And you jave OpenJDK 9
And remember
IMPORTANT: Set an environment variable JAVA_HOME to the pathname of
the directory into which you installed the JDK release.
--- Edit ---
Ok going more deeper I found that tomcat 9 can run in Open JDK 9, but it might contains bugs
For example, users were successfully running Tomcat 8 on Java 8 many
months before the first stable Java 8 release. However, users of early
access builds should be aware of the following:
It is not unusual for the initial early access builds to contain bugs
that can cause problems for web applications running on Tomcat. If the
new Java version introduces new language features then the default JSP
compiler may not support them immediately. Switching the JSP compiler
to javac may enable these new language features to be used in JSPs. If
you do discover an problem using a Java early access build, please ask
for help. The Tomcat user's mailing list is probably the best place to
start.
From Apache Tomcat.
Conclusion
Try to go with JDK 8 of oracle and set your enviorement variable

Trouble with Browser type SWT.MOZILLA on windows 8 64 bit

after spending a day reading here and there I decided to ask help as I could not find a solution to my problem.
I have to create a java/swt application embedding a browser with full HTML5 support. That works out of the box on both linux and osx with SWT.NONE browser type (using webkit).
Unfortunatelly I have lot of troubles on windows.
First let me say that I'm using SWT 4.2.x on windows 8 64 bit.
To make SWT browser work with webkit I had to install 32bit JVM and manually point to it (as the -d32 switch on default 64bit JVM says that no 32 bit JVM is installed). ALso installed Safari.
And also I had to use 32bit SWT library. WHen finally I got it run I discovered that Safari for windows does not support drag and drop as experienced and stated here:
http://www.w3schools.com/html/html5_draganddrop.asp
So I decided to switch to mozilla. According to Eclipse/SWT documentation I have downloaded and installed XULRunner 1.8.0.1. I have unzipped it into C:\Program Files (x86)\Mozilla\XULRunner\1.8.0.1\xulrunner and run xulrunner --register-user (and also --register-global)
Finally in my code I added
System.setProperty("org.eclipse.swt.browser.DefaultType", "mozilla");
I have also set a global environment variable "MOZILLA_FIVE_HOME" pointing to the same XULRunner installation dir.
But then, when I run my java program (32bit JRE, 32bit SWT) I get
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME may not point at an embeddable GRE]
How can I fix that?
Thanks in advance!
EDIT:
I was running command prompt not as administrator and xulrunner was not registering. Doing as administrator, worked. However I'm still in trouble: XULRunner 1.9.x seems not to support HTML5. For example element.children is not supported.
I managed installing XULRunner 10.0.2 that seems to have the required support. However as soon as I click into my embedded browser, the application just crashes without printing any error on java output console...
I need to find a solution in order to use either ecent version of mozilla or recent version of webkit on windows
Ok, loading XURLRunner 10.0.2 works. The crashing app was due to a stack overflow error in my js code.
I too am trying to embed XULRunner into my eclipse plug-in, with no luck (currently). I came across your answer here. Just wanted to comment that it is not reasonable that you executed
xulrunner --register-user
nor
xulrunner --register-global
on the XULRunner 10.X since according to this post
https://stackoverflow.com/a/7567781/1743693
the support on installing the XULRunner system-wide was removed (which was a good step IMHO)
Trying to execute the aforementioned commands will result
"Error: couldn't parse application.ini"
As for my problem: I keep running into the runtime error:
Can't load library:
C:\Users\david\.swt\lib\win32\x86_64\swt-xulrunner-win32-4236.dll
C:\Users\david\.swt\lib\win32\x86_64\swt-xulrunner-win32.dll: Can't
load IA 32-bit .dll on a AMD 64-bit platform
And I can't figure out where this is coming from.
I'm running a VirtualBox with Windows 8 64bit
If you can elaborate more on what solved your issue with that - i would really appreciate that.
Thanks.

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.

Categories