Comments (7)
So when I attempt to upload kafka-avro-serializer-4.1.0.jar with the following setup shown below, I end up with a 500 error. The stack trace complains about an unknown class, which leads me to believe that the packaged kafka-avro-serializer-4.1.0.jar jar does not contain all of the required dependencies.
Error:
2018-06-19 00:56:25.002 ERROR 8 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: io/confluent/common/config/ConfigException] with root cause
java.lang.ClassNotFoundException: io.confluent.common.config.ConfigException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_151]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_151]
at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.8.0_151]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) ~[na:1.8.0_151]
at java.lang.Class.getConstructor0(Class.java:3075) ~[na:1.8.0_151]
at java.lang.Class.newInstance(Class.java:412) ~[na:1.8.0_151]
at org.sourcelab.kafka.webview.ui.manager.plugin.PluginFactory.getPlugin(PluginFactory.java:124) ~[classes!/:1.0.4]
at org.sourcelab.kafka.webview.ui.controller.configuration.messageformat.MessageFormatController.create(MessageFormatController.java:226) ~[classes!/:1.0.4]
from kafka-webview.
Following the instructions here, you likely need to build a JAR that contains all the required dependencies for the avro schema registry deserializer.
You can do this relatively easily by cloning the Examples project and using the following pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sourcelab</groupId>
<artifactId>kafka-webview-examples</artifactId>
<version>1.0.0</version>
<properties>
<avro-registry-version>4.1.0</avro-registry-version>
<confluent.maven.repo>http://packages.confluent.io/maven/</confluent.maven.repo>
</properties>
<repositories>
<repository>
<id>confluent</id>
<name>Confluent</name>
<url>${confluent.maven.repo}</url>
</repository>
</repositories>
<!-- Define Dependencies -->
<dependencies>
<!-- Use kafka-webview-plugin dependency -->
<!-- Scope is provided -->
<dependency>
<groupId>org.sourcelab</groupId>
<artifactId>kafka-webview-plugin</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<!-- Kafka Dependency for Deserializers -->
<!-- Scope is provided -->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.11.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-avro-serializer</artifactId>
<version>${avro-registry-version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Set Source & Target JRE Version -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Copy dependencies over into packaged jar -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass/>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
You can then issue the command mvn package
and upload the resulting jar kafka-webview-examples-1.0.0-jar-with-dependencies.jar and use the same configuration posted in the above screen shot.
I believe that should work for you, let me know.
from kafka-webview.
Thanks a lot for you reply.
I've build the 10Mb fat jar kafka-webview-examples-1.0.0-jar-with-dependencies.jar but I still have the same error. I'm using the same docker image as yesterday. Should have to pull a new version?
from kafka-webview.
It should work with your current docker image. The update I made yesterday just more gracefully handles ClassNotFoundException exceptions.
Are you able to paste a stack trace of the error you are getting?
from kafka-webview.
There is no stracktrace nor ERROR message in the logs:
2018-06-20 13:57:27.818 INFO 19860 --- [ main] o.s.kafka.webview.ui.Application : Started Application in 13.018 seconds (JVM running for 13.805)
2018-06-20 13:58:25.080 INFO 19860 --- [MessageBroker-1] o.s.w.s.c.WebSocketMessageBrokerStats : WebSocketSession[0 current WS(0)-HttpStream(0)-HttpPoll(0), 0 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(0)-CONNECTED(0)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], outboundChannelpool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0], sockJsScheduler[pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
2018-06-20 14:00:39.011 INFO 19860 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-06-20 14:00:39.011 INFO 19860 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2018-06-20 14:00:39.043 INFO 19860 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 32 ms
Just the UI error message: Unable to find class io.confluent.kafka.serializers.KafkaAvroDeserializer
from kafka-webview.
Odd, I wiped my examples project, started over from scratch following the above instructions, and it loaded without any issues:
from kafka-webview.
I'm sorry. I don't take time to retest. Thanks for your help.
from kafka-webview.
Related Issues (20)
- Lets add warning log msgs when ignoring or overwriting user defined configuration values for deserializers HOT 1
- Kafka-Webview should provide option to "Stringify" ByteArray messages HOT 2
- Failing to connect to GSSAPI/SSL cluster HOT 2
- Custom protobuf deserializer failed because of pb version conflict HOT 2
- On View page, the "previous button" jump is twice as big as the "next button" jump. HOT 1
- use custom config.yml with docker
- Repository with ID="orgsourcelab-1031" not found HOT 1
- Expose actuator/health path without login HOT 1
- Selecting a Partition filter from a 'Stream' persists the partition as an enforced filter.
- Allow Filtering on Views Page HOT 3
- Consumer poll timeout is hardcoded
- How to Build this as a Single Jar/War file to deploy in server which doesn't have MVN/JDK HOT 2
- Disable server host name verification HOT 3
- "Unknown magic byte!" when deserializing avro message with TopicRecordNameStrategy HOT 2
- Mistake in environment variable name HOT 2
- Feature Request: Make `requestTimeoutMs` configurable per cluster HOT 3
- Security Update HOT 3
- [Docker] Execute web application fail while upgrade from v2.4.0 to 2.8.1 HOT 5
- Is webview vulnerable to Spring4Shell vulnerablity (CVE-2022-22965)? HOT 3
- unable to connect to AWS MSK clusters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-webview.