Java 11: selma mapper: java.lang.NullPointerException on interface #Mapper - java

I just migrated to Java 11 (OpenJDK) from Java 1.8 and use STS 4.17.0 version and maven 3.8.6
There is compile error on the #Mapper interface as below:-
Error while searching builder for field description on InOutType{in=com.dto.CustomerBillVBODTO, out=com.dto.customerbillrest.model.CustomerBillVBO, outPutAsParam=false} mapper: java.lang.NullPointerException: Cannot invoke "javax.lang.model.element.PackageElement.getSimpleName()" because "java lang" is null.
I can run but because of an error Selma mapper didn't work and did not map fields
I tried to use STS version depending on Eclipse 4.16.0 and maven 3.6.3 but still didn't work.

Related

Adding mockito-inline dependecy in pom.xml causing Mockmaker issue [duplicate]

java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration#4158debd
Caused by: java.lang.reflect.InvocationTargetException
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker.
It appears as if your JDK does not supply a working agent attachment mechanism.
Java : 16
JVM vendor name : Oracle Corporation
JVM vendor version : 16.0.2+7-67
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 16.0.2+7-67
JVM info : mixed mode, sharing
OS name : Mac OS X
OS version : 11.5
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
Getting the above error on Maven 3.8.1 and JDK16.02 with Mockito 3.7.7, on a fresh setup and cannot figure out why. I have tried every Mockito version from 3.7 all the way to 3.11 to no avail.
These configurations however works on an older setup based on JDK15 on Windows 10 Pro.
Mockito core depends on a library called byte-buddy and this problem is mostly occurred when mockito doesn’t find a matching byte buddy jar version.
Find out the mockito core version your project is using. In eclipse, you can check in project build path by navigating to
Right click on project -> Properties -> Java build path -> Libraries tab
Search maven repository for that version of mockito core.
Look at the Compile Dependencies section. Note down the correct dependent version of byte-buddy and include in the project. If the jar is already included with some other version, override the version with this correct version.
Build the application and run the tests again. Your issue related to MockMaker must be solved by now.
In my case I was running with an old 1.8 JDK. As of this writing with the dependencies below, it has to be Java 11.
testImplementation(platform('org.junit:junit-bom:5.8.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.2.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.2.0'
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.8.2')

Eclipse - Invalid classpath container: 'TestNG' in project and JUnit failed

I'm using Eclipse 4.9, I tried to update new TestNG upgrade(7)
It failed so I rollback to previous version and now I have an issue
'Invalid classpath container: 'TestNG' in project
I can't fix it by
clean project (maven can't be execute due to NullpointerException below errors)
Reinstall TestNG
Remove and add TestNG library
I didn't find relevant answers for this issue
Error log:
java.lang.NullPointerException
at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:367)
at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:412)
at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:384)
at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:305)
at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processJavaElementChanged(JavaReflectionSynchronizer.java:117)
at org.eclipse.jem.workbench.utility.JavaModelListener.processDelta(JavaModelListener.java:116)
at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processDelta(JavaReflectionSynchronizer.java:343)
at org.eclipse.jem.workbench.utility.JavaModelListener.processChildren(JavaModelListener.java:78)
at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processChildren(JavaReflectionSynchronizer.java:336)
at org.eclipse.jem.workbench.utility.JavaModelListener.processJavaElementChanged(JavaModelListener.java:176)
at org.eclipse.jem.workbench.utility.JavaModelListener.processDelta(JavaModelListener.java:113)
at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processDelta(JavaReflectionSynchronizer.java:343)
at org.eclipse.jem.workbench.utility.JavaModelListener.elementChanged(JavaModelListener.java:63)
at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.elementChanged(JavaReflectionSynchronizer.java:265)
at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1738)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1726)
at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1559)
at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1535)
at org.eclipse.jdt.internal.core.DeltaProcessor.notifyAndFire(DeltaProcessor.java:2256)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2146)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:477)
at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:300)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:290)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:153)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:379)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
EDIT 1
Actually I failed to execute JUnit also
java.lang.NullPointerException
at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
avaRuntime.java:3037)
at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
avaRuntime.java:3049)
at org.eclipse.jdt.launching.JavaRuntime.gatherJavaLibraryPathEntries(Ja
vaRuntime.java:3000)
at org.eclipse.jdt.launching.JavaRuntime.computeJavaLibraryPath(JavaRunt
ime.java:2958)
at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
JavaLibraryPath(AbstractJavaLaunchConfigurationDelegate.java:1081)
at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
VMArguments(AbstractJavaLaunchConfigurationDelegate.java:598)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.colle
ctExecutionArguments(JUnitLaunchConfigurationDelegate.java:376)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVM
RunnerConfiguration(JUnitLaunchConfigurationDelegate.java:185)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launc
h(JUnitLaunchConfigurationDelegate.java:255)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
iguration.java:862)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
iguration.java:720)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlu
gin.java:1029)
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:
1243)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
java.lang.NullPointerException
at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
avaRuntime.java:3037)
at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
avaRuntime.java:3049)
at org.eclipse.jdt.launching.JavaRuntime.gatherJavaLibraryPathEntries(Ja
vaRuntime.java:3000)
at org.eclipse.jdt.launching.JavaRuntime.computeJavaLibraryPath(JavaRunt
ime.java:2958)
at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
JavaLibraryPath(AbstractJavaLaunchConfigurationDelegate.java:1081)
at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
VMArguments(AbstractJavaLaunchConfigurationDelegate.java:598)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.colle
ctExecutionArguments(JUnitLaunchConfigurationDelegate.java:376)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVM
RunnerConfiguration(JUnitLaunchConfigurationDelegate.java:185)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launc
h(JUnitLaunchConfigurationDelegate.java:255)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
iguration.java:862)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
iguration.java:720)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlu
gin.java:1029)
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:
1243)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
EDIT 2
Eclipse 4.10 doesn't support TestNG plugin to needed to downgrade to Eclipse Neon
TestNG is only available only for version till (4.9)2018-09 , you hv not made plug in for 2018-12.that's why it is not showing in marketplace
the recent release supports Eclipse Photon 2018-12:
https://github.com/cbeust/testng-eclipse/releases/tag/6.14.3.201902250526
please raise ticket on github if you still meet issue.
I had to manually (not using marketplace) TestNG version from http://beust.com/eclipse/
Notice there's warning about You are installing software that contains unsigned content

NoSuchMethodError: eclipse.core.runtime.ListenerList error in eclipse

I recently run into this problem when trying to run a application in Windows which was built in Linux. My jdk is 1.8. Can someone suggest me how to fix it
Below is the full log
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.core.runtime.ListenerList.iterator()Ljava/util/Iterator;
at org.eclipse.core.databinding.observable.ChangeManager.fireEvent(ChangeManager.java:116)
at org.eclipse.core.databinding.observable.value.AbstractObservableValue.fireValueChange(AbstractObservableValue.java:82)
at org.eclipse.core.databinding.observable.value.WritableValue.doSetValue(WritableValue.java:98)
at org.eclipse.core.databinding.observable.value.AbstractObservableValue.setValue(AbstractObservableValue.java:66)
at org.eclipse.jface.internal.databinding.viewers.ObservableCollectionContentProvider.setViewer(ObservableCollectionContentProvider.java:167)
at org.eclipse.jface.internal.databinding.viewers.ObservableCollectionContentProvider.inputChanged(ObservableCollectionContentProvider.java:160)
at org.eclipse.jface.databinding.viewers.ObservableListContentProvider$Impl.inputChanged(ObservableListContentProvider.java:58)
at org.eclipse.jface.databinding.viewers.ObservableListContentProvider.inputChanged(ObservableListContentProvider.java:184)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1696)
at com.fk.comprende.views.SituationAnalysisComposite.initDataBindings(SituationAnalysisComposite.java:1847)
at com.fk.comprende.views.SituationAnalysisComposite.<init>(SituationAnalysisComposite.java:1383)
at com.fk.ComprendeMapper.createContents(ComprendeMapper.java:362)
at com.fk.ComprendeMapper$1.run(ComprendeMapper.java:70)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at com.fk.ComprendeMapper.open(ComprendeMapper.java:67)
at com.fk.ComprendeMapper.main(ComprendeMapper.java:55)
The version of the org.eclipse.core.runtime plugin you are using is not compatible with the JFace databinding classes you are using.
Only the version of org.eclipse.core.runtime in Eclipse Neon (4.6) or later has the ListenerList class with the iterator method. Earlier versions of Eclipse have ListenerList but it does not have the iterator method which your code wants to use.

App with Spring and Hibernate does not compile on TeamCity with Java8 and Scala 2.11.8

after migration of my app to Scala 2.11.8 and Java8 and updating Spring and Hibernate to versions as Follow:
<spring.version>4.3.2.RELEASE</spring.version>
<spring.asm.version>3.1.4.RELEASE</spring.asm.version>
<spring.ws.version>2.3.0.RELEASE</spring.ws.version>
<spring.security.version>4.1.2.RELEASE</spring.security.version>
<spring.data.version>1.10.2.RELEASE</spring.data.version>
<hibernate.version>5.2.2.Final</hibernate.version>
<hibernate.validator.version>5.2.4.Final</hibernate.validator.version>
<hibernate.jpa.version>1.0.0.Final</hibernate.jpa.version>
Locally mvn clean install -U works completely fine. If I run the build on TeamCity I get error as follow:
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: org/hibernate/jdbc/ReturningWork : Unsupported major.minor version 52.0
[17:03:33][Step 3/3] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project app-jpa: Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile failed.
I try to compile it with java-8-openjdk-amd64/
Any ideas how to solve this?
Best
in my case I upgraded my JRE to the latest version, because the compiling version wasn't same as running version.

Use incompatible versions of JiBX Runtime

I want to use 2 libraries that have been built with different and incompatible versions of JiBX.
Lib #1 runs with JiBX Runtime 1.0.1
Lib #2 runs with JiBX Runtime 1.2.6
The current version number is coded in the interface : org.jibx.runtime.IBindingFactory#CURRENT_VERSION_NUMBER .
When calling org.jibx.runtime.BindingDirectory#getFactory(), there's a compatibility test.
If the generated class and the runtime are incompatible, we got an exception like this :
Caused by: org.jibx.runtime.JiBXException: Binding information for
class Xxxx must be
regenerated with current binding compiler at
org.jibx.runtime.BindingDirectory.getFactoryFromName(Unknown Source)
at org.jibx.runtime.BindingDirectory.getFactory(Unknown Source)
EDIT - 29/07/2015
Another possible exception :
Caused by: org.jibx.runtime.JiBXException: Binding information for
class
Yyyyy must
be recompiled with current binding compiler (compiled with jibx_1_0_1,
runtime is jibx_1_2_5_SNAPSHOT) at
org.jibx.runtime.BindingDirectory.getFactoryFromName(BindingDirectory.java:125)
at
org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:178)
at
org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:197)
Is it possible to make it work ?
I've looked at the doc about JiBX Runtime but didn't found anything.
JiBX Runtime on Maven Central Repo.

Categories