Issue 17264

Checklist imports throw media mybatis exception

17264
Reporter: mdoering
Type: Bug
Summary: Checklist imports throw media mybatis exception
Priority: Critical
Resolution: Fixed
Status: Closed
Created: 2015-02-19 13:33:15.018
Updated: 2015-02-19 13:54:09.42
Resolved: 2015-02-19 13:54:09.39
        
Description: WARN  [2015-02-19 13:16:54,933+0100] [pool-10-thread-3] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: Failed to sync extensions for usage 132391976, Crassignatha danaugirangensis
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: column "type" is of type media_type but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 204
### The error may involve org.gbif.checklistbank.service.mybatis.mapper.MultimediaMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO media (usage_fk, type, format, identifier, "references", title, description, audience,       created, creator, contributor, publisher, license, rights_holder, source_fk     )     VALUES (?, ?, ?, ?, ?, ?, ?, ?,       ?, ?, ?, ?, ?, ?, ?     )
### Cause: org.postgresql.util.PSQLException: ERROR: column "type" is of type media_type but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 204
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
	at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:278) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.sun.proxy.$Proxy34.insert(Unknown Source) ~[na:na]
	at org.apache.ibatis.session.SqlSessionManager.insert(SqlSessionManager.java:198) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.sun.proxy.$Proxy45.insert(Unknown Source) ~[na:na]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.insertExtensions(DatasetImportServiceMyBatis.java:215) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.updateUsage(DatasetImportServiceMyBatis.java:311) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.syncUsage(DatasetImportServiceMyBatis.java:148) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$$EnhancerByGuice$$40683d89.CGLIB$syncUsage$1() [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$$EnhancerByGuice$$40683d89$$FastClassByGuice$$1a969ec3.invoke() [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.mybatis.guice.transactional.TransactionalMethodInterceptor.invoke(TransactionalMethodInterceptor.java:101) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$$EnhancerByGuice$$40683d89.syncUsage() [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.cli.importer.DatasetImportServiceCombined.syncUsage(DatasetImportServiceCombined.java:40) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.cli.importer.Importer.syncDataset(Importer.java:86) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.cli.importer.Importer.run(Importer.java:61) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.cli.importer.ImporterService.handleMessage(ImporterService.java:105) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.checklistbank.cli.importer.ImporterService.handleMessage(ImporterService.java:38) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.common.messaging.MessageConsumer.handleCallback(MessageConsumer.java:101) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.gbif.common.messaging.MessageConsumer.handleDelivery(MessageConsumer.java:65) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.rabbitmq.client.impl.ConsumerDispatcher$4.run(ConsumerDispatcher.java:121) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:76) [checklistbank-cli.jar:2.12-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
Caused by: org.postgresql.util.PSQLException: ERROR: column "type" is of type media_type but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  Position: 204
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.zaxxer.hikari.proxy.PreparedStatementProxy.execute(PreparedStatementProxy.java:44) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at com.zaxxer.hikari.proxy.PreparedStatementJavassistProxy.execute(PreparedStatementJavassistProxy.java) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:44) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:69) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152) ~[checklistbank-cli.jar:2.12-SNAPSHOT]
	... 33 common frames omitted
]]>
    


Author: mdoering@gbif.org
Comment: https://github.com/gbif/checklistbank/commit/4813f0247f24539612dab0775f51cbd8b55bf350
Created: 2015-02-19 13:54:09.416
Updated: 2015-02-19 13:54:09.416