dart-drivers / mysql

MySQL Connector for Dart
Other
99 stars 38 forks source link

Uncaought Error: The null object does not have a method 'readBuffer'. #36

Closed zoechi closed 10 years ago

zoechi commented 10 years ago

DB access worked already (great package BTW) but since today I get an exception - see below: It might have been caused by Dart/package/MySQL updates/app code changes. I worked on other parts of the app for a few days, and didn't run the part with DB access since.

The exception occurred first with the published package then I changed my dependency to point to your Github repo, but that didn't change anything.

It's hard to debug because the DartEditor (Dart VM version: 1.3.0-dev.1.1 (Sun Mar 2 01:25:45 2014) on "linux_x64") I use currently doesn't highlight the correct line while debugging :-( In the whole stack trace doesn't show a reference to my custom code so I thought I ask here ;-).

Any idea?

2014.47.04 15:47:33.261 bwu_entity_designer_server.db.mysql [FINE]: synchronizeSchema: schema: BWU_ENTITY_DESIGNER_MODEL
2014.47.04 15:47:33.277 bwu_entity_designer_server.db.mysql [FINE]: checkSchemaExists: schema: BWU_ENTITY_DESIGNER_MODEL
2014.47.04 15:47:34.716 Query   [FINE]: Getting prepared query for: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ?;
2014.47.04 15:47:34.718 ConnectionPool  [FINEST]:   Getting a connection
2014.47.04 15:47:34.722 ConnectionPool  [FINEST]:   Number of in-use connections: 0
2014.47.04 15:47:34.723 ConnectionPool  [FINEST]:   Creating new pooled cnx#0
2014.47.04 15:47:34.728 Connection.Lifecycle    [FINEST]:   Use connection #0
2014.47.04 15:47:34.731 Connection  [FINE]: opening connection to 127.0.0.1:3306/null
2014.47.04 15:47:34.783 BufferedSocket  [FINE]: READ data
2014.47.04 15:47:34.783 BufferedSocket  [FINE]: READ data: no buffer
2014.47.04 15:47:34.783 Connection  [FINE]: readPacket readyForHeader=true
2014.47.04 15:47:39.853 BufferedSocket  [FINE]: WRITE data
Uncaught Error: The null object does not have a method 'readBuffer'.

NoSuchMethodError: method not found: 'readBuffer'
Receiver: null
Arguments: [Instance of 'Buffer']
Stack Trace: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1      _readPacket (package:sqljocky/src/connection.dart:119:25)
#2      _onData (package:sqljocky/src/buffered_socket.dart:81:22)
#3      _rootRunUnary (dart:async/zone.dart:717)
#4      _RootZone.runUnary (dart:async/zone.dart:854)
#5      _BaseZone.runUnaryGuarded (dart:async/zone.dart:569)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:333)
#7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263)
#8      _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:529)
#9      _StreamController._add (dart:async/stream_controller.dart:438)
#10     _StreamController.add (dart:async/stream_controller.dart:395)
#11     _RawSocket._RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:987)
#12     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:580)
#13     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#14     _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#15     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:119)

Unhandled exception:
The null object does not have a method 'readBuffer'.

NoSuchMethodError: method not found: 'readBuffer'
Receiver: null
Arguments: [Instance of 'Buffer']
#0      _rootHandleUncaughtError.<anonymous closure>.<anonymous closure> (dart:async/zone.dart:700)
#1      _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#2      _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#3      _asyncRunCallback (dart:async/schedule_microtask.dart:36)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:119)
jamesots commented 10 years ago

I got that error for the first time last night. It looks like its something to do with the 1.3 dev build of the SDK — I just tried with Dart 1.2 and it still works.

jamesots commented 10 years ago

Didn't mean to click on close.

zoechi commented 10 years ago

Thanks a lot for your quick response! Great, that indicates that I haven't introduced it with my code changes ;-) It's my first project with SqlJocky and I'm not yet very confident that it's correct how I use it but as mentioned, some things worked fine already (select, create table).

jamesots commented 10 years ago

This is now fixed.

zoechi commented 10 years ago

Great! works again. Thanks a lot!