Disable Jackson Polymorphic Type Checking in WildFly 20? - jackson

Just upgraded to WildFly 20 and am seeing errors related to jackson deserialization e.g.
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'TestCreateRequest' as a subtype of CreateRequest: Configured PolymorphicTypeValidator (of type com.fasterxml.jackson.databind.jsontype.BasicPolymorphicTypeValidator) denied resolution
at [Source: (ByteArrayInputStream); line: 1, column: 11]
I have tried setting the system property documented here:
https://docs.jboss.org/resteasy/docs/4.4.2.Final/userguide/html/json.html#Polymorphic_Typing_deserialization
but still get the same errors. Anyone have a solution?

Answering my own question...after looking at the RestEasy code on github it turns out the docs give the incorrect system property names. They should be:
"resteasy.jackson.deserialization.whitelist.allowIfBaseType.prefix"
"resteasy.jackson.deserialization.whitelist.allowIfSubType.prefix"

Related

How to decipher sentry warning; "span of type Connection with operation id (null).."

Using Sentry.AspNetCore in a .NET core app I get these:
warn: Sentry.ISentryClient[0]
=> SpanId:eed7125b44901343, TraceId:bde9ab9c677f6c45a343a489f37e55c1, ParentId:0000000000000000 =>
ConnectionId:0HMBS5J9RV0II => RequestPath:/ws
RequestId:0HMBS5J9RV0II:00000002
Trying to get a span of type Connection with operation id (null), but it was not found.
What does this message mean, should I get rid of them and if so, how?
Update
It was fixed in 3.10.0.
It looks like a bug in Sentry SDK. See the related issue.
There is hope that this will be fixed soon.
The latter error in regard to spans will be fixed soon.
https://github.com/getsentry/sentry-dotnet/issues/1210#issuecomment-933822947

org.eclipse.microprofile #ConfigProperty does not work using openJDK13

We just switched from oracle jdk 10 to openJDK 13.
When we now try to start our tomee with
set JAVA_OPTS=-Dconfigfilepath="path/to/config.xml"
we get the following exception:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.lang.String] is not found with the qualifiers
Qualifiers: [#org.eclipse.microprofile.config.inject.ConfigProperty(name="configfilepath", defaultValue="org.eclipse.microprofile.config.configproperty.unconfigureddvalue")]
for injection into Field Injection Point, field name : configPath, Bean Owner : [Configuration, WebBeansType:MANAGED, Name:null, API Types:[de.test.Configuration,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
It works if we use the ConfigProvider directly. I hope someone can help with this problem.

OrientDB serverside NullPointerException while serializing record using binary protocol

I've just started to implement binary protocol API to orientDB with C++. Current Version of used orientDB is "orientdb-community-2.2.29" with win 10 x64 and java 1.8. Since I've tried to query "select * from XXXX" on example DB serverside exceptions are thrown and no record is serialized to client. Here are the logs after successful connection and query:
2017-12-03 14:14:12:561 INFO {db=Site} /0:0:0:0:0:0:0:1:2520 - Writing bytes (4+0=4 bytes): null [OChannelBinaryServer]$ANSI{green {db=Site}} Error on unmarshalling record #73:0 (java.lang.NullPointerException)
java.lang.NullPointerException
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.getRecordBytes(ONetworkProtocolBinary.java:2894)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.writeRecord(ONetworkProtocolBinary.java:2907)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.writeIdentifiable(ONetworkProtocolBinary.java:2697)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.serializeValue(ONetworkProtocolBinary.java:1639)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1584)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:660)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:394)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:217)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:81)
2017-12-03 14:14:12:561 WARNI {db=Site} Cannot serialize record: XXXX#73:0{Name:[2],IDs:[1]} v3 [ONetworkProtocolBinary]
Before writing the "null" bytes the recordID, position and record version is serialized and received on client side correctly, also querying from Studio or console works like a charm. I've tried to change the class - property to STRING or EMBEDDEDMAP with the same problem.
Thanks in advance for help :-)
Fortunately I found the mistake at my own: wrong SerializationImpl was configured. The correct configuration must be ORecordSerializerBinary and not ONetworkProtocolBinary.

WP Windows Phone Invalid XAML

I get exception
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException'
occurred in WP.MyOffice.exe but was not handled in user code
WinRT information: Unable to resolve property '%1' while processing
properties for Uid '%0'. [Line: 79 Position: 27]
1 - line 79 position 27
2 - "Invalid XAML" in Error List window
In Resources.recw has Hub.Header and HubSection1.Header
How found what is wrong?
Check your resources.resw file, you probably have something like Hub.Text, while the "Hub" element doesn't support that attribute (text). Maybe you already used the key Hub for something else
Strategy to fix:
Remove the x:uid properties and worry about localization later, get the Hub working.
If it still doesn't work create a basic hub with no items. Once working add the hub items/sections back until the point of failure.
Once the failure is determined resolve.

Obscure NHibernate/Fluent NHibernate error

I've been encountering the following error when trying to build a
session factory:
PersistenceTests.Can_Map_Orders_To_Database : Failed
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at NHibernate.Mapping.Column.set_Name(String value)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumns(XmlNode node,
SimpleValue model, Boolean isNullable, Boolean autoColumn, String
propertyPath)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumnsOrFormula
(XmlNode node, SimpleValue simpleValue, String path, Boolean
isNullable)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindSimpleValue(XmlNode
node, SimpleValue model, Boolean isNullable, String path)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass
(XmlNode node, Collection model, IDictionary`2 persistentClasses)
at
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.<>c__DisplayClassd.<AddCollec tionSecondPass>b__c
(IDictionary`2 persistentClasses)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 94
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 99
at FluentNHibernate.SessionSource..ctor(FluentConfiguration config) in
c:\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src
\FluentNHibernate\SessionSource.cs: line 38
at
FluentNHibernate.Testing.SingleConnectionSessionSourceForSQLiteInMemoryTest ing..ctor
(FluentConfiguration config) in c:\Code Samples\NHibernate\Fluent
Nhibernate - Trunk\src\FluentNHibernate\Testing
\SingleConnectionSessionSourceForSQLiteInMemoryTesting.cs: line 15
at Core.Infrastructure.Data.NHibernate.Tests.PersistenceTests.SetUp()
in PersistenceTests.cs: line 26
I'm working against the FNH trunk and NH 2.0.1. Funny thing is I am
able to compile my mappings (via AutoPersistenceModel.CompileMappings)
and write them to the file system successfully - FNH doesn't complain.
It is only when attempting to build the session factory that
everything goes kaboom with the not very helpful error message above.
Anyone got any ideas?
I found that the inner exception gave more details. In my case I had to add the NHibernate.ByteCode.Castle.dll file to the references.
Fluent NHibernate itself rarely complains at you directly. Internally it's just building up your HBM files for you so if you told it to build something wrong then NHibernate proper will get grumpy.
If you're not already, you might want to start with exporting your mapping files like so:
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyClass>()
.ExportTo("path")
Then you can dig around in there to see if something is wrong. I do recall getting this error once before and I think it relates to a mismatch in the number of columns mapped. It was one of those easy-to-miss errors in my mapping, so unfortunately all I can suggest is to really scour the output of ExportTo for anything that doesn't make sense.
We'll need to see your Configuration to help much. But this part of the stack trace should give you an idea of where to start.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
\Cfg\FluentConfiguration.cs: line 94
FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
incomplete configuration was used while creating a SessionFactory.
Check PotentialReasons collection, and InnerException for more detail.