java.lang.NoSuchMethodError: java.lang.NoSuchMethodError - java

Running Tomcat 7 through eclipse
The error reported is:
javax.servlet.ServletException: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;
at org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:341)
I have tried both jasper-jdt-6.0.13.jar and tomcat-6.0.16-jasper-jdt.jar and both report the same error. In a way I shouldn't be surprised because I ran:
jar tf tomcat-6.0.16-jasper-jdt.jar
and it doesn't have the class org.eclipse.jdt.internal.compiler.CompilationResult in it. But this site http://www.java2s.com/Code/Jar/STUVWXYZ/Downloadtomcat6016jasperjdtjar.htm says it does!!
Can someone tell me what the correct jar file is and where to get it from?
It seems to be a recurring theme. http://www.findjar.com lists a number of jars that purport to have this class - but do not.
OK, Found it in jasper-compiler-jdt-5.5.23.jar

Found it in jasper-compiler-jdt-5.5.23.jar

Related

NullPointerException when running Crystal reports with SP24 for Eclipse

We are trying to upgrade to SP24 of Crystal Report for Eclipse but have found that several of our reports are failing with a NullPointerException when generating the report. I've included the stack trace below - does anyone have any idea what may be wrong or have any workarounds, please?
Changing Main Report Table Connection Info
Changing Sub Report Table Connection Info
Setting Parameters of Main Reports
Starting Verify database
Completed Verify database
Setting Parameters of Sub Reports
com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:238)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:148)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:129)
at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:112)
at us.nm.state.hsd.aspen.business.batch.rp.crystal.RpJRCExportReport.runReportExport(RpJRCExportReport.java:742)
at us.nm.state.hsd.aspen.business.batch.rp.crystal.RpScheduleReportRun.process(RpScheduleReportRun.java:177)
at us.nm.state.hsd.aspen.business.batch.rp.crystal.RpScheduleReportRun.drive(RpScheduleReportRun.java:263)
at us.nm.state.hsd.aspen.business.batch.rp.crystal.RpScheduleReportRun.main(RpScheduleReportRun.java:286)
Caused by: java.lang.NullPointerException
at com.crystaldecisions.reports.formatter.formatter.objectformatter.d.a(SourceFile:154)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:332)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.ObjectFormatter.a(SourceFile:250)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.a(SourceFile:922)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.e(SourceFile:784)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.f.e(SourceFile:383)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.u.for(SourceFile:242)
at com.crystaldecisions.reports.formatter.formatter.objectformatter.aa.a(SourceFile:64)
...
Just in case someone else is running into the same problem here.
Problem is: Newer JDK versions are not shipped with a lib/fonts folder which the Crystal Report engine expects.
A somewhat unsatisfying, but working solution is:
Create a fonts folder -> %JAVA_HOME%/lib/fonts
Copy fonts from 'Windows\Fonts' into %JAVA_HOME%/lib/fonts.
Problem should be solved then.
I have got the same issue, copying the jre/lib/fonts folder from Java8 to Java 11
-jdk/lib/fonts solved the issue.

Bundle exception

I am doing some maintenance to a JAVA backend written using bundles. When running the code after doing some software upgrade, I get that error at first:
! java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService (Ljava/lang/Class;Lorg/osgi/framework/ServiceFactory;Ljava/util/Dictionary;) Lorg/osgi/framework/ServiceRegistration;
When running it a second time, it gives me the following error:
! java.lang.NoClassDefFoundError: Could not initialize class com.sap.hilo.orchestration.workspace.HiloWorkspaceFactory
Then, it keeps showing the second error for any extra code runs. Any clues how resolve this issue?
Regarding:
java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService
I found an answer to a similar question here: OSGi: servicereference.getBundle().getVersion() - No such method error
In the Import-Package section of the pom.xml file you'll need to change the org.osgi.framework version to at least 1.6 or give it a range [1.6,2.0)

Java webapp produces StackOverflow exception on Linux

I have a Java-web application running on Tomcat 9. It works fine on a Windowns machine. But after deploying this app on a Debian Linux server I've encountered java.lang.StackOverflow exceptions on some particular pages. Here is the beginning of the stacktrace log:
27-Dec-2017 08:54:43.746 SEVERE [https-jsse-nio-9443-exec-3]
org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for
servlet [jsp] threw exception
java.lang.StackOverflowError
at java.io.UnixFileSystem.canonicalize0(Native Method)
at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:172)
at java.io.File.getCanonicalPath(File.java:618)
at org.apache.catalina.webresources.AbstractFileResourceSet.file(AbstractFileResourceSet.java:90)
Please, see full stacktrace here:
https://pastebin.com/0AmFDY8F
As far as I understand, the exception occurs while compiling the JSP page source by Jasper and it's somehow related to the resolving of Linux paths / directories. Could anybody please help me to figure out what the exact problem is? I didn't create any symbolic links, if the problem can be related to this.
According to your stack trace, the problem is caused by not being able to find a specific path as resolved by your Spring framework:
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
...
Caused by: java.io.IOException: JSPException including path '/struct/context/tutorials.jsp'.
The Spring framework is likely using the canonical paths to resolve the file, and it fails perhaps because there is some quirk in the framework related to the type of Unix system you are deploying to.
Please reference this in the Spring documentation:
https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html#deployment-install-supported-operating-systems
The default script supports most Linux distributions and is tested on CentOS and Ubuntu. Other platforms, such as OS X and FreeBSD, will require the use of a custom embeddedLaunchScript.
Notice that Debian was not listed. Hopefully this puts you on the right path.
If I'm chasing a red herring here, I'm sorry - but you haven't given us much to go on.
Finally I've found what caused the StackOverflow exception. I have a recursive JSP tag call to render nested options for a <select> tag. After removing the recursion, the exception disappeared. Sure, it's just a workaround, so I'm still wondering why it works fine on Windows and doesn't on Linux.

Java Exception has occurred when opening .JAR file

I am trying to run a jar file that came with a program designed by BOSCH called EsiTronic. I receive the following error message "A java exception has occurred" I made some research and looked in the other threds of this forum but it did not help me. My gues is that the version I am using is not supporting the version the program was compiled on. I tried running it from CMD to see the detailed error message. If someone can tell me more from this message I will apreciate. I want to point out I am not a programer so my knoledge is limited here.
Thanks!
Exception in thread "main" java.lang.ClassFormatError: Truncated class file
Exception in thread "main" java.lang.ClassFormatError: Truncated class file
Theres nothing much that you can do here except re-download the jar file. The jar file probably got curropted during download or even at the time of packaging from the source

UnsatisfiedLinkError and NoClassDefFoundError : Running Java Mapscript on Ubuntu 11.10

We have coded and run a dynamic web application using MAPSERVER(Version 6.0.1) on windows platform using Java Technology. Now, there is need of deploying it on Ubuntu 11.10. We have installed Apache Tomcat 6.0, Mapserver 6.0.1, Apache 2.0, and FWTools-2.0.1(As this package contain all required tools for mapserver if I am not wrong, so I didn't feel any other tools to be installed). We have deployed the war file(and put application without) in Apache Tomcat 's Webapps folder. I even got the index page which dont have code related with mapscript api. But while fetching the other servlet with mapscript we are getting following error...
java.lang.UnsatisfiedLinkError: no mapscript in java.library.path
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
java.lang.Runtime.loadLibrary0(Runtime.java:840)
java.lang.System.loadLibrary(System.java:1047)
edu.umn.gis.mapscript.mapscriptJNI.<clinit>(mapscriptJNI.java:23)
edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:283)
Again while refreshing the browser page where the above error was displayed, I got a change,
java.lang.NoClassDefFoundError: Could not initialize class
edu.umn.gis.mapscript.mapscriptJNI
edu.umn.gis.mapscript.mapObj.<init>(mapObj.java:283)
I searched on net about the above problem. But finally blank. Please, provide idea about the above problem.
I'm not going to explain why you're getting the UnsatisfiedLinkError, but instead I'll explain why you are getting the NoClassDefFoundError when you reload the page.
A NoClassDefFoundError with a message Could not initialize class ... is thrown by the JVM when it attempts to initialize a class that it has already tried and failed to initialize.
The first of your two stacktraces contains the line
edu.umn.gis.mapscript.mapscriptJNI.<clinit>(mapscriptJNI.java:23)
The method name <clinit> denotes the static initializer, of the class mapscriptJNI. So, at the point that the UnsatisfiedLinkError was thrown, the JVM was trying to initialize this class. Looking at the error message, it seems that this static initializer tried to load the native code library mapscript but failed.
This UnsatisfiedLinkError causes the mapscriptJNI class to fail to initialize successfully. The JVM keeps a record of all classes that fail to initialize, and if you attempt to initialize one of those classes again, you'll get a NoClassDefFoundError with a message saying that it could not initialize that class.
When you refresh the page, you end up causing the JVM to attempt to initialize the class mapscriptJNI a second time. Of course, this class failed to initialize the previous time. Your second stacktrace contains exactly the error I've described.
In short, the UnsatisfiedLinkError is the real error here. Fix that and the other one will go away.
I would check the following 2 items:
Is the mapscript.jar file on Tomcat or at least your webapp's classpath? (NoClassDefFoundError is your big clue here)
Is the libmapscript.so on either your LD_LIBRARY_PATH or -Djava.library.path? (UnsatisfiedLinkError since the shared object cannot be found)
Try having a look at this post, near the Running Java Mapscript (on Linux) section.
Hope that helps!

Categories