Issue 16421

Multimedia mybatis NPE

16421
Reporter: mdoering
Assignee: mdoering
Type: Bug
Summary: Multimedia mybatis NPE
Priority: Critical
Resolution: CantReproduce
Status: Resolved
Created: 2014-09-22 17:10:07.754
Updated: 2015-03-10 16:52:53.345
Resolved: 2015-03-10 16:52:53.324
        
Description: Found that in the CLB ws logs:

-----

Caused by: java.lang.NullPointerException: null
ERROR [2014-09-22 16:03:43,571+0200] [http-bio-8080-exec-11821] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/b_checklistbank-ws].[default]: Servlet.service() for servlet [default] in context with path [/b_checklistbank-ws] threw exception
org.apache.ibatis.exceptions.PersistenceException:
### 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
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.2.3.jar:3.2.3]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107) ~[mybatis-3.2.3.jar:3.2.3]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) ~[mybatis-3.2.3.jar:3.2.3]
	at sun.reflect.GeneratedMethodAccessor1022.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
	at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:282) ~[mybatis-3.2.3.jar:3.2.3]
	at com.sun.proxy.$Proxy160.selectList(Unknown Source) ~[na:na]
	at org.apache.ibatis.session.SqlSessionManager.selectList(SqlSessionManager.java:171) ~[mybatis-3.2.3.jar:3.2.3]
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114) ~[mybatis-3.2.3.jar:3.2.3]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58) ~[mybatis-3.2.3.jar:3.2.3]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) ~[mybatis-3.2.3.jar:3.2.3]
	at com.sun.proxy.$Proxy475.listByNubUsage(Unknown Source) ~[na:na]
	at org.gbif.checklistbank.service.mybatis.NameUsageComponentServiceMyBatis.listByUsage(NameUsageComponentServiceMyBatis.java:41) ~[checklistbank-mybatis-service-2.8.jar:2.8]
	at org.gbif.checklistbank.service.mybatis.MultimediaServiceMyBatis.listByUsage(MultimediaServiceMyBatis.java:34) ~[checklistbank-mybatis-service-2.8.jar:2.8]
	at org.gbif.checklistbank.ws.resources.SpeciesResource.listImagesByNameUsage(SpeciesResource.java:280) ~[SpeciesResource.class:na]
]]>