jakartaee / platform-tck

Jakartaee-tck
Other
129 stars 109 forks source link

EE 10 Cannot invoke "java.net.Socket.close()" because "com.sun.ts.lib.util.TestUtil.socketOnRemoteVM" is null #1533

Open scottmarlow opened 1 month ago

scottmarlow commented 1 month ago

I'm concerned after running an EE 10 Platform TCK test locally that fails when trying to open remote logging listener which I think looks like an attempt to attack the machine which I started to workaround for EE 11 already:

2024-09-17 09:23:43,228 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 222) WFLYUT0021: Registered web context: '/jpa_ee_entityManager_pmservlet_vehicle_web' for server 'default-server' 2024-09-17 09:23:43,265 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "jpa_ee_entityManager_vehicles.ear" (runtime-name : "jpa_ee_entityManager_vehicles.ear") 2024-09-17 09:23:46,330 INFO [stdout] (default task-2) **** 2024-09-17 09:23:46,330 INFO [stdout] (default task-2) * props file set to "/tmp/smarlow-cts-props.txt" 2024-09-17 09:23:46,330 INFO [stdout] (default task-2) **** 2024-09-17 09:26:01,203 ERROR [stderr] (default task-2) java.lang.NullPointerException: Cannot invoke "java.net.Socket.close()" because "com.sun.ts.lib.util.TestUtil.socketOnRemoteVM" is null 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at com.sun.ts//com.sun.ts.lib.util.TestUtil.init(TestUtil.java:456) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at deployment.jpa_ee_entityManager_vehicles.ear.jpa_ee_entityManager_appmanaged_vehicle_ejb.jar//com.sun.ts.tests.common.vehicle.ejb3share.EJB3ShareBaseBean.runTest(EJB3ShareBaseBean.java:58) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at deployment.jpa_ee_entityManager_vehicles.ear.jpa_ee_entityManager_appmanaged_vehicle_ejb.jar//com.sun.ts.tests.common.vehicle.appmanaged.AppManagedVehicleBean.runTest(AppManagedVehicleBean.java:61) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at java.base/java.lang.reflect.Method.invoke(Method.java:569) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at org.jboss.as.ee@34.0.0.Beta1-SNAPSHOT//org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:35) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at org.jboss.as.weld.common@34.0.0.Beta1-SNAPSHOT//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:62) 2024-09-17 09:26:01,204 ERROR [stderr] (default task-2) at org.jboss.as.weld.common@34.0.0.Beta1-SNAPSHOT//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:72) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.weld.common@34.0.0.Beta1-SNAPSHOT//org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:85) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.ee@34.0.0.Beta1-SNAPSHOT//org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:46) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.ejb3@34.0.0.Beta1-SNAPSHOT//org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:26) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.jpa@34.0.0.Beta1-SNAPSHOT//org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:30) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.jpa@34.0.0.Beta1-SNAPSHOT//org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:40) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.invocation@2.0.1.Final//org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) 2024-09-17 09:26:01,205 ERROR [stderr] (default task-2) at org.jboss.as.ejb3@34.0.0.Beta1-SNAPSHOT//org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:118)

The workaround for EE 11 is currently using localhost via change https://github.com/jakartaee/platform-tck/commit/ff54782e82b7f2819665d8721df4047d1986b8f7 but we may need more changes than that to use a specific ip address. The workaround to use a specific ip address could be to update the test machine hosts file to set localhost (if possible).

scottmarlow commented 1 month ago

I'm going to try a local workaround in src/com/sun/ts/lib/harness/EETest.java:

    // set the harness.host prop so the server can initialize the
    // the TestUtil logging
    try {
      p.setProperty("harness.host",
          InetAddress.getLocalHost().getHostAddress());
    } catch (Throwable ignore) {
      p.setProperty("harness.host", "localhost");
    }
scottmarlow commented 1 month ago

The ^ workaround of catching the exception and using p.setProperty("harness.host", "localhost"); seemed to help.