Error #2030: End of file was encountered? - actionscript-3

I'm having this problem when i want to send using socket a message...
textField.addEventListener(KeyboardEvent.KEY_DOWN,enterHandler);
function enterHandler(event:KeyboardEvent):void{
if(event.keyCode == Keyboard.ENTER ){
socket.writeUTF(textField.text);
socket.flush();
trace(textField.text); //the output is what input text is, so the input field is right
}
}
The error is this :
Error: Error #2030: End of file was encountered.
at flash.utils::ByteArray/readUnsignedByte()
at socket_fla::MainTimeline/closeListener()
Any Idea?
Edit:
After checking the Java server (RedDwarf) that the client is connected to, it shows that the Message is received, then SEVERE: unknown opcode 0x61
Tried googling it, nothing..

this question may be caused when you haven't addEventListener(ProgressEvent.SOCKET_DATA, data) on the socket in the server. you must read data after you have already got it.

Related

The web3 JSON-RPC error message is not clearly, how to decode it?

When I ran a web3 function at Remix, it show me the full error message, then I can easily to debug and fix. But when I called function from my own frontend and Metamask, the error message is not clearly. You can check it here https://imgur.com/a/QS4q0ER ( pic1: remix, pic2: metamask )
By using estimateGas (https://ethereum.stackexchange.com/questions/21654/correct-syntax-for-estimating-gas-cost-of-a-function-in-web3/21765#21765) I can get the error message. But it's not clearly. I tried to decode data field. The result here https://i.imgur.com/8r3eF18.png . I can see the error message here, but not exactly in right format.
Please help me to decode the error message, using this hex string :
0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000017707269636520736c697070616765206465746563746564000000000000000000
Found it.
web3.eth.abi.encodeFunctionSignature('Error(string)') = '0x08c379a0'
Remove 0x08c379a0 in data string, and decode it:
web3.eth.abi.decodeParameter('string', '00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000017707269636520736c697070616765206465746563746564000000000000000000') = 'price slippage detected'

a session error after updating to laravel 5.4

After updating from laravel 5.3 to 5.4, I encountered an error in vendor. The error is:
Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Session\Store::set() in /var/www/ostadbank.com/vendor/laravel/framework/src/Illuminate/Support/Manager.php:137
But when I go to my error is:
fatal error exception in Manager.php line 137:call to undefined method Illuminate\session\store::set()
I go to manager.php line 137 and I see the line below:
public function __call($method, $parameters) { return $this->driver()->$method(...$parameters); }
I am not sure where to start to modify.
See the screenshots below:
I solve it, for more information read this: https://laravel.com/docs/5.4/upgrade
All calls to the ->set() method should be changed to ->put(). Typically, Laravel applications would never call the set method since it has never been documented within the Laravel documentation. However, it is included here out of caution.

MailCore2 MCHTMLCleaner error

While using MailCore2, I started getting an error in MCHTMLCleaner.cc and method HTMLCleaner::cleanHTML. The specific line that is throwing the error is:
rc = tidySetErrorBuffer(tdoc, &errbuf);
and the error being printed is:
'Assertion failed: (option_defs[ optId ].type == TidyInteger), function SetOptionInt, file ../../src/config.c, line 381'
In config.c on line 381 is:
Bool status = ( optId < N_TIDY_OPTIONS );
Occasionally, this will crash the app, which seems contrary to the entire idea of a try/catch block that would make the most sense here.
More often than not, this code/file will not stop the app and instead just print out an error.
What is causing this to crash? Has anyone else experienced this? IS the HTML actually being cleaned or is nothing being returned for you?
Here is a link to the specific file in question on GitHub.

Grails transaction never completes

Consider the code below, that tries to create a new SerpKeyword within a transaction and prints to the console to show where it is.
if (!serpKeyword) {
println "I DIDN'T FIND THE KEYWORD!"
SerpKeyword.withNewTransaction {
println "SO NOW I'M BEGINNING A TRANSACTION"
serpKeyword = new SerpKeyword(
keyword: searchKeyword,
geoKeyword: geoKeyword,
concatenation: concatenation,
locale: locale
)
println "NOW I'LL SAVE THE KEYWORD"
serpKeyword.save(failOnError: true, flush: true)
println "AND NOW THE KEYWORD IS SAVED"
}
}
The console output I see right away is:
I DIDN'T FIND THE KEYWORD!
SO NOW I'M BEGINNING A TRANSACTION
NOW I'LL SAVE THE KEYWORD
I never see the last line of my output, indicating that the record never saves. I've tried this both with and without the options that I'm passing into save. Regardless, it just hangs for a while, and eventually I get this stacktrace:
Got error -1 from storage engine. Stacktrace follows:
java.sql.SQLException: Got error -1 from storage engine
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at com.reachlocal.grails.sales.AdvertiserConnectionService$_findOrCreateSerpKeyword_closure9$$EO2A9QHA.doCall(AdvertiserConnectionService.groovy:624)
at org.grails.datastore.gorm.GormStaticApi.withNewTransaction(GormStaticApi.groovy:696)
at com.reachlocal.grails.sales.AdvertiserConnectionService$$EO2A9QHA.findOrCreateSerpKeyword(AdvertiserConnectionService.groovy:615)
at com.reachlocal.grails.sales.AdvertiserConnectionService$$EO2A9QHA.createSerpEntryForKeyword(AdvertiserConnectionService.groovy:659)
at com.reachlocal.grails.sales.AdvertiserConnectionService$$EO2A9QHA.addKeyword(AdvertiserConnectionService.groovy:51)
at com.reachlocal.grails.serp.SerpController$_closure9.doCall(SerpController.groovy:77)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:65)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
What gives?
You may get the "Got error -1 from storage engine" for several reasons:
Your database is out of disk space
You have the innodb_force_recovery switch in your my.cnf file
Mismatched MySQL tablespace ids.
The best way to troubleshoot this issue is to take a look at the MySQL error log
Do you have the id generation strategy set as assigned any thing other than a sequence/auto in the domain class serpKeyword?
It will be helpful to debug if you can add the domain class in the post as well.

What could cause "Invalid assignment left-hand side." error message that doesn't show line number?

This error appeared when running functions that had not been altered since they had last run successfully and, when moved to another project, ran without generating any error messages.
The error message appeared no matter which function was run and even persisted when I got to the stage of removing all but the simple function below from the project:
function foo() {
Logger.log('bar');
}
Usually that error message gives a line number but it didn't in this case.
What could cause that?
In my case it was a wrong assignment in an if statement
WRONG CODE
if (tasks[ti].hasOwnProperty("category") && tasks[ti].hasOwnProperty("opportunityId") && tasks[ti].category="Meeting" && now.getYear()==closingYear && now.getMonth()==closingMonth ){
// ^^ right there, should be comparison
closedMeetings.push(tasks[ti]);
}
RIGHT CODE
if (tasks[ti].hasOwnProperty("category") && tasks[ti].hasOwnProperty("opportunityId") && tasks[ti].category=="Meeting" && now.getYear()==closingYear && now.getMonth()==closingMonth ){
closedMeetings.push(tasks[ti]);
}
The awful part was that it said the mistake was on Line 1 and this code was at line 236
The error was actually in a library that was referenced as a resource by the project. I initially thought I had ruled that out by commenting out the library function but not so.
Presumably the lack of a line number should have been a hint that the error was in an external resource. I'll know in future.
I'm answering my own question in the hope that it will save someone wasting the amount of time I've just wasted trying to locate the source of the problem.