NoSuchMethodError using fasterxml jackson - spring-4

I am getting this error when running a spring application and using a RestTemplate
However when running a junit test I see no problem
In my test I generate this json.
[
{
"idProcesoElectoral": 9,
"idSolicitud": 591,
"folioSiilnere": "E1009000591",
"idEstatusSolicitud": 2,
"fechaEstatus": "25/10/17 13:13:51"
}
]
The error:
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectWriter.forType(Lcom/fasterxml/jackson/databind/JavaType;)Lcom/fasterxml/jackson/databind/ObjectWriter;
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:264)
at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:100)
at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:830)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:617)
at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:580)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:380)
I have read that it is probably a version conflict somewhere, but can't find the culprit.
Here are the jackson libraries included
./siilnere-web/target/siilnere-web-6.4.1.0.5/WEB-INF/lib/jackson-datatype-jsr310-2.2.3-beta5.jar
./siilnere-web/target/siilnere-web-6.4.1.0.5/WEB-INF/lib/jackson-annotations-2.8.9.jar
./siilnere-web/target/siilnere-web-6.4.1.0.5/WEB-INF/lib/jackson-databind-2.8.9.jar
./siilnere-web/target/siilnere-web-6.4.1.0.5/WEB-INF/lib/jackson-core-2.8.9.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-datatype-jsr310-2.2.3-beta5.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-core-asl-1.9.13.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-mapper-asl-1.9.13.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-annotations-2.8.9.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-databind-2.8.9.jar
./siilnere-ear/target/siilnere-ear-6.4.1.0.5/APP-INF/lib/jackson-core-2.8.9.jar
Any help is appreciated.
Thankyou
Edit:
I read a suggestion to temporarily use java parameter -verbose:class to try to debug this.
I greped the output of weblogic and got this
and found statements like this (though I didn't find any like refering to class ObjectWriter):
Loaded com.fasterxml.jackson.databind.deser.std.StringDeserializer from file:/opt/Oracle/Oracle/Middleware/Oracle_Home/oracle_common/modules/com.fasterxml.jackson.core.jackson-databind.jar
However I have this in weblogic.xml:
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
<prefer-application-packages>
<package-name>com.fasterxml</package-name>
</prefer-application-packages>
</container-descriptor>

Related

Firebase Analytics API StatusRunTimeException with XdsInitializationException

My problem - when start runReportRequest catched exeptions: StatusRunTimeException, XdsInitializationException. It is problem exist only when start jar-file, and when start in IDE that's ok and problem doesn't exist. Full log error:
янв. 08, 2023 8:49:41 PM io.grpc.internal.ManagedChannelImpl$NameResolverListener handleErrorInSyncContext
WARNING: [Channel<1>: (analyticsdata.googleapis.com:443)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Failed to initialize xDS, cause=io.grpc.xds.XdsInitializationException: Cannot find bootstrap configuration
Environment variables searched:
GRPC_XDS_BOOTSTRAP
GRPC_XDS_BOOTSTRAP_CONFIG
`Java System Properties searched:
io.grpc.xds.bootstrap
io.grpc.xds.bootstrapConfig
at io.grpc.xds.BootstrapperImpl.bootstrap(BootstrapperImpl.java:110)
at io.grpc.xds.SharedXdsClientPoolProvider.getOrCreate(SharedXdsClientPoolProvider.java:87)
at io.grpc.xds.XdsNameResolver.start(XdsNameResolver.java:179)
at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:418)
at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:981)
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95)
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127)
at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:978)
at com.google.api.gax.grpc.GrpcChannelUUIDInterceptor.interceptCall(GrpcChannelUUIDInterceptor.java:52)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at com.google.api.gax.grpc.GrpcHeaderInterceptor.interceptCall(GrpcHeaderInterceptor.java:80)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at com.google.api.gax.grpc.GrpcMetadataHandlerInterceptor.interceptCall(GrpcMetadataHandlerInterceptor.java:54)
at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:920)
at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63)
at com.google.api.gax.grpc.ChannelPool$AffinityChannel.newCall(ChannelPool.java:514)
at com.google.api.gax.grpc.ChannelPool.newCall(ChannelPool.java:143)
at com.google.api.gax.grpc.GrpcClientCalls.newCall(GrpcClientCalls.java:99)
at com.google.api.gax.grpc.GrpcDirectCallable.futureCall(GrpcDirectCallable.java:60)
at com.google.api.gax.grpc.GrpcUnaryRequestParamCallable.futureCall(GrpcUnaryRequestParamCallable.java:65)
at com.google.api.gax.grpc.GrpcExceptionCallable.futureCall(GrpcExceptionCallable.java:64)
at com.google.api.gax.rpc.AttemptCallable.call(AttemptCallable.java:87)
at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:63)
at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:41)
at com.google.api.gax.tracing.TracedUnaryCallable.futureCall(TracedUnaryCallable.java:75)
at com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126)
at com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87)
at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
at com.google.analytics.data.v1beta.BetaAnalyticsDataClient.runRealtimeReport(BetaAnalyticsDataClient.java:672)
at ru.vkcleanlite.ApplicationKt.getRealtimeReport(Application.kt:87)
at ru.vkcleanlite.ApplicationKt$startRequests$1.run(Application.kt:135)
}
com.google.api.gax.rpc.UnavailableException: io.grpc.StatusRuntimeException: UNAVAILABLE: Failed to initialize xDS`
Initialization:
BetaAnalyticsDataClient.create().use { analyticsData ->
val request = RunRealtimeReportRequest.newBuilder()
.setProperty("properties/$propertyId")
.addDimensions(Dimension.newBuilder().setName("city"))
.addMetrics(Metric.newBuilder().setName("activeUsers"))
.build()
val response = analyticsData.runRealtimeReport(request)
}
How, I see, need add environment variables GRPC_XDS_BOOTSTRAP GRPC_XDS_BOOTSTRAP_CONFIG, but where get this is files? Official guide shared links on Git, where source link unsaffed, browser denied. But in this time, I'm not sure, what problem in environment variable, because in IDE that's all work, and in quick start (offical firebase guide for GA4) not contains information about settings for grps-connection. Pehraps, my research incorrect and problem another. For now updated grpc, but it not fixed problem. How it fixed? Thanks!

"HV000183 - EL dependencies not found" using hibernate-validator 7.0.0.Final / jakarta.el 4.0.1

I've a kotlin spring boot project with org.hibernate:hibernate-validator:7.0.0.Final and org.glassfish:jakarta.el:4.0.1.
For testing validation constraints I create a javax.validation.Validator, like so:
val factory = Validation.buildDefaultValidatorFactory()
validator = factory.validator
This results in the following error: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on the classpath, or use ParameterMessageInterpolator instead. Which I find strange, since I included them per the instructions: https://hibernate.org/validator/documentation/getting-started/
If I combine org.hibernate:hibernate-validator:7.0.0.Final and org.glassfish:javax.el:3.0.0 it works, but it looks like 7.0.0.Final should not be used with javax.el, but with jakarta.el, without me knowing the reason why at the moment: https://in.relation.to/2021/01/06/hibernate-validator-700-62-final-released/
Any ideas on what I need to do to use hibernate-validator v7?

How to alias an output for automatic connection?

I currently have this code:
self.add_subsystem('IntegrateForTheta2Ue6', utilities.CumulativeIntegrateTrapeziums(n=n),
promotes_inputs=[('x', 'panel_lengths'),
('x0', 'stagnation_point_position'),
('y', 'ue5'),
('y0', 'panel_start_external_tangential_velocity')],
promotes_outputs=[('cumulative_integral', 'intue5')])
self.add_subsystem('ThwaitesCalculateMomentumThickness', ThwaitesCalculateMomentumThickness(n=n),
promotes_inputs=['external_tangential_velocities',
'intue5',
'kinematic_viscosity'],
promotes_outputs=['momentum_thickness'])
It does not throw any errors when run, but when debugging it is clear that the output for intue5 aka cumulative_integral is not being passed into ThwaitesCalculateMomentumThickness - it appears as all ones. When I try the above with self.connect('IntegrateForTheta2Ue6.intue5', 'ThwaitesCalculateMomentumThickness.intue5'), I get Attempted to connect from 'IntegrateForTheta2Ue6.intue5' to 'ThwaitesCalculateMomentumThickness.intue5', but 'IntegrateForTheta2Ue6.intue5' doesn't exist.
Am I making a mistake in my output aliasing, or is this a bug?
Updating to the latest version of OpenMDAO worked. I believe I was already calling run_model(), so I'm not sure why it wasn't working.

Problem compiling Flex project from Flash Builder

I'm having a problem with Adobe Flash Builder, when trying to compile and run a Flex Project I had previously coded outside FB.
I imported the classes following the correct package file system, and everything seemed to work correctly: none of the classes shows errors (and if I code something wrong, an error is shown, so FB error system is working), the auto-complete works fine in all classes, the Main.xmxl class is set up as 'default Application' in the project...
Maybe I skipped a step in between or something, but I always get the following error when trying to compile:
Error
Sun Jun 19 18:40:32 CEST 2011
Uncaught exception in compiler
java.lang.NullPointerException
at flex2.compiler.mxml.lang.StandardDefs.isIUIComponent(StandardDefs.java:784)
at flex2.compiler.mxml.builder.ComponentBuilder.constructComponent(ComponentBuilder.java:177)
at flex2.compiler.mxml.builder.ComponentBuilder.analyze(ComponentBuilder.java:84)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.builder.VectorBuilder$ElementNodeHandler.componentNode(VectorBuilder.java:173)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:73)
at flex2.compiler.mxml.builder.VectorBuilder.processChildren(VectorBuilder.java:142)
at flex2.compiler.mxml.builder.VectorBuilder.analyze(VectorBuilder.java:97)
at flex2.compiler.mxml.dom.VectorNode.analyze(VectorNode.java:50)
at flex2.compiler.mxml.builder.AbstractBuilder$RValueNodeHandler.vectorNode(AbstractBuilder.java:999)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:113)
at flex2.compiler.mxml.builder.AbstractBuilder$RValueNodeHandler.process(AbstractBuilder.java:975)
at flex2.compiler.mxml.builder.AbstractBuilder.processRValueNodes(AbstractBuilder.java:941)
at flex2.compiler.mxml.builder.AbstractBuilder.processPropertyNodes(AbstractBuilder.java:770)
at flex2.compiler.mxml.builder.AbstractBuilder.processPropertyNodes(AbstractBuilder.java:741)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.property(ComponentBuilder.java:506)
at flex2.compiler.mxml.lang.ChildNodeHandler$CoreDeclarationHandler.property(ChildNodeHandler.java:208)
at flex2.compiler.mxml.lang.DeclarationHandler.invoke(DeclarationHandler.java:94)
at flex2.compiler.mxml.lang.ChildNodeHandler$CoreDeclarationHandler.invoke(ChildNodeHandler.java:236)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.invoke(ComponentBuilder.java:705)
at flex2.compiler.mxml.lang.ChildNodeHandler.scanChildNodes(ChildNodeHandler.java:79)
at flex2.compiler.mxml.builder.ComponentBuilder.processChildren(ComponentBuilder.java:437)
at flex2.compiler.mxml.builder.ComponentBuilder.analyze(ComponentBuilder.java:88)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.builder.DocumentBuilder$NestedDeclarationNodeHandler.componentNode(DocumentBuilder.java:792)
at flex2.compiler.mxml.lang.ValueNodeHandler.invoke(ValueNodeHandler.java:73)
at flex2.compiler.mxml.builder.DocumentBuilder$DocumentChildNodeHandler.processNestedDeclaration(DocumentBuilder.java:716)
at flex2.compiler.mxml.builder.ComponentBuilder$ComponentChildNodeHandler.nestedDeclaration(ComponentBuilder.java:616)
at flex2.compiler.mxml.builder.DocumentBuilder$DocumentChildNodeHandler.invoke(DocumentBuilder.java:763)
at flex2.compiler.mxml.lang.ChildNodeHandler.scanChildNodes(ChildNodeHandler.java:79)
at flex2.compiler.mxml.builder.ComponentBuilder.processChildren(ComponentBuilder.java:437)
at flex2.compiler.mxml.builder.DocumentBuilder.analyze(DocumentBuilder.java:188)
at flex2.compiler.mxml.dom.Node.analyze(Node.java:53)
at flex2.compiler.mxml.ImplementationCompiler.parse1(ImplementationCompiler.java:183)
at flex2.compiler.mxml.MxmlCompiler.parse1(MxmlCompiler.java:179)
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2872)
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2825)
etc...
Any guesses? I'm really getting mad with it...
Help would be greatly appreciated :)

including Qt headers in DLL

I have a DLL in wich I would like to take a reference to a QObject and manipulate it, without actually creating an interface. So, I included "Qt/qobject.h" and compiled, but the compiler (Visual Studio 2008 pro) gives me syntax errors. It looks like it doesn't recognize the QThread object. How do I use a QObject in my dll? Is this even possible? Do I have to start my program from a Qt app? I'm actually trying to set a system-wide hook and get 3rd application QWidgets to manipulate... Any idea how I can use QObject in my dll?
Here are the errors:
1>------ Build started: Project: FroggerDLL, Configuration: Debug Win32 ------
1>Compiling...
1>FTClient.cpp
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(154) : error C2059: syntax error : 'type'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(154) : error C2238: unexpected token(s) preceding ';'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2144: syntax error : 'int' should be preceded by ')'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2144: syntax error : 'int' should be preceded by ';'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2059: syntax error : ')'
1>c:\qt-win-opensource-src-4.5.2\src\corelib\kernel\qobject.h(155) : error C2208: 'int' : no members defined using this type
1>FroggerDLL - 6 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
Any help would be greatly appreciated,
Thanks
Dave
What's on line 154? Mine is just the declaration
QThread* thread() const;
but that's 4.5.1 on Linux so it might be different. The first reference to anything involving the token type is on line 204 which is a variable of type Qt::ConnectionType.
BTW. I just tried compiling the following on my system ( in the file incqobj.cpp )
include <QOObject>
QObject myQOject;
with
g++ -I/usr/lib/qt4/include -I/usr/lib/qt4/include/QtCore -c incqobj.cpp
and it compiled fine so it should be as simple as that.
Edit: Since Jesse confirms that it works for him on Windows I'm tempted to say that you've got a non-Qt macro coming in and interfering. One thing you could do is a sanity check on what the compiler is actually seeing by getting VS to only produce the preprocessed source rather than do the compilation.
I haven't used VS in years but I think the option is \E maybe?
[Edit: see the 2nd comment by Jesse, it should be /E] It may also be an explicit option now in the compiler properties which can be set for that source file. Can't remember where it puts the output either so you may need to hunt around for it a bit! If you get that going though you can check to see if the code looks right at the part that would correspond to line 154 in the original QObject header.
Thanks for all the help, solution: I had to include the Qt headers before all my other includes, and it now compiles.
Thanks again!
Try including QThread?
#include <QThread>
Qt uses forward declaration extensively and sometimes you need to include extra headers.
EDIT:
Do you set any defines? Here is what I have for my 2003 Qt commercial (4.3.4) project (executable that links to Qt dlls):
QT_LARGEFILE_SUPPORT
QT_DLL
QT_GUI_LIB
QT_CORE_LIB
QT_THREAD_SUPPORT
QT_NETWORK_LIB

Resources