[Spacewalk-list] <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: [B cannot be cast to java.sql.Blob'>

john miller johnmille1 at gmail.com
Mon Mar 12 16:54:17 UTC 2012


Today I poked around at
com.redhat.rhn.frontend.xmlrpc.system.SystemHandler.listSystemEvents(SystemHandler.java:2120).
Looks like the error happens when a system has a config file difference
action. I confirmed by running my script successfully against a system that
does not have a config difference. Also explains why the script ran one day
and not the next as I have night config differences scheduled.

looks like this is still a problem in 1.7 ( I am on 1.6):

2117<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2117>
                   else {
2118<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2118>
                       // if there wasn't an error, check to see if
there was a difference
2119<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2119>
                       // detected...
2120<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2120>
                       Blob blob = (Blob) file.get("diff");
2121<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2121>
                       if (blob != null) {
2122<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2122>
                           String diff =
HibernateFactory.blobToString(blob);
2123<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2123>
                           info.put("result", diff);
2124<http://git.fedorahosted.org/git?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java;h=40ec5de419ff913753108a8b0cfc5fc606d5a574;hb=SPACEWALK-1.6#l2124>
                       }

I will have to look at the data again but I think it could be returned
directly as a string instead of doing the sql blob thing.


On Fri, Mar 9, 2012 at 7:12 PM, john miller <johnmille1 at gmail.com> wrote:

> Using spacewalk 1.6 I am getting an error using the listSystemEvents.
>
> The error:
> <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: [B
> cannot be cast to java.sql.Blob'>
>
> My script:
> #!/usr/bin/python
> import xmlrpclib
> import pprint
>
> pp = pprint.PrettyPrinter(indent=4)
> SATELLITE_URL = "http://localhost/rpc/api"
> SATELLITE_LOGIN = "script"
> SATELLITE_PASSWORD = "scriptpassword"
> client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
>
> key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
> systemEvents = client.system.listSystemEvents(key,1000010107)
> pp.pprint(systemEvents)
>
> client.auth.logout(key)
>
> The full output:
>
> Traceback (most recent call last):
>   File "./repeat316Test.py", line 12, in <module>
>     systemEvents = client.system.listSystemEvents(key,1000010107)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1570, in __request
>     verbose=self.__verbose
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
>     return self.single_request(host, handler, request_body, verbose)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1297, in single_request
>     return self.parse_response(response)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1468, in parse_response
>     return u.close()
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 793, in close
>     raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled
> internal exception: [B cannot be cast to java.sql.Blob'>
>
>
> from /var/log/tomcat6/catalina.out:
>
> 2012-03-09 19:00:19,407 [TP-Processor7] ERROR
> com.redhat.rhn.frontend.xmlrpc.BaseHandler - Caused by:
> java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
>         at
> com.redhat.rhn.frontend.xmlrpc.system.SystemHandler.listSystemEvents(SystemHandler.java:2120)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:616)
>         at
> com.redhat.rhn.frontend.xmlrpc.BaseHandler.invoke(BaseHandler.java:108)
>         at
> redstone.xmlrpc.XmlRpcDispatcher.dispatch(XmlRpcDispatcher.java:123)
>         at
> com.redhat.rhn.frontend.xmlrpc.RhnXmlRpcServer.execute(RhnXmlRpcServer.java:54)
>         at
> com.redhat.rhn.frontend.xmlrpc.XmlRpcServlet.doPost(XmlRpcServlet.java:162)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
>         at
> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:108)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:55)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>         at
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
>         at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
>         at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
>         at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
>         at
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
>         at java.lang.Thread.run(Thread.java:679)
> Mar 9, 2012 7:00:19 PM redstone.xmlrpc.XmlRpcDispatcher writeError
> WARNING: redstone.xmlrpc.XmlRpcFault: unhandled internal exception: [B
> cannot be cast to java.sql.Blob
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20120312/97221dfb/attachment.htm>


More information about the Spacewalk-list mailing list