Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Failed to connect node to cluster due to: java.lang.ClassCastException

Failed to connect node to cluster due to: java.lang.ClassCastException

Explorer

HI,

We works with a nifi cluster include three node.

I got the below errors when I reconnect the disconnected nifi node.

what is the cause reason? How to avoid it?

2017-02-06 16:07:29,143 ERROR [Reconnect to Cluster] o.a.nifi.controller.StandardFlowService Handling reconnection request failed due to: org.apache.nifi.cluster.ConnectionException: Failed to connect node to cluster due to: java.lang.ClassCastException: org.apache.nifi.controller.StandardSnippet$JaxbAccessorM_getId_setId_java_lang_String cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
org.apache.nifi.cluster.ConnectionException: Failed to connect node to cluster due to: java.lang.ClassCastException: org.apache.nifi.controller.StandardSnippet$JaxbAccessorM_getId_setId_java_lang_String cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
	at org.apache.nifi.controller.StandardFlowService.loadFromConnectionResponse(StandardFlowService.java:901) [nifi-framework-core-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
	at org.apache.nifi.controller.StandardFlowService.handleReconnectionRequest(StandardFlowService.java:599) [nifi-framework-core-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
	at org.apache.nifi.controller.StandardFlowService.access$300(StandardFlowService.java:97) [nifi-framework-core-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
	at org.apache.nifi.controller.StandardFlowService$2.run(StandardFlowService.java:404) [nifi-framework-core-1.0.0.2.0.0.0-579.jar:1.0.0.2.0.0.0-579]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
Caused by: java.lang.ClassCastException: org.apache.nifi.controller.StandardSnippet$JaxbAccessorM_getId_setId_java_lang_String cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
	at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:199) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:144) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:399) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:87) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at sun.reflect.GeneratedConstructorAccessor72.newInstance(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_92]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_92]
	at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:128) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:183) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:532) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:347) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170) ~[jaxb-impl-2.2.3-1.jar:2.2.3]
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145) ~[jaxb-impl-2.2.3-1.jar:2.2.3]


5 REPLIES 5

Re: Failed to connect node to cluster due to: java.lang.ClassCastException

Master Guru

@Paul Yang

What version of NiFi and Java are you running with?

Have you added any custom Jars or Nars to NiFi's lib directory?

Highlighted

Re: Failed to connect node to cluster due to: java.lang.ClassCastException

Explorer

@Matt

NIFI version : 1.0.0.2.0.0.0-579

java version : "1.8.0_92" Java(TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

Yes, I have added a custom processor class in nifi-standard-processors-1.0.0.2.0.0.0-579.jar, and the processor seems working normally.

Re: Failed to connect node to cluster due to: java.lang.ClassCastException

Does the custom processor bring in any additional dependencies?

Re: Failed to connect node to cluster due to: java.lang.ClassCastException

Explorer

No, There is not bring in any additional dependencies.

I just change the logic of PutSQL class to PutDeleteInsertSQL. It used to support our vertica database. The vertica database doesn't support primary key check when insert a row. So, the workaround is executing batch delete statement before execute batch insert statement.

putdeleteinsertsql.txtThe attachment is my code.

Could you please help me to check it? and give me some feedback.

Re: Failed to connect node to cluster due to: java.lang.ClassCastException

Explorer

@Matt Burgess

Any update?

Don't have an account?
Coming from Hortonworks? Activate your account here