metro-jax-ws icon indicating copy to clipboard operation
metro-jax-ws copied to clipboard

NullpointerException in endpointfactory when passing in nullable parameter

Open Tomas-Kraus opened this issue 2 years ago • 0 comments

EndpointFactory create method crashes with a nullpointer exception when passing a null binding. Looks like it was updated some time after version 2.2.1 which doesn't contain this issue.

The create method: create( Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker, @Nullable QName serviceName, @Nullable QName portName, @Nullable Container container, @Nullable WSBinding binding, @Nullable SDDocumentSource primaryWsdl, @Nullable Collection<? extends SDDocumentSource> metadata, EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard)

The method resulting in a nullpointer exception:

public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding)

{ com.oracle.webservices.api.databinding.ExternalMetadataFeature ef = binding.getFeature( com.oracle.webservices.api.databinding.ExternalMetadataFeature.class); if (ef != null) return ef.getMetadataReader(implType.getClassLoader()); return null; }

I guess it should be updated to:

public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding) { if ( binding == null )

{ return null; }

com.oracle.webservices.api.databinding.ExternalMetadataFeature ef = binding.getFeature( com.oracle.webservices.api.databinding.ExternalMetadataFeature.class); if (ef != null) return ef.getMetadataReader(implType.getClassLoader()); return null; }

Affected Versions

[2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8]

Source: https://github.com/javaee/metro-jax-ws/issues/1140 Author: glassfishrobot

Tomas-Kraus avatar Jun 02 '22 17:06 Tomas-Kraus