Skip to content

Conversation

@arjantijms
Copy link
Contributor

Temporary disabled the osgi test module. It already failed on the current state of the 4.0 branch.

We should of course fix and activate it later again.

Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
@arjantijms arjantijms added the 4.x label Jan 5, 2024
@arjantijms arjantijms added this to the 4.0.0 milestone Jan 5, 2024
@arjantijms arjantijms requested review from jansupol and senivam January 5, 2024 19:56
@arjantijms arjantijms self-assigned this Jan 5, 2024
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
@jansupol
Copy link
Contributor

jansupol commented Jan 8, 2024

Hi Arjan,
This PR contains two parts - one that brings new versions for Grizzly and Servlet, I can understand that.
The second part brings new versions for OSGi, and with those new versions, the OSGi tests need to be disabled. Some OSGi tests were failing prior to this PR, that is correct, but those tests were excluded, and the remaining tests were passing. So now it looks more like those new dependencies broke the OSGi tests. So what is the rationale for upgrading the dependencies for OSGi, I doubt they consume the new Jakarta APIs? Do we need to have them when they break the OSGi tests?

@arjantijms
Copy link
Contributor Author

arjantijms commented Jan 9, 2024

So now it looks more like those new dependencies broke the OSGi tests.

The OSGi tests were already failing before I made any change. In case it matters, they were failing on my M1 Mac locally.

@jansupol
Copy link
Contributor

jansupol commented Jan 9, 2024

The OSGi tests were already failing before I made any change. In case it matters, they were failing on my M1 Mac locally.

Odd. The tests were run on my local env and on the CI env for the PRs. Any chance you run the tests in the IDE (so that they were not excluded by maven)?

@arjantijms
Copy link
Contributor Author

Any chance you run the tests in the IDE

Nope, just "mvn clean install" on the command line. I could try to go back to the rev before I made changes and try again though.

@arjantijms
Copy link
Contributor Author

Regardless btw, I think for a new major version we should surely not withhold any version updates because something breaks. Instead, whatever breaks should be fixed then (at a later time perhaps, but should be fixed).

@arjantijms
Copy link
Contributor Author

@jansupol I reran the build from current 4.0 branch (without any changes), and got the following results:

[org.ops4j.pax.exam.ExamJavaRunner] DEBUG : Unwrapping stream I/O.
[org.ops4j.pax.exam.ExamJavaRunner] INFO : Platform has been shutdown.
[org.ops4j.pax.exam.spi.reactors.ReactorManager] INFO : suite finished
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.551 s <<< FAILURE! -- in org.glassfish.jersey.osgi.test.basic.JsonMoxyTest
[ERROR] org.glassfish.jersey.osgi.test.basic.JsonMoxyTest.testJson -- Time elapsed: 1.549 s <<< ERROR!
java.lang.ClassNotFoundException: org.glassfish.jersey.moxy.json.MoxyJsonConfig not found by PAXEXAM-PROBE-5d205749-5a5d-42af-80b4-521777bdf290 [46]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
	at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at org.glassfish.jersey.osgi.test.basic.JsonMoxyTest$1.configure(JsonMoxyTest.java:79)
	at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:722)
	at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:641)
	at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:832)
	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:345)
	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:310)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:309)
	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:274)
	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.<init>(GrizzlyHttpContainer.java:310)
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory.createHttpServer(GrizzlyHttpServerFactory.java:93)
	at org.glassfish.jersey.osgi.test.basic.AbstractJsonOsgiIntegrationTest.testJson(AbstractJsonOsgiIntegrationTest.java:65)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runLeafWithRetry(ContainerTestRunner.java:97)
	at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChildWithRetry(ContainerTestRunner.java:84)
	at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:75)
	at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:43)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)
	at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)
	at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.invokeMethodOnService(RemoteFrameworkImpl.java:435)
	at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.invokeMethodOnService(RemoteFrameworkImpl.java:408)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   JsonJacksonTest>AbstractJsonOsgiIntegrationTest.testJson:54->getJsonProviderFeature:63 » ClassNotFound org.glassfish.jersey.jackson.JacksonFeature not found by PAXEXAM-PROBE-771bdd82-7125-47cd-af00-8bf01a595238 [43]
[ERROR]   JsonJettisonTest>AbstractJsonOsgiIntegrationTest.testJson:54->getJsonProviderFeature:60 » ClassNotFound org.glassfish.jersey.jettison.JettisonFeature not found by PAXEXAM-PROBE-73ed0e0d-69ec-4cc2-a670-27cf49334633 [39]
[ERROR]   JsonMoxyTest>AbstractJsonOsgiIntegrationTest.testJson:65 » ClassNotFound org.glassfish.jersey.moxy.json.MoxyJsonConfig not found by PAXEXAM-PROBE-5d205749-5a5d-42af-80b4-521777bdf290 [46]
[ERROR]   WebResourceFactoryTest.testPostIt:188 » MessageBodyProviderNotFound MessageBodyWriter not found for media type=application/xml, type=interface java.util.List, genericType=java.util.List<org.glassfish.jersey.osgi.test.basic.WebResourceFactoryTest$MyBean>.
[ERROR]   WebResourceFactoryTest.testSubResource:203 » InternalServerError HTTP 500 Internal Server Error
[INFO] 
[ERROR] Tests run: 16, Failures: 0, Errors: 5, Skipped: 0

At a glance it seems to be related to Moxy, which I had to remove from GlassFish a long time ago. Lukash added something to EclipseLink, which caused two of the same providers on the class path, and I had to remove one. See eclipse-ee4j/eclipselink#1380

If the test is dependent on Moxy, and uses GlassFish as a test target, it should have failed on your side too I guess.

@arjantijms
Copy link
Contributor Author

Details:

java --version
openjdk 17.0.8 2023-07-18 LTS
OpenJDK Runtime Environment Corretto-17.0.8.7.1 (build 17.0.8+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.8.7.1 (build 17.0.8+7-LTS, mixed mode, sharing)
mvn --version
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /opt/homebrew/Cellar/maven/3.9.6/libexec
Java version: 17.0.8, vendor: Amazon.com Inc., runtime: /opt/sdkman/candidates/java/17.0.8-amzn
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "13.5.2", arch: "aarch64", family: "Mac"

Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
@senivam
Copy link
Contributor

senivam commented Jan 10, 2024

evidently pax-exam-container-forked has some issue with logging in the version 4.13.5. I did not find out how to fix the issue with some patches in Jersey, so I've just reduced its version to the 4.13.4 (pax.exam.legacy.version), this modification allows to pass all previously disabled tests in the osgi module. I've allowed myself a direct commit into your (@arjantijms) PR so it would be faster visible. However, this does not resolve the discussion with @jansupol it only demonstrates how to enable the osgi module.

@jansupol
Copy link
Contributor

@arjantijms I tested the branch on my M1 mac (JDK 17, maven 3.8.7, clean clone and build), too. All tests pass fine. That's 3 different environments that are passing for me.

Given JsonJettisonTest failed for you, and Jettison does not have javax/jakarta-ee dependencies, I suspect something odd is happening on your side. Usually, the tests warn about some unsatisfied OSGi dependencies during the run, the exception from the test never says much.

Regardless btw, I think for a new major version we should surely not withhold any version updates because something breaks. Instead, whatever breaks should be fixed then (at a later time perhaps, but should be fixed).

I agree for Jakarta EE dependencies, but not for OSGi support dependencies that can prove to be broken.

If the test is dependent on Moxy, and uses GlassFish as a test target, it should have failed on your side too I guess.

No, the tests do not use Glassfish, just Felix to check the OSGi headers in runtime, so that we do not have issues with integration to any OSGi env (there are customers using OSGi servers without Glassfish).


To proceed further, I'd go just with those Grizzly & Servlet changes, without the OSGi changes, which should be in a separate commit, especially given how much trouble the OSGi causes.

I can volunteer to do so if your test issues persist.

Copy link
Contributor

@jansupol jansupol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see Maxim reverted the OSGi test module exclusion, all good now!

Copy link
Contributor

@senivam senivam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so we can merge it then :)

@senivam senivam merged commit 3b1b53e into eclipse-ee4j:4.0 Jan 10, 2024
@arjantijms
Copy link
Contributor Author

arjantijms commented Jan 10, 2024

I suspect something odd is happening on your side

That's odd indeed, especially when your test environment is quite similar to mine (Mac and M1).

I keep having these:

[ERROR] Errors: 
[ERROR]   JsonJacksonTest>AbstractJsonOsgiIntegrationTest.testJson:54->getJsonProviderFeature:63 » ClassNotFound org.glassfish.jersey.jackson.JacksonFeature not found by PAXEXAM-PROBE-16dd3edc-a25d-4075-a786-e4c66edab871 [44]
[ERROR]   JsonJettisonTest>AbstractJsonOsgiIntegrationTest.testJson:54->getJsonProviderFeature:60 » ClassNotFound org.glassfish.jersey.jettison.JettisonFeature not found by PAXEXAM-PROBE-cbf9e353-fd47-4f49-9c1d-62ad60b012c5 [40]
[ERROR]   JsonMoxyTest>AbstractJsonOsgiIntegrationTest.testJson:65 » ClassNotFound org.glassfish.jersey.moxy.json.MoxyJsonConfig not found by PAXEXAM-PROBE-a76deb6e-bb3f-4165-9392-903318d17e86 [47]
[ERROR]   WebResourceFactoryTest.testPostIt:188 » MessageBodyProviderNotFound MessageBodyWriter not found for media type=application/xml, type=interface java.util.List, genericType=java.util.List<org.glassfish.jersey.osgi.test.basic.WebResourceFactoryTest$MyBean>.
[ERROR]   WebResourceFactoryTest.testSubResource:203 » InternalServerError HTTP 500 Internal Server Error
[INFO] 
[ERROR] Tests run: 16, Failures: 0, Errors: 5, Skipped: 0

When time allows I'll try do dig into these.

OK, so we can merge it then :)

Okay thanks! :)

This was referenced Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants