WebTimer help...


[code]dim mv as MessageView


mv = new MessageView

System.DebugLog(“MessageView created”)[/code]

Does it still get to “MessageView created” ?

May 26 14:03:14 test[46753] <Warning>: >AddMessage May 26 14:03:14 test[46753] <Warning>: An exception of type xojo.Core.BadDataException was caught. May 26 14:03:14 test[46753] <Warning>: String must have a known encoding

What did you change to get another line of error message? The change I proposed? Above your post?

Did you implement MessageView ? If so look in the constructor (or whatever they are called in xojo) of that. Check that Message is sending the same data type to MessageView (is a string and not text) etc

If its not your code, contact the author.

I implemented MessageView.
There are no constructors in that class except the default constructors.

Here is the stack trace:

>AddMessage An exception of type xojo.Core.BadDataException was caught. String must have a known encoding String must have a known encoding rbframework.dylib$2112 String_ToText String.$ToText%y%s _WebSupport.Split%A1s%ss WebSource.Append%%o<WebSource>si8b WebLabel.Event_RenderPropertyChange%b%o<WebLabel>svo<WebSource> WebTextControl.Event_RenderPropertyChange%b%o<WebTextControl>svo<WebSource> WebControl.Event_RenderPropertyChange%b%o<WebControl>svo<WebSource> WebObject._Render%o<WebSource>%o<WebObject>i8 WebView.Event_RenderChildrenJavascript%o<WebSource>%o<WebView> WebControl.Event_RenderChildrenJavascript%o<WebSource>%o<WebControl> WebObject._Render%o<WebSource>%o<WebObject>i8 WebView.Event_RenderChildrenJavascript%o<WebSource>%o<WebView> WebControl.Event_RenderChildrenJavascript%o<WebSource>%o<WebControl> WebObject._Render%o<WebSource>%o<WebObject>i8 WebSession._CreateResponse%o<WebResponse>%o<WebSession> WebPushHandler.Respond%%o<WebPushHandler> WebPushHandler.!PushBySession%%o<WebSession> WebSession._Update%%o<WebSession> WebCanvas._UpdateCanvasSize%%o<WebCanvas> WebCanvas.Event_Resized%%o<WebCanvas> WebControl._SetDimensions%%o<WebControl>i8i8i8i8&A1o<WebControl> MessageView.MessageView.Constructor%%o<MessageView.MessageView> UMLSequenceController.AddMessage%%o<UMLSequenceController>o<Message> WebPageMain.WebPageMain.ProcessFile%%o<WebPageMain.WebPageMain> WebPageMain.WebPageMain.FilesUploadedMethod%%o<WebPageMain.WebPageMain>o<FileSelectContainerControl.FileSelectContainerControl>A1sA1v Delegate.IM_Invoke%%o<FileSelectContainerControl.FileSelectContainerControl>A1sA1v AddHandler.Stub.40%%A1sA1v FileSelectContainerControl.FileSelectContainerControl.FileUploader_UploadComplete%%o<FileSelectContainerControl.FileSelectContainerControl>o<WebFileUploader>A1o<WebUploadedFile> Delegate.IM_Invoke%%o<WebFileUploader>A1o<WebUploadedFile> AddHandler.Stub.32%%A1o<WebUploadedFile> WebFileUploader._SetFiles%%o<WebFileUploader>A1o<WebUploadedFile> WebSession._HandleRequest%i8%o<WebSession>so<_HTTPServer.HTTPRequestContext> WebApplication._HandleHTTPRequest%%o<WebApplication>o<_HTTPServer.HTTPRequestContext> _HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread> rbframework.dylib$1192 _pthread_body


[code]dim mv as MessageView


mv = new MessageView

System.DebugLog(“MessageView created”)[/code]

Does it still get to “MessageView created” ?[/quote]

Did you try this? What was the debug output after this?

Please see the code posted above Julian, as I did follow your suggestion of added a debug message after each statement in the method. This is how I have come to the conclusion that something in the constructor was causing issues.
The dim t as MessageView did NOT cause an exception.

However the stack trace leads me to believe that the error is most likely only caught within that method.

I suspect that a something prior to this is the actual culprit.

csvData = file.Data

Where file IsA WebUploadedFile object and csvData is simply a string.

I suspect that I am suppose to have specified the encoding of the string.

Sorry, I wanted you to split the definition of mv away from the allocation of a new object to mv which is happening in the same line in your code.

So you have no code in the constructors for MessaveView yet it errors on the following line?

mv = new MessageView



dim t as MessageView
dim mv as new MessageView

Outputted 1 and 2 then there was an exception.

Well I think I’ve narrowed it down to the line of code that caused all this havoc!

//csvData = file.Data // this is bad in 64 bit. csvData = file.Data.StringValue(0, file.Data.Size) // This is ok

In 32 bit doesn’t matter.
However in 64 bit it matters.

However I’ve lost mouse events now that I am no longer throwing the xojo.Core.BadDataException…
So I’m a little further along, but still broken.

I don’t know what to do now…

However maybe this still has something to do with Encoding … Again hard to tell… It’s very difficult to know why my mouse events would be lost in my WebListBoxes.

Ok, so csvData looks like it’s of type “Text”. And file.data is a Memoryblock. Because Memoryblock has an implicit conversion to String, it is actually trying to do the conversion directly:

memoryblock -> string -> Text

I believe the difference between the first and second lines is that StringValue does actually result in a string with an encoding… Which is required for the conversion to Text. Normally you’d see this with code like StringValue.ToText when the string has no encoding, but because there are several layers of implicit conversions going on, the exception is hidden inside.

Well I thought I’d narrowed it down but it appears not.
At this point it seems more likely to be the FileNames(0) from a WebFileUploader.
Other people are saying it’s because of the split function I use in my code.