springboot-osgi-sample
springboot-osgi-sample copied to clipboard
Failures on compile?
Hi I tryed to compile it with maven (JDK17) and it failed with:
<failure message="Multiple Failures (1 failure) org.opentest4j.AssertionFailedError: expected: <true> but was: <false>" type="org.opentest4j.MultipleFailuresError"><![CDATA[org.opentest4j.MultipleFailuresError:
Multiple Failures (1 failure)
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
at com.mornati.sample.service.PluginServiceTests.testExtraPackageConfiguration(PluginServiceTests.java:43)
]]></failure>
I looked out that the packages the one finds are: com.mornati.sample.config,com.mornati.sample.controllers,com.mornati.sample.dto,com.mornati.sample.service,com.mornati.sample So I think the common module is missing? I see the reference in the core-s pom.xml. but for some reason it dies not find it. I have not made any changes to the code here. I run it on windows, so maybe it is some OS issue. Or something with locale that causes the common module not to be found?
If I ignore the tests and try to run it anyway then the example plugin fails for the same reason, ie can't find it's deps from common.
Going to check. Thanks for the feedback. This was a POC for a projet we are now having internally... so it should work with JDK17 without any problem. As I didn't update it after the POC it may have some requiring updates missing. Going to check and get back to you...
I just tested on my side and everything is working good with the JDK17
The version I'm using:
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

Going to test with a different one just to check if there is anything broken somewhere.
Even with a different JDK the problem build correctly. I guess there is something somewhere else.
The test reporting the error is looking for the installed plugin and the plugin is in the project itself. Did you run mvn install
right ?
Did you try to run this simple test inside your IDE?
What are the configurations you are using (maven, JDK,...)?
Yes I ran it from command line (mvn clean install):
mvn --version Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0) Maven home: C:\PROGRA~1\apache-maven-3.8.5 Java version: 17.0.1, vendor: Oracle Corporation, runtime: C:\Progra~1\Java\jdk-17.0.1 Default locale: en_US, platform encoding: Cp1257 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
java --version openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-39) OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
I did not before but I tryed now also in my Eclipse, got the same issue as on command line. You used it from linux/mac? Maybe it is a windows issue?
I also attache the full console, maybe something usefull is in there: log.txt
Now I decided to try it out on linux (Jenkins) it was much better: 09:22:35 [INFO] sample ............................................. SUCCESS [ 7.214 s] 09:22:35 [INFO] commons ............................................ SUCCESS [ 10.228 s] 09:22:35 [INFO] core ............................................... SUCCESS [ 19.894 s] 09:22:35 [INFO] sample-bundle ...................................... SUCCESS [ 2.404 s] 09:22:35 [INFO] sample-bundle-scr .................................. FAILURE [ 0.338 s] So the core part that failed locally passed! As you could see from the prev logs I had a lot of ??? in the log. But on linux I see: 09:22:19 2022-05-06 06:22:19.208 INFO 4306 --- [ main] c.m.s.service.SpringAwareBundleListener : Bundle 瞎滎썋쟏ᔾ蛍祹䗧燨⒈笻苆ග∡횯Ə艔଼⪓ꃏ圐:null changed state to Active - Type: Unknown So I think it might be some encoding issue? I have not idea where the chinese bundles come from. Maybe the characters are somewhere in the paths of maven artefacts and they don't resolve correctly.
Now I decided to try it out on linux (Jenkins) it was much better: 09:22:35 [INFO] sample ............................................. SUCCESS [ 7.214 s] 09:22:35 [INFO] commons ............................................ SUCCESS [ 10.228 s] 09:22:35 [INFO] core ............................................... SUCCESS [ 19.894 s] 09:22:35 [INFO] sample-bundle ...................................... SUCCESS [ 2.404 s] 09:22:35 [INFO] sample-bundle-scr .................................. FAILURE [ 0.338 s] So the core part that failed locally passed! As you could see from the prev logs I had a lot of ??? in the log. But on linux I see: 09:22:19 2022-05-06 06:22:19.208 INFO 4306 --- [ main] c.m.s.service.SpringAwareBundleListener : Bundle 瞎滎썋쟏ᔾ蛍祹䗧燨⒈笻苆ග∡횯Ə艔଼⪓ꃏ圐:null changed state to Active - Type: Unknown So I think it might be some encoding issue? I have not idea where the chinese bundles come from. Maybe the characters are somewhere in the paths of maven artefacts and they don't resolve correctly.
No, the chars are part of the properties test with the jqwik framework. It is testing random entries for method properties. This is validating that the code works never mind the plugin name. In your execution, for some reason, part of the tests are failing.. but not all the tests (and you should have several others giving the same output).
The ???
in windows is just because the console encoding is not allowing to display to correct char.