Tomcat ServeletException NoClassDefFoundError - exception

I have a webapp I'll call "App1" I am using to create some webplots. I have the .jar files in webapps/App1/lib/ and when I visit the server, I find that I am able to launch some webapps, but others I get funny exceptions. One, being
java.lang.NoClassDefFoundError: Could not initialize class com.jrefinery.chart.JFreeChartConstants
Then, when I add the jfreechart jar to the classpath, I get a different error:
java.lang.NoClassDefFoundError: com/jrefinery/util/ObjectUtils
tomcat version: 7.0.19
OS: ubuntu 12.04
I've tried it on a windows installation and it seems to work just fine. So I'm guessing it's a classpath error? I've tried adding the jfreechart-*.jar to the catalina classpath but it doesn't seem to fix anything. I've also tried to copy the webapp/App1/lib/ jar files to the top level/lib folder and this doesn't fix anything either.
Any ideas here?
Thanks.

You are missing the correct jar file in your project.
The jfreechart project has been repackaged. If you include the old jfreechart-0.9.3.jar, it will fix your compiler errors.
jfreechart-0.9.3.jar
download : http://mirrors.ibiblio.org/pub/mirrors/maven2/jfreechart/jfreechart/0.9.3/jfreechart-0.9.3.jar

Related

Visual studio project.json does not have a runtime section

I ran into a error in visual studio 2017, I'm searching over the net but I don't find anything usefull, so my question is, how can I solve this:
Severity Code Description Project File Line Suppression State
Error Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore.
I was seaching for file where is located in my project but with no succsess.
Thanks
I got rid of this problem by manually deleting Visual Studio obj folder of the project that it's complaining about (the 'Clean Solution' command wasn't getting rid of it).
I found the answer through this and this threads.
I had the same issue after trying to migrate all my projects to the new .csproj format manually. I had an issue with one projet in the new format, so I reverted from git, and this message started to show up.
What I did:
Closed VS
Removed the .vs folder
Removed the packages folder
Restarted VS
Tried to build
Had issues with namespaces not found, as if packages were not installed
Opened NuGet package manager console
Ran Update-Package -reinstall -ProjectName <project>
Problem gone!
Hope it helps someone with the same issue :)
I upgraded a NuGet Package.
Then I undid some changes for the project, but the NuGet Packege had created a json file called project inside the project folder.
Inside this file, I could find runtimes.
But I just deleted this json file and built again.

class <cucumber> cannot be resolved to a type - also not able to import cucumber.junit.api.Cucumber

Attached screenshot shows the project setup and jars included. Can somebody please help me what is that I would have done wrong.
Cucumber class is present in cucumber-junit-1.2.5.jar file.
Try to use this dependency: https://mvnrepository.com/artifact/info.cukes/cucumber-junit/1.2.5 in maven.
I tried many ways to resolve this issue, finally I downloaded
this jar file cucumber-junit-1.2.5.jar and then I highlighted my project, then
clicked on Project > Properties> Java Build Path> Libraries>
Maven Dependencies > Add External Jar file .....and opened my downloaded file and
added it to Maven dependencies and error disappeared.

An internal error occurred during: "Enable SonarLint on all projects". Unable to add builder

When starting Eclipse in a workspace, SonarLint plugin reports the following error:
An internal error occurred during: "Enable SonarLint on all projects".
Unable to add builder
After confirming the errmsg, both Eclipse and SonarLint plugin work properly.
Nevertheless, the message is misleading. What causes it? In my workspace, some projects are open and some not.
For me issue was coming due to lombok jar so Need to upgrade LOMBOK version to 1.18.12 in sts and in pom.xml both and it got resolved.
In my case it was caused by one of my project being read-only.
For some reason, SonarLint defines a global Eclipse job, to add itself to every project that is open. If the process fails, you get that annoying message.
As a workaround I've removed a read-only flag from the .project files.
Yes, you just need to update the latest Lombok jar in either STS or eclipse, this will resolve the issue for me. And you need a sonar lint plugin for the eclipse for sure.
The attached screenshot is coming in my case, but after updating the Lombok jar it is gone.
I upgraded to Latest lomlok version and it got solved.
I replace the old lomlok file with latest version from https://projectlombok.org/download.
I am using lombok 1.18.4 and eclipse = eclipse-java-12-R-win32-x86-64.
Project is compiled and able to run the project but in eclipse whenever i am opening any java file facing issue :
An internal error occurred during: "SonarLint processing file lombok/launch/PatchFixesHider$ValPortal /server/com/EmployeeList.java".
lombok/launch/PatchFixesHider$ValPortal
Sonar lint issue
This propblem was resolved with next version of LOMBOK.
Upgread to 1.12 or higher version and rebuild pom.xlm
I was upgread to 1.20 and problem dispaired ;)

How to properly add Firebase jar file to libgdx HTML5?

Firebase jar file works for both iOS and Android. But when I try to deploy the web version, it gives me an error:
[ERROR] Line 18: No source code is available for type com.firebase.client.Firebase; did you forget to inherit a required module?
I tried to add the dependencies in the module settings to the HTML project.
But it still gives me this error.
Does anyone know how to solve this? Any advice would be appreciated.

How does JRuby resolve gem paths in a jar file?

I've packaged a custom gem into a jar file which is being referenced by a JRuby script.
I'm getting the following error:
org.jruby.rack.RackInitializationException: JAR entry gems/sinatra-linkedin-auth-0.0.1-java/lib/sinatra/linkedin-auth.rb not found in /Users/bhaidri/code/nextgen-ui/dist/darwin-war/exploded-war/WEB-INF/lib/linkedin-gems-0.0.1.jar
When I inspect my jar file, the linkedin-auth.rb script is indeed there in the correct location. Why is it not being correctly loaded?
Thanks,
Baq
If anybody runs into this situation, please try restarting Tomcat. That resolved the problem for me.