The Example code imports are missing. Does anyone know what I not including?
I got the imports for mvn from http://www.jzy3d.org/download-0.9.1.php
The example code is from https://github.com/jzy3d/jzy3d-api/tree/master/jzy3d-javafx/src/main/java/org/jzy3d/demos/javafx
and these three imports are causing problems. I didn't see any other mvn imports
import org.jzy3d.javafx.JavaFXChartFactory;
import org.jzy3d.javafx.JavaFXRenderer3d;
import org.jzy3d.javafx.controllers.mouse.JavaFXCameraMouseController;
<!-- <dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>1.0.0</version>
</dependency>-->
<dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>0.9.1</version>
</dependency>
<!-- <dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>0.9.2-SNAPSHOT</version>
</dependency>-->
<repositories>
<repository>
<id>jzy3d-snapshots</id>
<name>Jzy3d Snapshots</name>
<url>http://maven.jzy3d.org/snapshots</url>
</repository>
<repository>
<id>jzy3d-releases</id>
<name>Jzy3d Releases</name>
<url>http://maven.jzy3d.org/releases</url>
</repository>
</repositories>
Those classes are available in this maven dependency.
<dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-javafx</artifactId>
<version>1.0.0</version>
</dependency>
Add only the release repository.
<repositories>
<repository>
<id>jzy3d-releases</id>
<name>Jzy3d Releases</name>
<url>http://maven.jzy3d.org/releases </url>
</repository>
</repositories>
Related
I'm trying to use Azure Monitor OpenTelemetry Exporter client library for Java to export all traces/spans from Spring Cloud Sleuth to Azure Monitor. This integration seems to only work with the newest version of Spring Cloud Sleuth after the recent dependency version updates.
However instead of using azureMonitorExporter.export(spanData) manually, I would like to export all traces/spans automatically for the whole application by just adding a configuration for Azure exporter. This could then easily be added to a new project.
I don't have much experience using Spring/Sleuth/OpenTelemetry, but AzureMonitorExporter implements SpanExporter, so I thought one option could be to create a configuration class that contains the following.
#Bean
public SpanExporter exporter() {
return new AzureMonitorExporterBuilder()
.instrumentationKey("{KEY}")
.buildExporter();
};
And then it could be used in the main class using:
#Autowired
SpanExporter exporter;
However I'm not sure if this is the right way or how to continue from here to actually get the exporter to start exporting traces/spans automatically to Azure monitor.
My pom.xml looks like this:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>trace-demo-5-updated</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>trace-demo-5-updated</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>2020.0.0-SNAPSHOT</spring-cloud.version>
</properties>
<dependencies>
<!-- Sleuth with Brave tracer implementation -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>opentelemetry-exporters-azuremonitor</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-otel</artifactId>
<version>3.0.0-M6</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Update (2020-01-26):
With today's release of Spring Cloud Sleuth OTel (spring-cloud-sleuth-otel:1.0.0-M3) and The OTel upgrade in the Azure SDK, your original issue should disappear.
Original Answer
(TL;DR: last paragraph)
The Sleuth 3.0 Migration Guide can help you out a lot here. Sleuth supports two tracing systems Brave (default) and OpenTelemetry (incubator).
In order to use OpenTelemetry, you need to remove Brave (just exclude spring-cloud-sleuth-brave) and add OpenTelemetry (spring-cloud-sleuth-otel-autoconfigure with spring-cloud-sleuth-otel-dependencies). See the docs I linked.
After you do this, your SpanExporter should be used, here's a pom.xml I created based on yours. Btw, adding a sample project (e.g.: in a GitHub repo) could help a lot for everyone who is trying to help so that they don't need to create one themselves.
Unfortunately, this still won't work, you will still face with this exception at startup:
Caused by: java.lang.ClassNotFoundException: io.opentelemetry.common.AttributeValue
This is because opentelemetry-exporters-azuremonitor:1.0.0-beta.1 depends on OpenTelemetry 0.8.0 while the latest spring-cloud-sleuth-otel (1.0.0-M2, we released it today) is using the latest OpenTelemetry (0.13.1). Also, OpenTelemetry introduced breaking changes between minor versions, e.g.: the AttributeValue class was removed in OpenTelemetry 0.9.1.
Sleuth supports OpenTelemetry since Sleuth 3.0.0-M5, The OpenTelemetry version was 0.10 back then so there is no Sleuth version available that would support an OpenTelemetry version as old as opentelemetry-exporters-azuremonitor:1.0.0-beta.1 needs.
So the solution would be fixing your pom.xml and opentelemetry-exporters-azuremonitor supporting the latest OpenTelemetry.
I want to run uniCent open source in my laptop but don't able to find onewire library. my import are:
import com.dalsemi.onewire.OneWireAccessProvider;
import com.dalsemi.onewire.adapter.DSPortAdapter;
import com.dalsemi.onewire.container.OneWireContainer;
import com.dalsemi.onewire.application.monitor.*;
How can I download these jar files?
Locate the repositories section and replace it with this :
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>unicenta-repo</id>
<url>https://repo.unicenta.org/maven2/</url>
</repository>
<repository>
<url>https://download.java.net/maven/2/</url>
<id>restapi</id>
<layout>default</layout>
<name>Repository for library Library[restapi]</name>
</repository>
<repository>
<id>central-maven-repo</id>
<url>https://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
</repositories>
Add below dependency :
<dependency>
<groupId>com.dalsemi.onewire</groupId>
<artifactId>owapi</artifactId>
<version>1.10</version>
</dependency>
Give it a try by running mvn clean install command.
I am using confluent and according to the official document, I only have to configure below in pom.xml like this:
<repositories>
<repository>
<id>confluent</id>
<url>http://packages.confluent.io/maven/</url>
</repository>
<!-- further repository entries here -->
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<!-- For CP 3.1.0 -->
<version>0.10.1.0-cp1</version>
</dependency>
</dependencies>
But seems kafka_2.11 with version 0.10.1.0-cp1 does not exits.
The website http://packages.confluent.io/maven/ cannot be reached too.
How can I get it?
I am using below maven dependancy its working fine for me :
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
<version>0.10.2.0-cp1</version>
</dependency>
<repository>
<id>confluent</id>
<name>Confluent</name>
<url>http://packages.confluent.io/maven/</url>
</repository>
Hopefully this will help
I'm following this guide spring-data-jdbc-ext
and i'm trying to set this dependency on my pom.xml
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc</artifactId>
<version>1.0.0.M2</version>
</dependency>
but i ended up on this error
No such file or directory found on the repository using this maven dependency (provided on the quick start guide).
I'm using Maven version 4.0.0
Add this repository to your pom:
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
I'm trying to upgrade a custom plugin for jira, 6.3.15 to 7.1.4 but when I upload the plugin on a jira test environment then fail and catalina.out is:
Plugin only requires permission [] which doesn't include 'execute_java', yet has some java code (classes, libs, spring context, etc), making it un- loadable.
googling I see that: https://docs.atlassian.com/atlassian-plugins-api/4.0.0-m004/atlassian-plugins-api/apidocs/com/atlassian/plugin/Permissions.html#addPermission(com.atlassian.plugin.Plugin,%20java.lang.String,%20com.atlassian.plugin.InstallationMode)
but I dont understand how to solve it, any idea?
Plugin:
import java.util.Date;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.event.type.EventType;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.worklog.Worklog;
import com.atlassian.jira.issue.worklog.WorklogImpl;
import com.atlassian.jira.issue.worklog.WorklogManager;
import com.atlassian.jira.event.issue.IssueEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AsignedListenerWorklog implements IssueEventListener {
private static final Logger logger = LoggerFactory.getLogger(AsignedListenerWorklog.class);
protected WorklogManager worklogManager = ComponentAccessor.getWorklogManager();
public void workflowEvent(IssueEvent event) {
if (event.getEventTypeId() != EventType.ISSUE_DELETED_ID) {
onAssigned(event);
}
}
public boolean isOktoAssign(Issue issue) {
if (issue.getAssignee() != null) {
for (Worklog w : worklogManager.getByIssue(issue)) {
if (w.getUpdateAuthorKey().equals(issue.getAssignee().getName().toLowerCase())) {
return false;
}
}
return true;
}
logger.error("Issue Assigment null");
return false;
}
public void onAssigned(IssueEvent event) {
Issue issue = event.getIssue();
if (isOktoAssign(issue)) {
WorklogImpl worklog = new WorklogImpl(
worklogManager,
issue,
issue.getId(),
issue.getAssignee().getName().toLowerCase(),
issue.getSummary(),
new Date(),
null,
null,
60L
);
logger.info("Add 1m " + worklog.getUpdateAuthor() + " at issue " + issue.getKey());
worklogManager.create(issue.getAssignee(), worklog, 0L, false);
}
}
}
And POM:
<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/maven-v4_0_0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>xxx.xxxx</groupId>
<artifactId>jira-worklog-plugin</artifactId>
<name>Worklog Plugin</name>
<version>3.0</version>
<description>Plugin</description>
<repositories>
<repository>
<id>atlassian</id>
<url>https://maven.atlassian.com/content/repositories/atlassian-public</url>
</repository>
<repository>
<id>antoher</id>
<url>https://maven.atlassian.com/content/groups/public</url>
</repository>
<repository>
<id>public</id>
<url>nexus</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>releases</id>
<url>nexus</url>
</repository>
</distributionManagement>
</project>
atlassian-plugin.xml:
<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/maven-v4_0_0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>xxx.xxx</groupId>
<artifactId>jira-worklog-plugin</artifactId>
<name>Worklog Plugin</name>
<version>3.0</version>
<description>Plugin for update workflow on assigned issue</description>
<repositories>
<repository>
<id>atlassian</id>
<url>https://maven.atlassian.com/content/repositories/atlassian-public</url>
</repository>
<repository>
<id>antoher</id>
<url>https://maven.atlassian.com/content/groups/public</url>
</repository>
<repository>
<id>public</id>
<url>nexus</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>releases</id>
<url>nexus</url>
</repository>
</distributionManagement>
</project>
I changed the Pom:
<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/maven-v4_0_0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>xxx.xxx</groupId>
<artifactId>jira-worklog-plugin</artifactId>
<name>Worklog Plugin</name>
<version>3.0</version>
<description>Plugin for update workflow on assigned issue</description>
<repositories>
<repository>
<id>atlassian</id>
<url>https://maven.atlassian.com/content/repositories/atlassian-public</url>
</repository>
<repository>
<id>antoher</id>
<url>https://maven.atlassian.com/content/groups/public</url>
</repository>
<repository>
<id>public</id>
<url>nexus</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-core</artifactId>
<version>7.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>releases</id>
<url>nexus</url>
</repository>
</distributionManagement>
</project>
and the atlassian-plugin.xml on resources:
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="jira-xxx-plugin"/>
<!-- add our web resources -->
<web-resource key="jira-xxx-plugin-resources" name="jira-xxx-plugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="jira-xxx-plugin.css" location="/css/jira-xxx-plugin.css"/>
<resource type="download" name="jira-xxx-plugin.js" location="/js/jira-xxx-plugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>jira-xxx-plugin</context>
</web-resource>
</atlassian-plugin>
and it works!