Issue 16522

Service unavailable on page

16522
Reporter: trobertson
Assignee: mdoering
Type: Feedback
Summary: Service unavailable on page
Resolution: Fixed
Status: Closed
Created: 2014-10-08 16:38:30.897
Updated: 2015-02-25 17:37:49.879
Resolved: 2015-02-25 17:37:49.856
        
        
Description: Caused by:

{code}
### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in org/gbif/checklistbank/service/mybatis/MultimediaMapper.xml
### The error may involve org.gbif.checklistbank.service.mybatis.MultimediaMapper.listByNubUsage-Inline
### The error occurred while setting parameters
### SQL: SELECT i.usage_fk,      i.id, i.url, i.link, i.title, i.description, i.license, i.creator, i.created, i.publisher      FROM      image i       JOIN nub_rel rel ON i.usage_fk=rel.usage_fk       WHERE rel.nub_fk=?     ORDER BY i.rating, i.id      LIMIT ? OFFSET ?
### Cause: java.lang.NullPointerException
	org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
	org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
	sun.reflect.GeneratedMethodAccessor811.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:282)
	com.sun.proxy.$Proxy428.selectList(Unknown Source)
	org.apache.ibatis.session.SqlSessionManager.selectList(SqlSessionManager.java:171)
	org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
	com.sun.proxy.$Proxy483.listByNubUsage(Unknown Source)
	org.gbif.checklistbank.service.mybatis.NameUsageComponentServiceMyBatis.listByUsage(NameUsageComponentServiceMyBatis.java:41)
	org.gbif.checklistbank.service.mybatis.MultimediaServiceMyBatis.listByUsage(MultimediaServiceMyBatis.java:34)
	org.gbif.checklistbank.ws.resources.SpeciesResource.listImagesByNameUsage(SpeciesResource.java:280)
	sun.reflect.GeneratedMethodAccessor990.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)
	com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
	com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
	com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
	com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
	com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
	com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
	com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
	com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
	com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)

root cause

java.lang.NullPointerException
	org.gbif.common.parsers.date.StringToDateParser.parse(StringToDateParser.java:137)
	org.gbif.common.parsers.date.DateParseUtils.parse(DateParseUtils.java:61)
	org.gbif.checklistbank.service.mybatis.postgres.StringDateTypeHandler.string2Date(StringDateTypeHandler.java:28)
{code}]]>
    


Author: mdoering@gbif.org
Created: 2014-10-08 20:50:52.471
Updated: 2014-10-08 20:50:52.471
        
The entire image handling has been replaced by a multimedia table and mapper in the latest version on dev.
The new table has a proper date type for the created date so the StringDateTypeHandler which causes the NPE has been removed:
https://github.com/gbif/checklistbank/commit/ebcab632d926d9105b406f4dfdddc927ecac0346#diff-cabe8dbf5df30156b9b4000caa8acf8bL20

So this error should not exist in dev.
[~trobertson@gbif.org], is the issue critical enough to warrant a patch for the released version in production?

I would prefer to release the current head instead, but not before next week. This would require some database changes to the current production db, but can be done without a problem following the liquibase files. Also varnish would need a tiny patch and the portal would have to be released and deployed as the latest clb has merged the search-ws into the main clb-ws module
    


Author: jlegind@gbif.org
Created: 2014-10-09 09:23:36.906
Updated: 2014-10-09 09:23:36.906
        
For the sake of documentation: Also shows up on UAT
http://www.gbif-uat.org/species/1211257