Problems declaring blob on mapping closure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems declaring blob on mapping closure

Pablo Pazos
Hi everyone,
I have this domain class, I have added a mapping colsure to specify that one fileld has to be blob (beacuse it is created as tinyblob on MySQL). So, when I want to save an Image I get an exception, does anyone know what's happening?
 
thank you,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net

Exception:

Message: [B cannot be cast to java.sql.Blob
Caused by: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
Class: Unknown
At Line: [-1]
Code Snippet:

Stack trace:
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.lang.Closure.call(Closure.java:287)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:525)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:237)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:153)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:251)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:197)
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:184)
        at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:116)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:119)
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:82)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:142)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:68)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:295)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
        at $Proxy3.saveOrUpdate(Unknown Source)
        at amenities.AmenityController$_closure10.doCall(amenities.AmenityController:252)
        at amenities.AmenityController$_closure10.doCall(amenities.AmenityController)

My domain class:

class Image {
    byte[] picture;

    String mimeType;
    long fileSize;

    int compareTo(obj) {
            id.compareTo(obj.id)
    }
   
    static mapping = {
        columns {
             picture(type:'blob')
        }
    }
}

Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Pablo Pazos
Hi everybody, I still have this issue, I don't know if someone can help me with this it's very important.

BTW I'm using grails 1.0.1

thanks,
Pablo.

pablox wrote
Hi everyone,
I have this domain class, I have added a mapping colsure to specify that one fileld has to be blob (beacuse it is created as tinyblob on MySQL). So, when I want to save an Image I get an exception, does anyone know what's happening?
 
thank you,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net

Exception:

Message: [B cannot be cast to java.sql.Blob
Caused by: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
Class: Unknown
At Line: [-1]
Code Snippet:

Stack trace:
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.lang.Closure.call(Closure.java:287)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:525)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:237)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:153)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:251)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
        at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:197)
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:184)
        at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:116)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:119)
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:82)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:142)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:68)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:295)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
        at $Proxy3.saveOrUpdate(Unknown Source)
        at amenities.AmenityController$_closure10.doCall(amenities.AmenityController:252)
        at amenities.AmenityController$_closure10.doCall(amenities.AmenityController)

My domain class:

class Image {
    byte[] picture;

    String mimeType;
    long fileSize;

    int compareTo(obj) {
            id.compareTo(obj.id)
    }
   
    static mapping = {
        columns {
             picture(type:'blob')
        }
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Miguel Ping
Have you tried removing this part?

>     static mapping = {
>         columns {
>              picture(type:'blob')
>         }
>     }

I have binary data and didn't need to specify it in the mapping.

On Mon, Jun 2, 2008 at 8:49 PM, pablox <[hidden email]> wrote:

Hi everybody, I still have this issue, I don't know if someone can help me
with this it's very important.

BTW I'm using grails 1.0.1

thanks,
Pablo.


pablox wrote:
>
> Hi everyone,
> I have this domain class, I have added a mapping colsure to specify that
> one fileld has to be blob (beacuse it is created as tinyblob on MySQL).
> So, when I want to save an Image I get an exception, does anyone know
> what's happening?
>
> thank you,
> Pablo Pazos Gutierrez
> www.SimpleWebPortal.net
>
> Exception:
>
> Message: [B cannot be cast to java.sql.Blob
> Caused by: java.lang.ClassCastException: [B cannot be cast to
> java.sql.Blob
> Class: Unknown
> At Line: [-1]
> Code Snippet:
>
> Stack trace:
> org.codehaus.groovy.runtime.InvokerInvocationException:
> java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
>       at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
>       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
>       at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
>       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
>       at groovy.lang.Closure.call(Closure.java:292)
>       at groovy.lang.Closure.call(Closure.java:287)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:525)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:237)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:153)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
>       at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
>       at
> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:251)
>       at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
>       at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
>       at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>       at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>       at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
>       at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>       at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>       at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>       at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>       at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
>       at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
>       at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:197)
>       at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:184)
>       at
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:116)
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>       at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:119)
>       at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:82)
>       at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at
> org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:142)
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>       at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at
> org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:68)
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>       at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>       at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>       at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>       at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>       at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>       at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>       at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>       at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>       at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>       at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>       at org.mortbay.jetty.Server.handle(Server.java:295)
>       at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
>       at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
>       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
>       at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>       at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>       at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
>       at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
> Caused by: java.lang.ClassCastException: [B cannot be cast to
> java.sql.Blob
>       at $Proxy3.saveOrUpdate(Unknown Source)
>       at
> amenities.AmenityController$_closure10.doCall(amenities.AmenityController:252)
>       at
> amenities.AmenityController$_closure10.doCall(amenities.AmenityController)
>
> My domain class:
>
> class Image {
>     byte[] picture;
>
>     String mimeType;
>     long fileSize;
>
>     int compareTo(obj) {
>             id.compareTo(obj.id)
>     }
>
>     static mapping = {
>         columns {
>              picture(type:'blob')
>         }
>     }
> }
>
>
>

--
View this message in context: http://www.nabble.com/Problems-declaring-blob-on-mapping-closure-tp16332253p17609322.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Pablo Pazos
Hi, if I remove this the data is created as tinyblob in MySQL, so if I have more data than the data that can be stored in the tony blob I get another error.

thanx
Pablo.


Miguel Ping wrote
Have you tried removing this part?

>     static mapping = {
>         columns {
>              picture(type:'blob')
>         }
>     }

I have binary data and didn't need to specify it in the mapping.

On Mon, Jun 2, 2008 at 8:49 PM, pablox <pablo@mirigi.com> wrote:

>
> Hi everybody, I still have this issue, I don't know if someone can help me
> with this it's very important.
>
> BTW I'm using grails 1.0.1
>
> thanks,
> Pablo.
>
>
> pablox wrote:
> >
> > Hi everyone,
> > I have this domain class, I have added a mapping colsure to specify that
> > one fileld has to be blob (beacuse it is created as tinyblob on MySQL).
> > So, when I want to save an Image I get an exception, does anyone know
> > what's happening?
> >
> > thank you,
> > Pablo Pazos Gutierrez
> > www.SimpleWebPortal.net
> >
> > Exception:
> >
> > Message: [B cannot be cast to java.sql.Blob
> > Caused by: java.lang.ClassCastException: [B cannot be cast to
> > java.sql.Blob
> > Class: Unknown
> > At Line: [-1]
> > Code Snippet:
> >
> > Stack trace:
> > org.codehaus.groovy.runtime.InvokerInvocationException:
> > java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
> >       at
> > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
> >       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
> >       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
> >       at
> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
> >       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
> >       at groovy.lang.Closure.call(Closure.java:292)
> >       at groovy.lang.Closure.call(Closure.java:287)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:525)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:237)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:153)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
> >       at
> >
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:251)
> >       at
> >
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
> >       at
> >
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> >       at
> >
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> >       at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> >       at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
> >       at
> >
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> >       at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> >       at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
> >       at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> >       at
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
> >       at
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
> >       at
> >
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:197)
> >       at
> >
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:184)
> >       at
> >
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:116)
> >       at
> >
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
> >       at
> >
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> >       at
> >
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:119)
> >       at
> >
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:82)
> >       at
> >
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:142)
> >       at
> >
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
> >       at
> >
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> >       at
> >
> org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:68)
> >       at
> >
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
> >       at
> >
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> >       at
> >
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
> >       at
> >
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
> >       at
> >
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
> >       at
> >
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
> >       at
> >
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> >       at
> > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
> >       at
> >
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> >       at
> > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> >       at
> > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
> >       at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> >       at
> > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> >       at org.mortbay.jetty.Server.handle(Server.java:295)
> >       at
> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
> >       at
> >
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
> >       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
> >       at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
> >       at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
> >       at
> >
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
> >       at
> >
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
> > Caused by: java.lang.ClassCastException: [B cannot be cast to
> > java.sql.Blob
> >       at $Proxy3.saveOrUpdate(Unknown Source)
> >       at
> >
> amenities.AmenityController$_closure10.doCall(amenities.AmenityController:252)
> >       at
> >
> amenities.AmenityController$_closure10.doCall(amenities.AmenityController)
> >
> > My domain class:
> >
> > class Image {
> >     byte[] picture;
> >
> >     String mimeType;
> >     long fileSize;
> >
> >     int compareTo(obj) {
> >             id.compareTo(obj.id)
> >     }
> >
> >     static mapping = {
> >         columns {
> >              picture(type:'blob')
> >         }
> >     }
> > }
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Problems-declaring-blob-on-mapping-closure-tp16332253p17609322.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Miguel Ping
I had the same problem, so I manually changed the column type from tinyblob to longblob.

On Mon, Jun 2, 2008 at 9:46 PM, pablox <[hidden email]> wrote:

Hi, if I remove this the data is created as tinyblob in MySQL, so if I have
more data than the data that can be stored in the tony blob I get another
error.

thanx
Pablo.



Miguel Ping wrote:
>
> Have you tried removing this part?
>
>>     static mapping = {
>>         columns {
>>              picture(type:'blob')
>>         }
>>     }
>
> I have binary data and didn't need to specify it in the mapping.
>
> On Mon, Jun 2, 2008 at 8:49 PM, pablox <[hidden email]> wrote:
>
>>
>> Hi everybody, I still have this issue, I don't know if someone can help
>> me
>> with this it's very important.
>>
>> BTW I'm using grails 1.0.1
>>
>> thanks,
>> Pablo.
>>
>>
>> pablox wrote:
>> >
>> > Hi everyone,
>> > I have this domain class, I have added a mapping colsure to specify
>> that
>> > one fileld has to be blob (beacuse it is created as tinyblob on MySQL).
>> > So, when I want to save an Image I get an exception, does anyone know
>> > what's happening?
>> >
>> > thank you,
>> > Pablo Pazos Gutierrez
>> > www.SimpleWebPortal.net
>> >
>> > Exception:
>> >
>> > Message: [B cannot be cast to java.sql.Blob
>> > Caused by: java.lang.ClassCastException: [B cannot be cast to
>> > java.sql.Blob
>> > Class: Unknown
>> > At Line: [-1]
>> > Code Snippet:
>> >
>> > Stack trace:
>> > org.codehaus.groovy.runtime.InvokerInvocationException:
>> > java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
>> >       at
>> >
>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
>> >       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
>> >       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
>> >       at
>> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
>> >       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
>> >       at groovy.lang.Closure.call(Closure.java:292)
>> >       at groovy.lang.Closure.call(Closure.java:287)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(SimpleGrailsControllerHelper.java:525)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.executeAction(SimpleGrailsControllerHelper.java:398)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:237)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleURI(SimpleGrailsControllerHelper.java:153)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController.handleRequest(SimpleGrailsController.java:88)
>> >       at
>> >
>> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:251)
>> >       at
>> >
>> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
>> >       at
>> >
>> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
>> >       at
>> >
>> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
>> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>> >       at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
>> >       at
>> >
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> >       at
>> >
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> >       at
>> >
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>> >       at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> >       at
>> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
>> >       at
>> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:197)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:184)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:116)
>> >       at
>> >
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.parsePage(GrailsPageFilter.java:119)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:82)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:142)
>> >       at
>> >
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >       at
>> >
>> org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:68)
>> >       at
>> >
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >       at
>> >
>> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
>> >       at
>> >
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>> >       at
>> >
>> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
>> >       at
>> >
>> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
>> >       at
>> >
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
>> >       at
>> >
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> >       at
>> >
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> >       at
>> >
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>> >       at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> >       at
>> >
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> >       at org.mortbay.jetty.Server.handle(Server.java:295)
>> >       at
>> > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
>> >       at
>> >
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:841)
>> >       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:639)
>> >       at
>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
>> >       at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
>> >       at
>> >
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:361)
>> >       at
>> >
>> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
>> > Caused by: java.lang.ClassCastException: [B cannot be cast to
>> > java.sql.Blob
>> >       at $Proxy3.saveOrUpdate(Unknown Source)
>> >       at
>> >
>> amenities.AmenityController$_closure10.doCall(amenities.AmenityController:252)
>> >       at
>> >
>> amenities.AmenityController$_closure10.doCall(amenities.AmenityController)
>> >
>> > My domain class:
>> >
>> > class Image {
>> >     byte[] picture;
>> >
>> >     String mimeType;
>> >     long fileSize;
>> >
>> >     int compareTo(obj) {
>> >             id.compareTo(obj.id)
>> >     }
>> >
>> >     static mapping = {
>> >         columns {
>> >              picture(type:'blob')
>> >         }
>> >     }
>> > }
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problems-declaring-blob-on-mapping-closure-tp16332253p17609322.html
>> Sent from the grails - user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Problems-declaring-blob-on-mapping-closure-tp16332253p17610412.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Pablo Pazos
Are you getting this exception?

Message: [B cannot be cast to java.sql.Blob



Miguel Ping wrote
I had the same problem, so I manually changed the column type from tinyblob
to longblob.

On Mon, Jun 2, 2008 at 9:46 PM, pablox <pablo@mirigi.com> wrote:

>
> Hi, if I remove this the data is created as tinyblob in MySQL, so if I have
> more data than the data that can be stored in the tony blob I get another
> error.
>
> thanx
> Pablo.
>
>
>
> Miguel Ping wrote:
> >
> > Have you tried removing this part?
> >
> >>     static mapping = {
> >>         columns {
> >>              picture(type:'blob')
> >>         }
> >>     }
> >
> > I have binary data and didn't need to specify it in the mapping.
> >
> > On Mon, Jun 2, 2008 at 8:49 PM, pablox <pablo@mirigi.com> wrote:
> >
> >>
> >> Hi everybody, I still have this issue, I don't know if someone can help
> >> me
> >> with this it's very important.
> >>
> >> BTW I'm using grails 1.0.1
> >>
> >> thanks,
> >> Pablo.
> >>
> >>
> >> pablox wrote:
> >> >
> >> > Hi everyone,
> >> > I have this domain class, I have added a mapping colsure to specify
> >> that
> >> > one fileld has to be blob (beacuse it is created as tinyblob on
> MySQL).
> >> > So, when I want to save an Image I get an exception, does anyone know
> >> > what's happening?
> >> >
> >> > thank you,
> >> > Pablo Pazos Gutierrez
> >> > www.SimpleWebPortal.net
> >> >
> >> > Exception:
> >> >
> >> > Message: [B cannot be cast to java.sql.Blob
> >> > Caused by: java.lang.ClassCastException: [B cannot be cast to
> >> > java.sql.Blob
> >> > Class: Unknown
> >> > At Line: [-1]
> >> > Code Snippet:
> >> >
> >> > Stack trace:
> >> > org.codehaus.groovy.runtime.InvokerInvocationException:
> >> > java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
> >> >       at
> >> >
> >> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
> >> >       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
> >> >       at
> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
> >> >       at
> >> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
> >> >       at
> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
> >> >       at groovy.lang.Closure.call(Closure.java:292)
> >> >       at groovy.lang.Closure.call(Closure.java:287)
> >> >       at
> >> >
> >>
> ...
Reply | Threaded
Open this post in threaded view
|

Re: Problems declaring blob on mapping closure

Miguel Ping
Nope.

On Mon, Jun 2, 2008 at 11:10 PM, pablox <[hidden email]> wrote:

Are you getting this exception?

Message: [B cannot be cast to java.sql.Blob




Miguel Ping wrote:
>
> I had the same problem, so I manually changed the column type from
> tinyblob
> to longblob.
>
> On Mon, Jun 2, 2008 at 9:46 PM, pablox <[hidden email]> wrote:
>
>>
>> Hi, if I remove this the data is created as tinyblob in MySQL, so if I
>> have
>> more data than the data that can be stored in the tony blob I get another
>> error.
>>
>> thanx
>> Pablo.
>>
>>
>>
>> Miguel Ping wrote:
>> >
>> > Have you tried removing this part?
>> >
>> >>     static mapping = {
>> >>         columns {
>> >>              picture(type:'blob')
>> >>         }
>> >>     }
>> >
>> > I have binary data and didn't need to specify it in the mapping.
>> >
>> > On Mon, Jun 2, 2008 at 8:49 PM, pablox <[hidden email]> wrote:
>> >
>> >>
>> >> Hi everybody, I still have this issue, I don't know if someone can
>> help
>> >> me
>> >> with this it's very important.
>> >>
>> >> BTW I'm using grails 1.0.1
>> >>
>> >> thanks,
>> >> Pablo.
>> >>
>> >>
>> >> pablox wrote:
>> >> >
>> >> > Hi everyone,
>> >> > I have this domain class, I have added a mapping colsure to specify
>> >> that
>> >> > one fileld has to be blob (beacuse it is created as tinyblob on
>> MySQL).
>> >> > So, when I want to save an Image I get an exception, does anyone
>> know
>> >> > what's happening?
>> >> >
>> >> > thank you,
>> >> > Pablo Pazos Gutierrez
>> >> > www.SimpleWebPortal.net
>> >> >
>> >> > Exception:
>> >> >
>> >> > Message: [B cannot be cast to java.sql.Blob
>> >> > Caused by: java.lang.ClassCastException: [B cannot be cast to
>> >> > java.sql.Blob
>> >> > Class: Unknown
>> >> > At Line: [-1]
>> >> > Code Snippet:
>> >> >
>> >> > Stack trace:
>> >> > org.codehaus.groovy.runtime.InvokerInvocationException:
>> >> > java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
>> >> >       at
>> >> >
>> >>
>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
>> >> >       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
>> >> >       at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
>> >> >       at
>> >> groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:946)
>> >> >       at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
>> >> >       at groovy.lang.Closure.call(Closure.java:292)
>> >> >       at groovy.lang.Closure.call(Closure.java:287)
>> >> >       at
>> >> >
>> >>
>> ...
>
>

--
View this message in context: http://www.nabble.com/Problems-declaring-blob-on-mapping-closure-tp16332253p17611947.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email