Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #10670 (new)

Opened 7 years ago

Last modified 4 years ago

Improve exception handling when thumbnail size is too small

Reported by: sbesson Owned by:
Priority: minor Milestone: Unscheduled
Component: Services Version: n.a.
Keywords: n.a. Cc: jburel, jamoore
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

Calling getThumbnail() with small values of (1, 2) results in

Java exception occurred:
omero.InternalException
    serverStackTrace = "ome.conditions.InternalException:  Wrapped Exception:
    (java.lang.RuntimeException):
                        Error doing rescale. Target size was 3x1 but must be
                        at least 3x3.
                        	at
                                com.mortennobel.imagescaling.ResampleOp.doFilter(ResampleOp.java:114)
                                                        	at
                                com.mortennobel.imagescaling.AdvancedResizeOp.filter(AdvancedResizeOp.java:81)
                                                        	at
                                ome.logic.JavaImageScalingService.scaleBufferedImage(JavaImageScalingService.java:52)
                                                        	at
                                ome.services.ThumbnailBean.createScaledImage(ThumbnailBean.java:624)
                                                        	at
                                ome.services.ThumbnailBean._createThumbnail(ThumbnailBean.java:814)
                                                        	at
                                ome.services.ThumbnailBean.retrieveThumbnail(ThumbnailBean.java:1051)
                                                        	at
                                ome.services.ThumbnailBean.retrieveThumbnailAndUpdateMetadata(ThumbnailBean.java:1006)
                                                        	at
                                ome.services.ThumbnailBean.getThumbnail(ThumbnailBean.java:996)
                                                        	at
                                sun.reflect.GeneratedMethodAccessor1048.invoke(Unknown
                                Source)
                        	at
                                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                                        	at
                                java.lang.reflect.Method.invoke(Method.java:592)
                                                        	at
                                org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                                                        	at
                                ome.security.basic.EventHandler.invoke(EventHandler.java:154)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                ome.tools.hibernate.SessionHandler.doStateful(SessionHandler.java:182)
                                                        	at
                                ome.tools.hibernate.SessionHandler.invoke(SessionHandler.java:166)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:241)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                ome.services.util.ServiceHandler.invoke(ServiceHandler.java:116)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                                        	at
                                $Proxy93.getThumbnail(Unknown Source)
                        	at
                                sun.reflect.GeneratedMethodAccessor1048.invoke(Unknown
                                Source)
                        	at
                                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                                        	at
                                java.lang.reflect.Method.invoke(Method.java:592)
                                                        	at
                                org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                                                        	at
                                ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:98)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                                        	at
                                $Proxy93.getThumbnail(Unknown Source)
                        	at
                                sun.reflect.NativeMethodAccessorImpl.invoke0(Native
                                Method)
                        	at
                                sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                                        	at
                                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                                        	at
                                java.lang.reflect.Method.invoke(Method.java:592)
                                                        	at
                                ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:179)
                                                        	at
                                ome.services.throttling.Callback.run(Callback.java:56)
                                                        	at
                                ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56)
                                                        	at
                                ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:150)
                                                        	at
                                ome.services.blitz.impl.ThumbnailStoreI.getThumbnail_async(ThumbnailStoreI.java:130)
                                                        	at
                                sun.reflect.NativeMethodAccessorImpl.invoke0(Native
                                Method)
                        	at
                                sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                                        	at
                                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                                        	at
                                java.lang.reflect.Method.invoke(Method.java:592)
                                                        	at
                                org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                                                        	at
                                omero.cmd.CallContext.invoke(CallContext.java:59)
                                                        	at
                                org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                                                        	at
                                org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                                                        	at
                                $Proxy94.getThumbnail_async(Unknown Source)
                        	at
                                omero.api._ThumbnailStoreTie.getThumbnail_async(_ThumbnailStoreTie.java:120)
                                                        	at
                                omero.api._ThumbnailStoreDisp.___getThumbnail(_ThumbnailStoreDisp.java:311)
                                                        	at
                                omero.api._ThumbnailStoreDisp.__dispatch(_ThumbnailStoreDisp.java:668)
                                                        	at
                                IceInternal.Incoming.invoke(Incoming.java:159)
                        	at
                                Ice.ConnectionI.invokeAll(ConnectionI.java:2037)
                                                        	at
                                Ice.ConnectionI.message(ConnectionI.java:972)
                        	at
                                IceInternal.ThreadPool.run(ThreadPool.java:577)
                                                        	at
                                IceInternal.ThreadPool.access$100(ThreadPool.java:12)
                                                        	at
                                IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:971)
                                                        "
    serverExceptionClass = "ome.conditions.InternalException"
    message = " Wrapped Exception: (java.lang.RuntimeException):
               Error doing rescale. Target size was 3x1 but must be at least
               3x3."
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
        Method)
	at
        sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        	at
        sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        	at
        java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at java.lang.Class.newInstance0(Class.java:357)
	at java.lang.Class.newInstance(Class.java:310)
	at
        IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2243)
        	at
        IceInternal.BasicStream.throwException(BasicStream.java:1632)
	at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
	at
        omero.api._ThumbnailStoreDelM.getThumbnail(_ThumbnailStoreDelM.java:387)
        	at
        omero.api.ThumbnailStorePrxHelper.getThumbnail(ThumbnailStorePrxHelper.java:598)
        	at
        omero.api.ThumbnailStorePrxHelper.getThumbnail(ThumbnailStorePrxHelper.java:570) 

ThumbnailBean?.sanityCheckThumbnailSizes, the size condition x>0 could be extended to x >2.
Additionally IScale.scaleBufferedImage could trow an ApiUsageException? instead of an InternalException?

Change History (1)

comment:1 Changed 4 years ago by jamoore

  • Milestone changed from 5.x to Unscheduled
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.166725 sec.)

We're Hiring!