The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Joe Rose (4) [Avatar] Offline
#1
Hi,
I'm currently working through the physical book, and have begun to test out the code in Chapter 3. When I attempt to build the project, or run any of the individual applications, it fails with a "cannot infer type-variable" message. I'm running JDK 1.8.0_25-b17, and have Kafka installed properly in my PATH. I've been able to run a standalone producer and consumer as outlined in previous chapters without any issue.

Here is the exact error message:
/PATHTOPROJECT/src/main/java/bbejeck/chapter_9/StockCountsStreamsConnectIntegrationApplication.java:43: error: incompatible types: cannot infer type-variable(s) VR,K#2,V#2,S
.aggregate(()-> 0L,(symb, stockTxn, numShares) -> numShares + stockTxn.getShares(),
^
(argument mismatch; Materialized<K#2,Long,S> cannot be converted to Materialized<String,Long,KeyValueStore<Bytes,byte[]>>smilie
where VR,K#1,V#1,K#2,V#2,S are type-variables:
VR extends Object declared in method <VR>aggregate(Initializer<VR>,Aggregator<? super K#1,? super V#1,VR>,Materialized<K#1,VR,KeyValueStore<Bytes,byte[]>>smilie
K#1 extends Object declared in interface KGroupedStream
V#1 extends Object declared in interface KGroupedStream
K#2 extends Object declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie
V#2 extends Object declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie
S extends StateStore declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie
/PATHTOPROJECT/src/main/java/bbejeck/chapter_5/AggregationsAndReducingExample.java:79: error: incompatible types: cannot infer type-variable(s) VR,K#2,V#2,S
.aggregate(() -> fixedQueue,
^
(argument mismatch; Materialized<K#2,FixedSizePriorityQueue,S> cannot be converted to Materialized<String,FixedSizePriorityQueue,KeyValueStore<Bytes,byte[]>>smilie
where VR,K#1,V#1,K#2,V#2,S are type-variables:
VR extends Object declared in method <VR>aggregate(Initializer<VR>,Aggregator<? super K#1,? super V#1,VR>,Aggregator<? super K#1,? super V#1,VR>,Materialized<K#1,VR,KeyValueStore<Bytes,byte[]>>smilie
K#1 extends Object declared in interface KGroupedTable
V#1 extends Object declared in interface KGroupedTable
K#2 extends Object declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie
V#2 extends Object declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie
S extends StateStore declared in method <K#2,V#2,S>with(Serde<K#2>,Serde<V#2>smilie