Bug 818564 - creating a consumer w/o specifying releaseVer NPE
creating a consumer w/o specifying releaseVer NPE
Status: CLOSED CURRENTRELEASE
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
0.9
Unspecified Unspecified
urgent Severity urgent
: ---
: ---
Assigned To: Bryan Kearney
Eric Sammons
:
: 819013 (view as bug list)
Depends On:
Blocks: sam11-tracker
  Show dependency treegraph
 
Reported: 2012-05-03 07:46 EDT by Tom McKay
Modified: 2015-05-14 10:52 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-17 09:04:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom McKay 2012-05-03 07:46:59 EDT
Katello does not pass in the releaseVer value when it calls the create consumer api. This causes crash in candlepin and failure to create consumer.

May 02 17:54:18 [http-8443-1] ERROR org.candlepin.exceptions.mappers.CandlepinExceptionMapper - Runtime Error org.codehaus.jackson.map.JsonMappingException: N/A (through reference chain: org.candlepin.model.Consumer["releaseVer"]) at org.candlepin.model.Consumer.setReleaseVer:543
org.jboss.resteasy.spi.ReaderException: org.codehaus.jackson.map.JsonMappingException: N/A (through reference chain: org.candlepin.model.Consumer["releaseVer"])
	at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:201)
	at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:114)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:216)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:141)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:63)
	at org.candlepin.servlet.filter.ContentTypeHackFilter.doFilter(ContentTypeHackFilter.java:61)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at org.candlepin.servlet.filter.logging.LoggingFilter.doFilter(LoggingFilter.java:60)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at com.wideplay.warp.persist.PersistenceFilter$3.run(PersistenceFilter.java:141)
	at com.wideplay.warp.persist.internal.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
	at com.wideplay.warp.persist.PersistenceFilter.doFilter(PersistenceFilter.java:155)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:679)
Caused by: org.codehaus.jackson.map.JsonMappingException: N/A (through reference chain: org.candlepin.model.Consumer["releaseVer"])
	at org.codehaus.jackson.map.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:345)
	at org.codehaus.jackson.map.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:328)
	at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.set(SettableBeanProperty.java:424)
	at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
	at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2695)
	at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308)
	at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:105)
	at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:61)
	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:108)
	at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:168)
	... 41 more
Caused by: java.lang.NullPointerException
	at org.candlepin.model.Consumer.setReleaseVer(Consumer.java:543)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.set(SettableBeanProperty.java:422)
	... 51 more
Comment 1 Tom McKay 2012-05-07 08:54:31 EDT
*** Bug 819013 has been marked as a duplicate of this bug. ***
Comment 2 Adrian Likins 2012-05-07 08:55:52 EDT
in master:

commit d95d0e6e217bc6b9d26783f517849547cdd6702a
Author: Adrian Likins <alikins@redhat.com>
Date:   Wed May 2 19:01:14 2012 -0400

    Add a null check for consumer.setReleaseVer
    
    That is to work around cases where a Consumer with
    null releaseVer can be created.
    
    Also add a Release() empty constructor to Release
    module to fix some serealization issues that cropped
    up in imports.
    
    Add test case for null releaseVer in update consumer tests

commit cbc34dba4c9f85420c6e7f412af440dd18892592
Author: Adrian Likins <alikins@redhat.com>
Date:   Wed May 2 09:40:14 2012 -0400

    818040: rhsm release combobox doesn't reset release now
    
    Calls to updateConsumer with null releasevers in the consumer
    objects could result in the consumer release being reset
    to null because of a bad equals check.
    
    Add a .equals for Release model for Consumer compares
    
    Fixes ConsumerResourceUpdateTest.nothingChanged unittest
    failure
    
    Add test cases for above.
Comment 3 Bryan Kearney 2012-07-17 09:04:07 EDT
Marking all community bugs modified or beyong as closed.

Note You need to log in before you can comment on or make changes to this bug.