javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

NullpointerException in endpointfactory when passing in nullable parameter #1140

Open glassfishrobot opened 10 years ago

glassfishrobot commented 10 years ago

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 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]

glassfishrobot commented 10 years ago

Reported by pasfilip

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-1140