Ignite compute broadcast closure - class not found exception - ignite

The code final Collection<Long> result = ignite.compute(group).broadcast(() -> 42L);
Throws an exception about not being to find the lambda's declaring class. What am I missing?
package com.example;
class IgniteSandbox() {
...
public static void main(String... args) {
...
final Collection<Long> result = ignite.compute(group).broadcast(() -> 42L);
}
}
java.lang.ClassNotFoundException: com.example.IgniteSandbox
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8608)
at org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:349)
at org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:688)
... 30 common frames omitted
Wrapped by: org.apache.ignite.binary.BinaryInvalidTypeException: com.example.IgniteSandbox
at org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:697)
at org.apache.ignite.internal.binary.BinaryUtils.doReadClass(BinaryUtils.java:1631)
at org.apache.ignite.internal.binary.BinaryUtils.doReadClass(BinaryUtils.java:1568)
at org.apache.ignite.internal.binary.BinaryUtils.doReadClass(BinaryUtils.java:1545)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.readClass(BinaryReaderExImpl.java:380)
at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.readFixedType(BinaryFieldAccessor.java:902)
at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.read0(BinaryFieldAccessor.java:698)
at org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:183)
... 23 common frames omitted
Wrapped by: org.apache.ignite.binary.BinaryObjectException: Failed to read field [name=capturingClass]
at org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:187)
at org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:870)
... 22 common frames omitted
Wrapped by: org.apache.ignite.binary.BinaryObjectException: Failed to deserialize object [typeName=java.lang.invoke.SerializedLambda]
at org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:909)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1762)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
at org.apache.ignite.internal.binary.BinaryUtils.doReadObject(BinaryUtils.java:1793)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.readObject(BinaryReaderExImpl.java:1329)
at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.readBinary(GridClosureProcessor.java:1872)
at org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:860)
... 16 common frames omitted
Wrapped by: org.apache.ignite.binary.BinaryObjectException: Failed to deserialize object [typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
at org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:909)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1762)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
at org.apache.ignite.internal.binary.GridBinaryMarshaller.deserialize(GridBinaryMarshaller.java:310)
at org.apache.ignite.internal.binary.BinaryMarshaller.unmarshal0(BinaryMarshaller.java:99)
at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:82)
at org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:9962)
... 10 common frames omitted
Wrapped by: org.apache.ignite.IgniteCheckedException: Failed to deserialize object [typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
at org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:9968)
at org.apache.ignite.internal.processors.job.GridJobWorker.initialize(GridJobWorker.java:440)
... 9 common frames omitted
Wrapped by: org.apache.ignite.IgniteException: Failed to deserialize object [typeName=org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2]
at org.apache.ignite.internal.processors.job.GridJobWorker.initialize(GridJobWorker.java:459)
at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1117)
at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1921)
at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1556)
at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1184)
at org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:125)
at org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Did you enable peerClassLoading?
If not, you should have com.example.IgniteSandbox class with all dependencies on all nodes participating in computation.

Related

Why am I getting an IllegalStateException trying to load resource by related path to .fxml file using TornadoFX?

I am working on UI using TornadoFX with Kotlin. So I'm trying to load the start page of my app, here's a code for main-function:
fun main() {
launch<UIApp>()
}
app()-inheriting class:
class UIApp: App(AuthorizationView::class)
and view()-inheriting class:
class AuthorizationView: View() {
override val root: AnchorPane by fxml("./src/main/resources/authorizationView.fxml")
}
The directory tree is the following:
directory tree
When I run the main fun I get this trace:
SEVERE: Uncaught error
java.lang.IllegalStateException: component.javaClass.getResource(resource) must not be null
at tornadofx.ResourceLookup.url(Component.kt:1304)
at tornadofx.FX$Companion$fxmlLocator$1.invoke(FX.kt:114)
at tornadofx.FX$Companion$fxmlLocator$1.invoke(FX.kt:88)
at tornadofx.UIComponent.loadFXML(Component.kt:1119)
at tornadofx.UIComponent$fxml$1.<init>(Component.kt:1113)
at tornadofx.UIComponent.fxml(Component.kt:1112)
at tornadofx.UIComponent.fxml$default(Component.kt:1112)
at com.lowlevel.librarysheet.view.AuthorizationView.<init>(AuthorizationView.kt:8)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at tornadofx.FXKt.find(FX.kt:434)
at tornadofx.FXKt.find$default(FX.kt:423)
at tornadofx.App.start(App.kt:83)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
at java.lang.Thread.run(Thread.java:748)
Exception in Application stop method
янв 06, 2022 5:06:35 PM tornadofx.DefaultErrorHandler uncaughtException
SEVERE: Uncaught error
java.lang.RuntimeException: Exception in Application stop method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:922)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: component.javaClass.getResource(resource) must not be null
at tornadofx.ResourceLookup.url(Component.kt:1304)
at tornadofx.FX$Companion$fxmlLocator$1.invoke(FX.kt:114)
at tornadofx.FX$Companion$fxmlLocator$1.invoke(FX.kt:88)
at tornadofx.UIComponent.loadFXML(Component.kt:1119)
at tornadofx.UIComponent$fxml$1.<init>(Component.kt:1113)
at tornadofx.UIComponent.fxml(Component.kt:1112)
at tornadofx.UIComponent.fxml$default(Component.kt:1112)
at com.lowlevel.librarysheet.view.AuthorizationView.<init>(AuthorizationView.kt:8)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at tornadofx.FXKt.find(FX.kt:434)
at tornadofx.FXKt.find$default(FX.kt:423)
at tornadofx.App.stop(App.kt:139)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:882)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
... 1 more
I've tried different ways of setting path to .fxml view including inserting an absolute path but I still get this exception.

How to put Arrow vector to Ignite

I try to create some arrow vectors and put them directly in ignite, but it failed, my questions are:
Does Ignite support store arrow data?
If Ignite support arrow data, how to store arrow vectors in ignite? Do I need to serialize data before put them in ignite?
My code:
private static final int DATA_SIZE = 1000;
try(Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
BufferAllocator bufferAllocator = new RootAllocator(1024 * 1024);
IntVector intVector = new IntVector("int_vector", bufferAllocator);
VarCharVector varCharVector = new VarCharVector("varchar_vector", bufferAllocator);
intVector.allocateNew(DATA_SIZE);
intVector.setValueCount(DATA_SIZE);
varCharVector.allocateNew(DATA_SIZE);
varCharVector.setValueCount(DATA_SIZE);
for (int i = 0; i < DATA_SIZE; i++) {
intVector.set(i, i);
varCharVector.set(i, new Text("value-" + i));
}
try (IgniteCache<String, ValueVector> cache = ignite.getOrCreateCache(CACHE_NAME)) {
cache.put("key_int", intVector);
cache.put("key_varchar", varCharVector);
} finally {
ignite.destroyCache(CACHE_NAME);
}
}
Exception:
[2021-05-17 17:17:38,844][ERROR][main][BinaryContext] Failed to deserialize object [typeName=io.netty.buffer.PoolArena$DirectArena]
class org.apache.ignite.binary.BinaryObjectException: Failed to read field [name=chunkListMetrics]
at org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:192)
at org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:888)
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to unmarshal object with optimized marshaller
at org.apache.ignite.internal.binary.BinaryUtils.doReadOptimized(BinaryUtils.java:1788)
at org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1958)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to deserialize object with given class loader: [clsLdr=sun.misc.Launcher$AppClassLoader#18b4aac2, err=Failed to deserialize object [typeName=java.util.Collections$UnmodifiableList]]
at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller.unmarshal0(OptimizedMarshaller.java:242)
Caused by: java.io.IOException: Failed to deserialize object [typeName=java.util.Collections$UnmodifiableList]
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObject0(OptimizedObjectInputStream.java:350)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:198)
Caused by: java.io.IOException: Failed to deserialize field [name=arena]
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readFields(OptimizedObjectInputStream.java:524)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:608)
Caused by: java.io.IOException: Failed to deserialize object [typeName=io.netty.buffer.PoolArena$DirectArena]
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObject0(OptimizedObjectInputStream.java:350)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:198)
Caused by: java.io.IOException: Failed to deserialize field [name=activeBytesHuge]
Caused by: java.io.IOException: Failed to deserialize object [typeName=io.netty.util.internal.LongAdderCounter]
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObject0(OptimizedObjectInputStream.java:350)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObjectOverride(OptimizedObjectInputStream.java:198)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:473)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:440)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readFields(OptimizedObjectInputStream.java:517)
... 121 more
Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:604)
at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescriptor.read(OptimizedClassDescriptor.java:953)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readObject0(OptimizedObjectInputStream.java:346)
... 125 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectInputStream.readSerializable(OptimizedObjectInputStream.java:601)
... 127 more
Caused by: java.io.InvalidObjectException: Proxy required
at java.util.concurrent.atomic.LongAdder.readObject(LongAdder.java:265)
... 132 more
[17:17:38] Ignite node stopped OK [uptime=00:00:01.107]
Exception in thread "main" java.lang.NullPointerException
at org.apache.ignite.examples.storageEngine.ArrowGandivaTest.main(ArrowGandivaTest.java:40)
I'm not sure what happens here since it is actually possible to store LongAdder in cache.
I guess you are better off serializing those vectors explicitly, if only because they can't preserve a (shared) pool allocator after being put and get from/to Ignite without extra effort.

Caused by: com.google.firebase.database.DatabaseException:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.poster, PID: 23677
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.poster/com.example.poster.MainActivity}: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Caused by: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call.
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##16.0.4:114)
at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database##16.0.4:71)
at com.example.poster.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 
at android.app.ActivityThread.-wrap14(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6776) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386) 
add these dipendencies for java
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-database'
for kotlin
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-database-ktx'
then if using instance outside us1 for the database add url
FirebaseDatabase database = FirebaseDatabase.getInstance("**url here**);
DatabaseReference myRef = database.getReference("**path here**");

Ignite 2.5: IgniteQueue.removeAll() throwing NPE

I am using IgniteQueue to store some POJOs in memory which are removed at a 15 minute interval after some processing. During the processing, elements are added and removed from the queue multiple times using removeAll() api.
Below is my queue configuration -
#Override
public IgniteQueue<R> create(QueueName queueName, int capacity) {
return ignite.queue(queueName.getQueueName(), // Queue name.
capacity, // Queue capacity. 0 for unbounded queue.
getCollectionConfiguration());
}
private CollectionConfiguration getCollectionConfiguration() {
CollectionConfiguration colCfg = new CollectionConfiguration();
colCfg.setCollocated(true);
colCfg.setCacheMode(REPLICATED);
colCfg.setAtomicityMode(TRANSACTIONAL);
return colCfg;
}
Recently, we have started receiving the below NPE -
2019-08-09 18:18:39,241 ERROR [Inbound-Main-Pool-13] [TransactionId: e5b5bfe3-5246-4d54-a4d6-acd550240e13 Request ID - 27845] [ APP=AladdinTransferAgentServer, ACTION=TA_SETTLEMENT, USER=tsgops ] SettlementWorkflowProcessor - Error while processing CLIENT settlement
class org.apache.ignite.IgniteException: Failed to serialize object [typeName=LinkedList]
at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:990)
at org.apache.ignite.internal.processors.datastructures.GridCacheQueueAdapter$QueueIterator.remove(GridCacheQueueAdapter.java:687)
at java.util.AbstractCollection.removeAll(AbstractCollection.java:376)
at org.apache.ignite.internal.processors.datastructures.GridCacheQueueProxy.removeAll(GridCacheQueueProxy.java:180)
at com.bfm.app.ta.settlement.service.support.TAOrderSettlementIgniteQueueService.removeAll(TAOrderSettlementIgniteQueueService.java:63)
at com.bfm.app.ta.settlement.service.support.TAOrderContextSettlementInputManager.removeAllFromCurrentProcessing(TAOrderContextSettlementInputManager.java:201)
at com.bfm.app.ta.settlement.service.support.TAOrderContextSettlementInputManager.lambda$removeAll$3(TAOrderContextSettlementInputManager.java:100)
at java.lang.Iterable.forEach(Iterable.java:75)
at com.bfm.app.ta.settlement.service.support.TAOrderContextSettlementInputManager.removeAll(TAOrderContextSettlementInputManager.java:100)
at com.bfm.app.ta.settlement.service.support.TAOrderContextSettlementInputManager.removeAll(TAOrderContextSettlementInputManager.java:90)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.processOrders(SettlementWorkflowProcessor.java:602)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$null$13(SettlementWorkflowProcessor.java:405)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$null$14(SettlementWorkflowProcessor.java:368)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$null$15(SettlementWorkflowProcessor.java:354)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$null$16(SettlementWorkflowProcessor.java:345)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$executeSettlementByClientSettleDateAndCurrency$17(SettlementWorkflowProcessor.java:337)
at java.util.HashMap.forEach(HashMap.java:1289)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.executeSettlementByClientSettleDateAndCurrency(SettlementWorkflowProcessor.java:330)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.executeSettlement(SettlementWorkflowProcessor.java:302)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.lambda$processSettlementFromQueue$6(SettlementWorkflowProcessor.java:282)
at com.bfm.app.ta.settlement.locking.support.IgniteLockingService.execute(IgniteLockingService.java:39)
at com.bfm.app.ta.settlement.locking.support.IgniteLockingService.execute(IgniteLockingService.java:68)
at com.bfm.app.ta.settlement.processor.support.SettlementWorkflowProcessor.processSettlementFromQueue(SettlementWorkflowProcessor.java:281)
at com.bfm.app.ta.settlement.facade.listener.support.TASettlementEventListener.listen(TASettlementEventListener.java:49)
at com.bfm.app.ta.settlement.facade.listener.support.TASettlementEventListener.listen(TASettlementEventListener.java:19)
at com.bfm.app.ta.common.listener.support.AbstractEventListener.onMessage(AbstractEventListener.java:44)
at com.bfm.app.ta.common.listener.support.AbstractEventListener$$FastClassBySpringCGLIB$$f1379f74.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.bfm.app.ta.common.aop.aspect.MetricsTrackingAspect.trackMetrics(MetricsTrackingAspect.java:142)
at com.bfm.app.ta.common.aop.aspect.MetricsTrackingAspect.logMetricsForListener(MetricsTrackingAspect.java:71)
at sun.reflect.GeneratedMethodAccessor657.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.bfm.app.ta.core.aop.aspect.LogContextAspect.logMetricsForListener(LogContextAspect.java:43)
at sun.reflect.GeneratedMethodAccessor596.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:48)
at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:34)
at com.ryantenney.metrics.spring.AbstractMetricMethodInterceptor.invoke(AbstractMetricMethodInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
at com.bfm.app.ta.settlement.facade.listener.support.TASettlementEventListener$$EnhancerBySpringCGLIB$$de3aafae.onMessage(<generated>)
at com.bfm.beam.listeners.BeamListenerSupport.fireIncomingMessageToListener(BeamListenerSupport.java:140)
at com.bfm.beam.listeners.BeamListenerSupport.fireIncomingMessage(BeamListenerSupport.java:103)
at com.bfm.beam.listeners.BeamListenerSupport.fireOnIncomingMessage(BeamListenerSupport.java:84)
at com.bfm.beam.SimpleBeamConnectionDriver$2.run(SimpleBeamConnectionDriver.java:326)
at com.bfm.util.TransactionId$TransactionRunnable.run(TransactionId.java:116)
at com.bfm.beam.executor.BeamWorkItem.run(BeamWorkItem.java:41)
at com.bfm.beam.executor.BeamWorkerImpl.run(BeamWorkerImpl.java:109)
at java.lang.Thread.run(Thread.java:748)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to serialize object [typeName=LinkedList]
at org.apache.ignite.internal.processors.datastructures.GridTransactionalCacheQueueImpl.removeItem(GridTransactionalCacheQueueImpl.java:211)
at org.apache.ignite.internal.processors.datastructures.GridCacheQueueAdapter$QueueIterator.remove(GridCacheQueueAdapter.java:682)
... 67 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to serialize object [typeName=LinkedList]
at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.java:10050)
at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.java:10108)
at org.apache.ignite.internal.processors.cache.GridCacheUtils.marshal(GridCacheUtils.java:780)
at org.apache.ignite.internal.processors.cache.GridCacheUtils.marshal(GridCacheUtils.java:753)
at org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry.marshal(IgniteTxEntry.java:902)
at org.apache.ignite.internal.processors.cache.GridCacheMessage.marshalTx(GridCacheMessage.java:372)
at org.apache.ignite.internal.processors.cache.distributed.GridDistributedTxPrepareRequest.prepareMarshal(GridDistributedTxPrepareRequest.java:389)
at org.apache.ignite.internal.processors.cache.GridCacheIoManager.onSend(GridCacheIoManager.java:1114)
at org.apache.ignite.internal.processors.cache.GridCacheIoManager.send(GridCacheIoManager.java:1148)
at org.apache.ignite.internal.processors.cache.distributed.near.GridNearPessimisticTxPrepareFuture.preparePessimistic(GridNearPessimisticTxPrepareFuture.java:366)
at org.apache.ignite.internal.processors.cache.distributed.near.GridNearPessimisticTxPrepareFuture.prepare(GridNearPessimisticTxPrepareFuture.java:176)
at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal.prepareNearTxLocal(GridNearTxLocal.java:3273)
at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal.commitNearTxLocalAsync(GridNearTxLocal.java:3333)
at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal.commit(GridNearTxLocal.java:3300)
at org.apache.ignite.internal.processors.datastructures.GridTransactionalCacheQueueImpl$4.call(GridTransactionalCacheQueueImpl.java:200)
at org.apache.ignite.internal.processors.cache.GridCacheUtils.retryTopologySafe(GridCacheUtils.java:1479)
at org.apache.ignite.internal.processors.datastructures.GridTransactionalCacheQueueImpl.removeItem(GridTransactionalCacheQueueImpl.java:189)
... 68 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to serialize object [typeName=LinkedList]
at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:835)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134)
at org.apache.ignite.internal.binary.GridBinaryMarshaller.marshal(GridBinaryMarshaller.java:251)
at org.apache.ignite.internal.binary.BinaryMarshaller.marshal0(BinaryMarshaller.java:82)
at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.marshal(AbstractNodeNameAwareMarshaller.java:58)
at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.java:10044)
... 84 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to serialize object [typeName=T2]
at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:835)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteCollection(BinaryWriterExImpl.java:764)
at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:707)
... 91 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to write field [name=val1]
at org.apache.ignite.internal.binary.BinaryFieldAccessor.write(BinaryFieldAccessor.java:159)
at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:807)
... 97 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to marshal object with optimized marshaller: org.apache.ignite.internal.processors.datastructures.GridCacheQueueAdapter$RemoveProcessor#6d82c986
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:186)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeObjectField(BinaryWriterExImpl.java:1160)
at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write0(BinaryFieldAccessor.java:682)
at org.apache.ignite.internal.binary.BinaryFieldAccessor.write(BinaryFieldAccessor.java:155)
... 98 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to serialize object: org.apache.ignite.internal.processors.datastructures.GridCacheQueueAdapter$RemoveProcessor#6d82c986
at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller.marshal0(OptimizedMarshaller.java:206)
at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.marshal(AbstractNodeNameAwareMarshaller.java:58)
at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.java:10044)
at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:179)
... 104 more
Caused by: java.lang.NullPointerException
at org.apache.ignite.internal.processors.datastructures.GridCacheQueueAdapter$RemoveProcessor.writeExternal(GridCacheQueueAdapter.java:1021)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeExternalizable(OptimizedObjectOutputStream.java:317)
at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:814)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:240)
at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObjectOverride(OptimizedObjectOutputStream.java:158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344)
at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller.marshal0(OptimizedMarshaller.java:201)
... 107 more
P.S. We don't have any class T2 with field val1
Also, the error is not reproducible locally nor on environment on demand. Also, it occurs only once and then every subsequent calls to remove from queue work fine.
Can someone please help with this issue?
Thanks.

java.lang.ClassCastException: JedisConnectionFactory cannot be cast to ConnectionFactory

I'm not sure why Method "connectionFactory" is returning an instance of JedisConnecionFactory, should it not be org.springframework.amqp.rabbit.connection.ConnectionFactory?
The following exception on line "new RabbitTemplate(connectionFactory())" (see code below)
Feb 23, 2015 11:50:20 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
r:4.1.5.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) [catalina.jar:7.0.39]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) [catalina.jar:7.0.39]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.39]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [catalina.jar:7.0.39]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [catalina.jar:7.0.39]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0]
at java.lang.Thread.run(Thread.java:744) [na:1.8.0]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.queue.MessageQueueSender]: Factory method 'messageQueueSender' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rabbitTemplate' defined in class path resource [com/config/MessageQueueConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.core.RabbitTemplate]: Factory method 'rabbitTemplate' threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.redis.connection.jedis.JedisConnectionFactory cannot be cast to org.springframework.amqp.rabbit.connection.ConnectionFactory
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
... 23 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rabbitTemplate' defined in class path resource [com/config/MessageQueueConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.core.RabbitTemplate]: Factory method 'rabbitTemplate' threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.redis.connection.jedis.JedisConnectionFactory cannot be cast to org.springframework.amqp.rabbit.connection.ConnectionFactory
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1111) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:322) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.rabbitTemplate(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at com.config.MessageQueueConfig.messageQueueSender(MessageQueueConfig.java:61) ~[MessageQueueConfig.class:na]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.CGLIB$messageQueueSender$1(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1$$FastClassBySpringCGLIB$$99208f13.invoke(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.messageQueueSender(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
... 24 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.amqp.rabbit.core.RabbitTemplate]: Factory method 'rabbitTemplate' threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.redis.connection.jedis.JedisConnectionFactory cannot be cast to org.springframework.amqp.rabbit.connection.ConnectionFactory
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
... 45 common frames omitted
Caused by: java.lang.ClassCastException: org.springframework.data.redis.connection.jedis.JedisConnectionFactory cannot be cast to org.springframework.amqp.rabbit.connection.ConnectionFactory
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.connectionFactory(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at com.config.MessageQueueConfig.rabbitTemplate(MessageQueueConfig.java:75) ~[MessageQueueConfig.class:na]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.CGLIB$rabbitTemplate$2(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1$$FastClassBySpringCGLIB$$99208f13.invoke(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309) ~[spring-context-4.1.5.RELEASE.jar:4.1.5.RELEASE]
at com.config.MessageQueueConfig$$EnhancerBySpringCGLIB$$68caa0b1.rabbitTemplate(<generated>) ~[spring-core-4.1.5.RELEASE.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.1.5.RELEASE.jar:4.1.5.RELEASE]
... 46 common frames omitted
#Configuation Class
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
#Configuration
#ComponentScan(basePackages={"..."})
public class MessageQueueConfig {
..
#Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory(url);
connectionFactory.setUsername(username);
connectionFactory.setPassword(password);
connectionFactory.setPort(port);
return connectionFactory;
}
#Bean
public RabbitTemplate rabbitTemplate() {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory());
rabbitTemplate.setConnectionFactory(connectionFactory());
rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
rabbitTemplate.setRoutingKey("message.queue");
return rabbitTemplate;
}
}
Your #ComponentScan must be finding another configuration file with a redis connection factory bean with the same name which is overriding this one.
You can use DEBUG logging for org.springframework; it emits copious logs when resolving beans.
Alternatively, simply change your bean definition to use a different bean name: rabbitConnectionFactory()