Random NoClassDefFound error in Web Application - java

Wondering if any guru out there could shed an idea on why the following randomly happens.
We have a web application we deploy in Jetty 6.1.26 running on a Linux installation with JRE 1.7_03
Not every time, but every now and then, when Jetty starts up - what appears to be a random class (from our project) seems to be the source of a NoClassDefFound error. If we restart Jetty they problem disappears.
The only pattern that occurs seems to be the classes at the root of the error are populated via JAXB annotations.
To give more of an idea of the frequency it feels this happens 1/50 times, if that.
I would be interested to know the how and the why for this error.

Not sure this can help but we ran into annotations problems with Jetty 8 and java 6.
To make a long story short, annotations processing in that version seem to rely on libasm e.g. bytecode inspection. So we have to be careful with
what we compile our classes with (e.g; JDK version, etc...)
that we do not pull multiple asm/javassist librairies through our dependencies and end up loading the wrong one
I am not familiar with with the way Jetty 6 and Jaxb process annotations but I am actually surprised you can get both running on Java 7. Can you try running you code with Java 6 ?

Related

Eclipselink jaxb-compiler .cmd not working (java.lang.ClassNotFoundException: jakarta.activation.MimeTypeParseException error)

For the app i'm developing is essential that i can generate java classes from xsd.
I'm using eclipselink so jakarta libs and it used to work but after some changing to java path it does not work anymore and i can't go back.
When i run directly the jaxb-compiler file it returns Java major version 19 path not found, so I tried to replicate the command
(that is java -Xmx256m -Djakarta.xml.bind.JAXBContextFactory=org.eclipse.persistence.jaxb.JAXBContextFactory -cp "..\jlib\moxy\jakarta.json.jar";"..\jlib\moxy\jaxb-core.jar";"..\jlib\moxy\jaxb-xjc.jar";"\jlib\moxy\jakarta.activation.jar";"..\jlib\moxy\jakarta.validation-api.jar";"..\jlib\eclipselink.jar";"..\jlib\moxy\jakarta.xml.bind-api.jar" org.eclipse.persistence.jaxb.xjc.MOXyXJC "C:\Users\franc\Desktop\schemas\Compendium version VI")
in the prompt and found that the error is
"java.lang.ClassNotFoundException: jakarta.activation.MimeTypeParseException"
and "java.lang.NoClassDefFoundError: jakarta/activation/MimeTypeParseException".
I tried to change jdk version to 17.5 but that doesn't work either, i don't know what to do and can't go forward without the classes (that could change in time so i must be able to generate them whenever I want). I have installed the jaxb tool for eclipse but that works just for a file at the time, if you know how to convert an entire directory of xsd that would help too. Help me pleasee

Java dynamic web project error on startup

migrating from C++ to java so starting today wanted to follow some tutorials but, when I create new dynamic web project, get error straight away in web.xml file. I installed java 11 se and downloaded java 8ee but not linked anywhere yet, also installed and linked tomcat 10.
ERRORS
Could anyone know problem here?
Thank you in advance
SOLVED:
To get rid of first 5 errors change Java version to the installed on machine
To get rid of xml error, change xmlns="http://java.sun.com/xml/ns/j2ee to
xmlns="http://Java.sun.com/xml/ns/j2ee make Java upper case

I just installed eclipse, why won't eclipse run any of my code?

I cannot get eclipse to run any code whatsoever. I have just begun using eclipse and think I may not have installed the jre/jdk properly because I have tried running different code and always get the same error. This is the error message I got as soon as I opened the workbench and tried to run something the first time:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module tutorial1 not found
Everything appears to be there in my file system, but then again I have never done a successful build so I'm not entirely sure how it should look. I'm just getting started learning java development and this is rather discouraging. Why won't eclipse run any code? Are there other steps I should have taken before installing eclipse?
I have tried running different code and always get the same boot layer message. I have also tried installing multiple versions of the jre, jdk, and eclipse and it still doesn't work.

Groovy, Grails & Eclipse/STS - Bad Version Number

I have a clean, vanilla system (Mac OS 1.5) with Java 6 installed - I have also installed the latest version of Grails (2.0.0.RC3) and STS (2.8.1), together with appropriate extensions:
Grails Support
Groovy 1.8 Compiler
Within STS I have navigated to Peferences -> Groovy -> Compiler and changed it to use version 1.8 compiler (rather than 1.7).
I have then created a blank Grails project from the command-line (using "grails create-app", etc) and everything works fine - I can compile/test/run it.
However, when I access the problem via STS/Eclipse I get a Bad version number being reported on conf/ApplicationResources.groovy; nevertheless, the project still works - I can still compile and run from within STS, but the auto-build feature keeps kicking in and reporting the same compilation problem on this file...
Can anyone shed any light on why this might be and how to solve it?
I have done various clean operations, such as "grails clean" and removed the ~/.grails and ~/.groovy directories in case of a stale class file, but it's made no difference so far...
Any help much appreciated!
It seems my answer to Eclipse problems (not specific to STS) was usually do clean install. You likely have already heard this and perhaps I should not post as an 'answer' (I'm new to stackoverflow) but my team uses IntelliJ IDEA across the board. Some start with STS for familiarity but eventually that gets overridden by IntelliJ's Grails support. It is worth giving it a try over Christmas break. You can try the Ultimate edition (has Grails support) for free for at least 30 days and if you like, you can probably get an extension (I did for several months until my boss stepped up).
Removed comment as issue returned

Hot deploy not longer working on JBoss ("Scheme change not implemented")

I've got a pretty annoying problem with my JBoss AS 4.2.3 GA.
Until recently everything was running fine, but now the hot deploy feature is now longer working. And -- as always -- I don't know what I did to cause this behaviour.
My projects are built with Maven. I've cleaned every target directory, installed the projects and then deployed them to the server. So the sources in Eclipse and the deployed projects on the server should be identical.
Inside a method I've added a simple System.out.println("test"); statement and -- BANG! -- I get the following error:
(source: imagefruity.com)
Do you know a way out of my trouble?
Ok, I did the following things now:
Uninstall all JDKs
Install only one JDK, namely JDK5 (cause that's the one we use in production)
Clean, install and deploy every project anew
And now it seems to work (I'm keeping my fingers crossed).
I've used JDK 6 Update 20 for building in Eclipse and JDK 6 Update 7 in Maven. Maybe that has caused the problem.
In my case "Hot code replace failed - Scheme change not implemented" was caused by IDE using another compiler than compiler used to build files deployed on J2EE server. You can binary compare class files in your J2EE archive with class files compiled by IDE in your workspace - they should be identical.
For details please check here.

Categories

Resources