I'm connecting eclipse to neo4j.. And I have 10k values and for small values its working fine.. For 10k values I'm getting this error,
Exception in thread "main"
org.neo4j.driver.v1.exceptions.ClientException: Unable to read
response from server: Expected a string, but got: 0x1
Related
I want to write a simple app to save messages in the Iota-Tangle and read them again.
How should I configure the API so that the messages are visible in the mainnet or devnet (Tangle Explorer) after I send them ?
that means, I just want to send a message / transaction, and then see it in the tangle at https://thetangle.org/...
i hope there is someone here who knows about iota-
this Api-config does not work..
IotaAPI api = new IotaAPI.Builder()
.protocol("https")
.host("thetangle.org")
.port(443)
.localPoW(new PearlDiverLocalPoW())
.build();
SendTransferResponse response = api.sendTransfer( ...... );
And I get this Error
Execution of the API call raised exception. IOTA Node not reachable?
com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1597)
at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1404)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:593)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:206)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:39)
at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:225)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:188)
at org.iota.jota.connection.HttpConnector.wrapCheckedException(HttpConnector.java:244)
at org.iota.jota.connection.HttpConnector.getTransactionsToApprove(HttpConnector.java:333)
at org.iota.jota.IotaAPICore.getTransactionsToApprove(IotaAPICore.java:449)
at org.iota.jota.IotaAPI.sendTrytes(IotaAPI.java:344)
at org.iota.jota.IotaAPI.sendTransfer(IotaAPI.java:1126)
at com.example.iota_experiment_3.Main.main(Main.java:60)
Exception in thread "main" java.lang.IllegalStateException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
at org.iota.jota.connection.HttpConnector.wrapCheckedException(HttpConnector.java:272)
at org.iota.jota.connection.HttpConnector.getTransactionsToApprove(HttpConnector.java:333)
at org.iota.jota.IotaAPICore.getTransactionsToApprove(IotaAPICore.java:449)
at org.iota.jota.IotaAPI.sendTrytes(IotaAPI.java:344)
at org.iota.jota.IotaAPI.sendTransfer(IotaAPI.java:1126)
at com.example.iota_experiment_3.Main.main(Main.java:60)
I use SpringBoot and Jersey into my project and I often tackle the following error :
[ERROR - ServerRuntime$Responder - 2018-02-13 13:16:45,983] An I/O error has occurred while writing a response message entity to the container output stream.
org.glassfish.jersey.server.internal.process.MappableException: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92)
at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:711)
at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:444)
at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:434)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:329)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
It results with a 503 status response to my client.
Could you explain me why this error occured ?
Thanks
This kind of error usually happens servlet is writing data back on the stream and connection closed from client side.
It is like server in sending some data may be file, string, bytes etc.. but on client side like a browser has closed the connection, like you close the browser tab.
It cased early End of file exception on the server.
I have had this exception when I accidentally passed a null Response at the end of a call. You can verify this in the'caused by' section following the first exception:
Caused by: org.eclipse.jetty.io.EofException: null
I got this error when trying to get a connection with my H2 database in my Java app.
org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: rowcount remaining=3 SYS" [50000-170]
Googling it I found some indications that my database may have corrupted. So, as the H2 docs[1] says, there is a recovery tool to restore corrupted databases by executing this on command line:
java -cp h2*.jar org.h2.tools.Recover
The problem is that I got a lot of errors then:
...
Error: java.lang.ArrayIndexOutOfBoundsException
Error: java.lang.NegativeArraySizeException
Error: java.lang.ArrayIndexOutOfBoundsException
...
The .sql file generated starts with this line:
// error: org.h2.message.DbException: Encryption error in file "C:/test/testdata.h2.db" [90049-170]
And then continues with thousands of commented lines of error:
-- pageSize: 898638978 writeVersion: 76 readVersion: 89
-- ERROR: page size; using 2048
-- head 1: writeCounter: -6011171782251773310 log -1342746462:2067436818/892099140 crc 1787578286 (expected: -1599867117)
-- head 2: writeCounter: -5218598065026680826 log 1157017086:-975711878/-1815014411 crc 1294221878 (expected: -1302067923)
-- log 0:0/0
and so on...
Does anyone know how I can recover my database?
[1]http://www.h2database.com/html/advanced.html#using_recover_tool
I had a working Apache James mail server up and running, but just converted it to use a MySQL database instead of the filesystem.
It created (some) the tables, but it won't write to them. This makes it not deliver any mail.
Since it will interact with the database and insert users, I think I have my database data-source and user configured correctly...
<data-source name="maildb" class="org.apache.james.util.dbcp.JdbcDataSource">
<driver>com.mysql.jdbc.Driver</driver>
<dburl>jdbc:mysql://127.0.0.1/james</dburl>
<user>xxxx</user>
<password>yyyy</password>
<max>20</max>
</data-source>
But when I try to send an email, I get no error from the client, but I get nothing in the database in any table.
All I get is this error on James console...
exception! javax.mail.MessagingException: Exception caught while storing mail Container: ;
nested exception is:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'last_updated' at row 1
Here's the full stack trace from mailet log...
10/12/14 16:23:18 INFO James.Mailet: Error while storing mail.
javax.mail.MessagingException: Exception caught while storing mail Container: ;
nested exception is:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'last_updated' at row 1
at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:764)
at org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiRepository.java:230)
at org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiRepository.java:154)
at org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:66)
at org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)
at org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:405)
at org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '' for column 'last_updated' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2973)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1129)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:681)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:803)
at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
at org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:752)
10/12/14 16:23:18 INFO James.Mailet: ToRepository: Storing mail Mail1418257398530-1 in dbfile://maildb/deadletter/error
Here is how I specified the repository...
<mailet match="All" class="ToRepository">
<repositoryPath> db://maildb/deadletter/error </repositoryPath>
</mailet>
Since it seems to be complaining about an empty last_updated datetime, I made that column null allowed, but that didn't help.
I'm not changing the java in any way, so there shouldn't be anything I messed up. I don't even know where it gets the datetime.
Can anyone see something I've missed?
Solved: I found an obscure post in the Apache bug archives that mentions adding this parm...
<dburl>jdbc:mysql://127.0.0.1/james?useServerPrepStmts=false</dburl>
...to the data-source area. Actually, the post says to add 2 parms here, but I found that it will only accept one parm.
I don't know how I was supposed to know about those parms or what they do, but this made everything magically work. Sometimes using open source software teaches you more about researching than programming.
My CF9 application running on a windows server pops mail. When I attempt to retrieve the entire body of the message, I sometimes get the following error...
Error:
An exception occurred while retrieving mail.
The cause of this exception was: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.internet.MimeBodyPart.
Location:
Line 335 in controllers\Submissions.cfc
Not sure if this is pertinent, but FYI every message will have an image attached and the whole process usually works fine. This problem is intermittent.
My Questions
Any idea what causes this?
Any idea how to catch and resolve this issue?
I suspect I'll need to drop down into java, but not sure where to start.
Code Fragments
<cfscript>
// setup variables array for all cfpop calls
CFPopAttributes = {
server = request.pop.server,
port = request.pop.port,
username = request.pop.username,
password = request.pop.password,
timeout = 300
};
</cfscript>
<cfpop
action="getall"
name="entireEmail"
uid="#uid#"
attachmentpath="#originalsPath#"
attributecollection="#CFPopAttributes#" // Line 335
generateuniquefilenames="true"
/>
NOTE: I added the comment "Line 335" above to communicate exactly where in the code the template is breaking. If I move the attributecollection up or down (before/after other attributes), the error always breaks at the attributecollection line.
Stack Trace
struct [Filtered - 1 of 8 keys hidden]
Detail: An exception occurred while invoking an event handler method from Application.cfc. The method name is: onRequest.
Message: Event handler exception.
RootCause:
[struct]
Detail: The cause of this exception was: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.internet.MimeBodyPart.
Message: An exception occurred while retrieving mail.
RootCause:
[struct]
Message: javax.mail.internet.MimeMessage cannot be cast to javax.mail.internet.MimeBodyPart
StackTrace: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.internet.MimeBodyPart
at coldfusion.mail.EmailTable.getAttachmentName(EmailTable.java:819)
at coldfusion.mail.EmailTable.populate(EmailTable.java:283)
at coldfusion.mail.PopImpl.getMails(PopImpl.java:241)
at coldfusion.tagext.net.PopTag$1.run(PopTag.java:433)
at java.security.AccessController.doPrivileged(Native Method)
at coldfusion.tagext.net.PopTag.doStartTag(PopTag.java:429)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)
at cfSubmissions2ecfc1952269377$funcGETEMAIL.runFunction(D:\home\wwwroot\controllers\Submissions.cfc:335)