POST to Spring/Hibernate backend with Postgres - postgresql

I'm trying to send this JSON to my Java backend
{
"title": "TITOLO",
"description": "DESCRIZIONE",
"mediaType": "MEDIATYPE"
}
but for some reasons, I cannot write it correctly to my DB. Some teammates can do it without problems but I get this error from Postman:
{
"timestamp": 1526753419760,
"status": 500,
"error": "Internal Server Error",
"message": "Type definition error: [simple type, class isssr.ticketsystem.entity.Ticket]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `isssr.ticketsystem.entity.Ticket` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (PushbackInputStream); line: 2, column: 2]",
"path": "/ticketsystem/ticket"
}
I wrote on their local DB without problems but they cannot do the same to mine.
Why this?
My OS is MacOS X High Sierra 10.13.4, using as IDE Intellij IDEA.
UPDATE
Problem was Java 10.
With a downgrade to Java 8, all works fine.

Related

Azure Service Fabric gets terminated in local cluster when running tests

So we are using Azure Service Fabric and gets a weird behavior when trying to run API tests against my local development cluster.
Every time I start the test the app gets terminated, sometimes it gets restarted again but most often it just stays terminated (and even deleted from the cluster).
I guess its somehow connected against that when I run the API test it will run and build stuff that the service fabric is using, but since the outcome is different depending on something (maybe the sun?) it feels like I am either missing something or experience a bug with service fabric.
Do anyone have any idea? Consider me as a noob and assume that I have done something wrong myself (I am doing that atleast).
UPDATE
There was a question on how we do run our tests:
Starts 2 instances of Visual Studio
Open the same .sln in both of them
Start the Service Fabric project.
Wait until cluster reports OK.
Run api test through a unit test (both service bus tests and REST tests) with Resharper test runner
Now we get the messages that is attached in diagnostics.
Diagnostics:
Event #1
{
"Timestamp": "2018-10-16T08:14:03.0590414+02:00",
"ProviderName": "Microsoft-ServiceFabric",
"Id": 23083,
"Message": ApplicationHostTerminated: ApplicationId=fabric:/<MyService>, ServiceName=fabric:/<MyService>, ServicePackageName=<MyPackage>, ServicePackageActivationId=8f36ac97-9271-4a49-94ce-dd296aebffa5, IsExclusive=True, CodePackageName=Code, EntryPointType=Exe, ExeName=MyExe, ProcessId=24568, HostId=d2a820b5-5b4d-42af-ae87-350028a3fa72, ExitCode=3221225786, UnexpectedTermination=False, StartTime=10/16/2018 08:12:14. ",
"ProcessId": 22660,
"Level": "Informational",
"Keywords": "0x4000000000000001",
"EventName": "Hosting",
"ActivityID": null,
"RelatedActivityID": null,
"Payload": {
"eventInstanceId": "\"07f15452-2f75-49e3-ad5d-d16ea49bdc8f\"",
"applicationName": "MyAppName",
"ServiceName": "fabric:/MyServiceName",
"ServicePackageName": "MyPackageName",
"ServicePackageActivationId": "8f36ac97-9271-4a49-94ce-dd296aebffa5",
"IsExclusive": true,
"CodePackageName": "Code",
"EntryPointType": 1,
"ExeName": "MyExe",
"ProcessId": 24568,
"HostId": "d2a820b5-5b4d-42af-ae87-350028a3fa72",
"ExitCode": 3221225786,
"UnexpectedTermination": false,
"StartTime": "\"\/Date(1539670334917)\/\""
}
}
Event #2
{
"Timestamp": "2018-10-16T08:14:02.3557708+02:00",
"ProviderName": "Microsoft-ServiceFabric",
"Id": 29625,
"Message": "Application deleted: Application = fabric:/MyApp, Application Type = MyServiceType ",
"ProcessId": 22660,
"Level": "Informational",
"Keywords": "0x4000000000000001",
"EventName": "CM",
"ActivityID": null,
"RelatedActivityID": null,
"Payload": {
"eventInstanceId": "\"ca608cec-8d55-4606-a331-8ebfcfff8fa6\"",
"applicationName": "fabric:/MyAppName",
"applicationTypeName": "MyAppTypeName",
"applicationTypeVersion": "1.0.0"
}
}
I think you can experience a side effect of Application Debug Mode set for your .sfproj.
By default Application Debug Mode is set to Refresh Application (which if you are using 5-node cluster is automatically changed to Remove Application) or Remove Application debug mode. This instructs Visual Studio to recreate the application for each debugging session and remove it when session ends.
Changing it to Keep Application should prevent the Visual Studio from recreating the application during debugging session.

Untrackable Error: Unrecognized field "notBefore" (class org.keycloak.representations.idm.UserRepresentation)

I hope you can help me out here. I need to relaunch a project again after the development got stopped about half a year ago. It consists out of different microservices. Mainly a Scala Swagger API based on the Play framework. But for securing their application and the users they are using keycloak.
While fetching the user profile the following internal server error occurs:
"javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "notBefore" (class org.keycloak.representations.idm.UserRepresentation), not marked as ignorable
(24 known properties: "disableableCredentialTypes", "enabled", "emailVerified", "origin", "self", "applicationRoles", "createdTimestamp", "clientRoles", "groups", "username", "totp", "id", "email", "federationLink", "serviceAccountClientId", "lastName", "clientConsents", "socialLinks", "realmRoles", "attributes", "firstName", "credentials", "requiredActions", "federatedIdentities"])
at [Source: org.apache.http.conn.EofSensorInputStream#3101000d; line: 1, column: 369] (through reference chain: org.keycloak.representations.idm.UserRepresentation["notBefore"])"
At other endpoints I get a similiar error as this one, except there is another field missing in the definition.
The Keycloak server runs on version 3.4.0.Final and the dependecies are all to version 3.4.0.Final upgraded.
keycloak-services
keycloak-admin-client
keycloak-adapter-core
keycloak-authz-client
Can anyone help me out?
Thanks in advance
Solution
My docker-images did not pull the current version. So the dependencies stayed as the were in my running environment.

Azure Rest Api recommendedElasticPools always returns Internal Server Error 500, Is there anyone facing this issue?

When I tried other rest apis for Azure Mangement, it works without any issue. But when I try this recommendedElasticPools , I am getting internal server error all times.
{
"code": "InternalServerError",
"message": "There was an internal server error that occurred during this request.",
"target": null,
"details": [],
"innererror": []
}
We had a problem with this API that should be fixed now. Thanks for reporting this. The API you were calling is on the deprecation path and I recommend using new API instead:
/subscriptions/{SubscriptionId}/resourcegroups/{GroupName}/providers/Microsoft.sql/servers/{ServerName}/elasticPoolEstimates/

Can not restore backup to target instance - replicated setup, target instance non replicated setup

When trying to restore a backup to a new cloud sql instance I get the following message when using curl:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidOperation",
"message": "This operation isn\"t valid for this instance."
}
],
"code": 400,
"message": "This operation isn\"t valid for this instance."
}
}
When trying via google cloud console, after clicking 'ok' in the 'restore instance from backup' menu nothing happens.
I'll answer even thought this is a very old question, maybe useful for someone else (would have been for me).
I just had the same exact same error, my problem was that the storage capacity for the target instance was different than the one for the source instance. My source instance was accidentally deleted so this was a bit troublesome to figure out. This check list helped me https://cloud.google.com/sql/docs/postgres/backup-recovery/restore#tips-restore-different-instance

why MongoDB send error 500 when duplicated key

when recived the answer from MongoDB, know that my error is a duplicate key but why status=500 ?, it should be 4**.
I'm using nodejs (sails/express.js)
{ "error": {
"error": "E_UNKNOWN",
"status": 500,
"summary": "Encountered an unexpected error",
"raw": {
"name": "MongoError",
"code": 11000,
"err": "E11000 duplicate key error index: eReporterDB.users.$name_1 dup key: { : \"codin\" }"
} } }
the answer is here for nodejs
Operational errors vs. programmer errors
It's helpful to divide all errors into two broad categories:
Operational errors represent run-time problems experienced by correctly-written programs. These are not bugs in the program. In
fact, these are usually problems with something else: the system
itself (e.g., out of memory or too many open files), the system's
configuration (e.g., no route to a remote host), the network (e.g.,
socket hang-up), or a remote service (e.g., a 500 error, failure to
connect, or the like). Examples include:
failed to connect to server
failed to resolve hostname
**invalid user input**
request timeout
server returned a 500 response
socket hang-up
system is out of memory
Programmer errors are bugs in the program. These are things that can always be avoided by changing the code. They can never be handled
properly (since by definition the code in question is broken).
tried to read property of "undefined"
called an asynchronous function without a callback
passed a "string" where an object was expected
passed an object where an IP address string was expected