student getting an exception from Play initialization - java

I created a Play app for students to use in an assignment for my user interface course. They don't need to modify it, just access it via AJAX. I used "activator dist" to package it up in a JAR file; they download it to their computers, unzip it, and run it locally.
It has worked well for everyone except one student. I'm at my wit's end for debugging and am appealing to the community for ideas.
The exception is:
Exception in thread "main" java.lang.NoSuchMethodError: ch.qos.logback.classic.LoggerContext.getFrameworkPackages()Ljava/util/List;
at play.api.Logger$.configure(Logger.scala:268)
at play.api.Logger$.configure(Logger.scala:232)
at play.api.inject.guice.GuiceApplicationBuilder.applicationModule(GuiceApplicationBuilder.scala:73)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
Things we've checked:
He's running Java 1.8.0_45. It was compiled with Java 1.8.0_66. He has reinstalled Java (which I'm assuming is 1.8.0_66 or greater). No change.
The md5 checksum of the download jar file matches the original.
lib/ch.qos.logback.logback-classic-1.1.3.jar exists and has the same size on his machine as on mine.
We've installed scala/Play/Activator on his machine, copied over the sources and tried compiling from scratch on his machine. Same error.
I've looked in the script prepared by "activator dist". I believe it's calling the same version of java as what we see from the command line. That is, I don't think we're being confused by two copies of the java runtime.
This is on a MacBook Pro (pre-Retina) with El Capitan.
Ideas?

Related

Problem while running a Jar file in ubuntu

I am not very familiar with the Ubuntu. I have moved a jar file relatd to Blazegraph which I used on my Windows machine to my Ubuntu VM (Ubuntu 18.04 LTS Bionic).
I have also used chmod +x filename to make it executable. But when running the file, I get the following error:
ERROR: Banner.java:160: Uncaught exception in thread
java.lang.NullPointerException at
com.bigdata.rdf.sail.webapp.StandaloneNanoSparqlServer.main(StandaloneNanoSparqlServer.java:142)
Why do I get this message? I also found this thread on GitHub, but seems no one had a chance in fixing it!
Note: The file is blazegraph.jar which acts as a local server for the blazegraph so I can run SPARQL queries on some ontologies. Is this because the file is trying to act as a server and possibly firewall issues? However, the server will be at http://localhost:9999/blazegraph/ which I think shouldn't have to do anything with the firewall (if there is any on Linux).
Seems this is a bug with the Blazegraph.
See these links to read more about the problem: [1] [2].
PS: There have been some ways for getting rid of the problem but they did not work for me or I could't make them work. I initially wanted to remove this question but thought maybe others have the same problem.

How do I uninstall a corrupt copy of Java's Assistive Technology - AccessBridge from a Windows 10 PC

My company sells a Java app that mysteriously stopped working for one of our customers. It had been working, but now won't start. The error he gets when trying to start the app is: "java.awt.AWTError: Assistive Technology not found...". I've researched the issue and I think it's caused by some other java app which incorrectly installed “java se accessbridge” and ended up corrupting all java apps on his PC. See:
https://www.avnirvana.com/threads/java-install-error-any-ideas-on-the-fix.2178/
Exception in thread "main" java.awt.AWTError: Assistive Technology not found: com.sun.java.accessibility.AccessBridge error
https://docs.oracle.com/javase/accessbridge/2.0.2/setup.htm#uninstalling-jab
I've had the customer uninstall our app, uninstall all copies of Java on his PC, and delete all copies of WindowsAccessBridge.dll found in ‘%WINDOWSHOME%\SYSWOW64’ and ‘%WINDOWSHOME%\SYSTEM32’. Now, he gets the same error from Install4j when trying to re-install our app. I have not asked him to try to re-install Assistive Technology-AccessBridge since our app does not require it and the installation appears convoluted and requires a number of manual steps.
There does appear to be a workaround. According to this article:
https://deciphertools.com/blog/2016-05-09-assistive-technology-not-found/
you can keep the jre from loading AccessBridge by adding:
-Djavax.accessibility.assistive_technologies
-Djavax.accessibility.screen_magnifier_present=false
To the app's vmoptions file. I would have him add this to our vmoptions file, but he can't get the installer to run since it gets the same error.
My question is twofold:
What other things can I have the customer do to remove Assistive Technology-AccessBridge?
Failing that, how can I modify install4j's vmoptions file so he can install our app and modify its vmoptions file?
The installer does not read a .vmoptions file for security reasons. You can pass VM parameters on the command line like this:
installer.exe -J-Djavax.accessibility.assistive_technologies -J-Djavax.accessibility.screen_magnifier_present=false

Launch4J generated exe gets "a Java exception has occurred"

We've recently made some structural changes to our large application. It's been being built and launched with Launch4J for a long time. We're using a 1.7 JVM installed in our app directory.
With our latest changes, the Launch4J generated .exe no longer works.
When we run it, it immediately pops up with a error dialog:
Title:Java Virtual Machine Launcher
Message: A Java Exception has occurred.
As far as I can tell, our app never even starts.
the Launch4J log file starts like this:
Version: 3.6
CmdLine: C:\Program Files\EFI\Metrix\Metrix.exe --l4j-debug-all
WOW64: yes
Resource 101: An error occurred while starting the application.
Resource 8: .
Working dir: C:\Program Files\EFI\Metrix\.
...
That "Resource 101:" line is the only info I have.
How can I find out exactly what the error was?
Ok, finally tracked this down. Due to a bad merge, one of our .jar files got left out of the classpath, so the app was getting a classnotfoundexception during startup.
Seems like this is in the kind of error that Launch4J should report in a useful way.

Why does Play Framework 2.3.8 Deployment not work?

I have written a program with the play framework 2.3.8 named quizSystem.
It is using a memory database, some controller, viewclasses etc.
Now I want to run my program on another machine (windows 7 with JDK 8u45 installed and the PATH set to the JDK), therefore I ran activator dist on machine 1 and got a .zip-File with a snapshot of my program. I copied this zip file to machine 2, extracted it and used the console to go to the /bin folder. In there are 2 files quizSystem and quizSystem.bat.
So I typed quizSystem
Error: Oops, cannot start the server ... Database 'default' needs evolution
So I tried this: quizSystem -DapplyEvolutions=true
Error: Bad application path: -DapplyEvolutions=true
So then I added the line applyEvolutions=true into the application.conf file.
But still, no matter which command I use I can start the program.
I have searched and tried many solutions like here: Play Framework 2.1.1 Deployment Issues
Why is the evolution / my program not working?
Found the solution:
There seems to be an (open?) bug in the play framework at the moment:
https://github.com/playframework/playframework/issues/3081
If I understand correctly the order of the input parameters for java is the wrong way around in the play framework. Thats the reason that manual input in the console produces an error...
So here is the complete list of steps in order to produce a working program for deployment:
1) In your directory type activator dist into console
2) You get a zip file in the /target/universal directory (something that contains the word SNAPSHOT or similar
3) On your target machine you need an installed JDK, goto here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
4) Extract your zip-file, in the /bin-folder edit the .bat file
5) search for set "APP_MAIN_CLASS=play.core.server.NettyServer" and change to
set "APP_MAIN_CLASS= -DapplyEvolutions.default=true play.core.server.NettyServer"
6) Then simply use the console to navigate to the folder and type the name of your program
I hope this spares somebody else several hours of frustration, despair
and lots of shouting and cursing :D

how to handle issue regarding Missing "server" JVM at "C:\Program Files\Java\jre7\bin\server\jvm.dll"

I've seen some answers to this question but it doesn't seem to be working for me. I have "client" folder inside "bin" which has such a file (in Program Files x86) but when I set my JAVA_HOME variable to this java folder, it shows this error whenever I try to start the service (I'm trying to run Atlassian Fisheye as service). I tried copying the contents of the "client" folder and create a "server" folder but then the error is changed
Error occurred during initialization of VM,
Could not reserve enough space for object heap,
Could not create the Java Virtual Machine,
A fatal exception has occurred. Program will exit.
if I install 64 bit version of Java as well, there I have this "server" folder, I tried copying that folder but still no use. if I change my JAVA_HOME path to that 64 bit java folder, the service is started successfully, (or so it seems) but I can't access Fisheye and there's a warning:
WARNING - Unable to load the Wrapper's native library 'wrapper.dll'. The file is located on the path at the following location but could not be loaded: C:\installs\service\fisheye28\wrapper\lib\wrapper.dll. Please verify that the file is readable by the current user and that the file has not been corrupted in any way. System signals will not be handled correctly.
according to this guide here, it happens if we use 64 bit java, and we have to use 32 bit even if it's a 64 bit machine. so, I'm stuck in between these issues. the "server" error is gone if I use 64 bit version but then this warning is there and I can't access Fisheye. if I use 32 bit, the "server: folder is not found, and even if i copy the files and create a folder, the service still doesn't run.
I know the question is already quite old. But I will try to explain what worked for me:
I tried copying the contents of the "client" folder and create a
"server" folder but then the error is changed
That trick was voted as useful by many users in a similar question. However you can not use a Java Client as a Java Server.
In this answer (https://stackoverflow.com/a/198651/7597328) you can see the reason. Basically:
The Server VM has been specially tuned to maximize peak operating
speed.
The Server VM contains an advanced adaptive compiler that supports
many of the same types of optimizations performed by optimizing C++
compilers, as well as some optimizations that cannot be done by
traditional compilers.
The solution I found was to download a Java Server from:
http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html
Then I added the server folder to ...\Java\jre7\bin\
AFAIK JAVA_HOME should point to the installation-directory of the jre, not to the folder containing the jvm.dll.
So try setting JAVA_HOME to the parent-directory of the bin-folder...

Categories