Trying to run the JGraphT hello world example, POM per here looks like:
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>1.4.0</version>
But this is not pulling down the org.jgrapht.nio.* it seems, file tree below:
What do I need in the POM to do these successfully:
import org.jgrapht.nio.*;
import org.jgrapht.nio.dot.DOTExporter;
Thanks
For me, it works when I add this following dependency :
<dependency>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-io</artifactId>
<version>1.4.0</version>
</dependency>
in the pom.xml file.
After that, import the dependency in your file of code :
import org.jgrapht.nio.*;
Related
I tried maven repo like this:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>2.7.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-yarn-api -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
<version>2.7.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-yarn-client -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
<version>2.7.2</version>
</dependency>
Then my java code:
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.api.ApplicationConstants;
import org.apache.hadoop.yarn.api.records.*;
import org.apache.hadoop.yarn.client.api.YarnClient;
import org.apache.hadoop.yarn.client.api.YarnClientApplication;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.exceptions.YarnException;
public static void main(String[] args) {
YarnConfiguration yarnConfiguration = new YarnConfiguration();
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(yarnConfiguration);
yarnClient.start();
}
Intellij ide shows "Cannot solve method init" and "Cannot solve method start".
I then tried to use jar version of 3.1.1 instead of "2.7.2". Same result. So what's wrong with my code and how to fix it?
the init and start method are derived from the AbstractService class.
you need to verify the YarnClient and AbstractService has the same version.
go to YarnClient and check the jar it refer to, then click on the AbstractService parent from the Yarn client and check his version.
change the YarnClient version according to your AbstractService version.
i had the same issue, it works for me . version 2.6.5 .
I'm trying to run a face recognition example using javacv, but there is a mismatch in the methods arguments types.
I'm using the following maven dependencies:
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacv</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.0.0-1.1</version>
</dependency>
<dependency>
I'm referring to this example: http://pcbje.github.io/misc/2012/12/01/doing-face-recognition-with-javacv.html
Imports:
import static org.bytedeco.javacpp.opencv_face.createFisherFaceRecognizer;
import static org.bytedeco.javacpp.opencv_imgproc.CV_BGR2GRAY;
import static org.bytedeco.javacpp.opencv_imgproc.cvCvtColor;
import static org.bytedeco.javacpp.opencv_imgcodecs.cvLoadImage;
import static org.bytedeco.javacpp.opencv_core.IPL_DEPTH_8U;
import java.io.File;
import java.io.FilenameFilter;
import org.bytedeco.javacpp.opencv_core.IplImage;
import org.bytedeco.javacpp.opencv_core.Mat;
import org.bytedeco.javacpp.opencv_core.MatVector;
import org.bytedeco.javacpp.opencv_face.FaceRecognizer;
The only difference is that they are using com.googlecode.javacv, but as far as I understand this is old. However I downloaded those jars from http://www.java2s.com/Code/Jar/j/Downloadjavacvjar.htm, but I'm still not able to compile successfully.
Can you please advice. Thank you.
[SOLVED] - Please refer to this example
I have my Storm testing topology done, and before I created a d3 script on an Html code, that readed the data from a text file. I want it now to read the data directly from a Storm topology (a bolt maybe?) But I have no clue of how to do it. I'm using Horton Works Sandbox for the testing, Any help would be apprecieated.
Thanks in advance!
I've found a storm package for redis that I'm trying to use now. It allows you to set a bolt for writting on redis, and I've set the node already. My problem now is that eclipse can't find the imports of the java code and the ones on the pom.xml.I've downloaded the package. My current java bolt and imports are:
package Storm.practice.Storm.Prova;
import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.StormSubmitter;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.testing.TestWordSpout;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.TopologyBuilder;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
import backtype.storm.utils.Utils;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.topology.base.BaseRichSpout;
import java.util.Map;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;
import storm.external.*;// error from here
import storm.external.storm-redis.org.apache.storm.redis.common.config.JedisClusterConfig;
import org.apache.storm.redis.common.config.JedisPoolConfig;
import org.apache.storm.redis.common.mapper.RedisDataTypeDescription;
import org.apache.storm.redis.common.mapper.RedisStoreMapper;
import redis.clients.jedis.JedisCommands;//to here
..........
class MortsStoreMapper implements RedisStoreMapper {
private RedisDataTypeDescription description;
private final String hashKey = "wordCount";
public WordCountStoreMapper() {
description = new RedisDataTypeDescription(
RedisDataTypeDescription.RedisDataType.HASH, hashKey);
}
#Override
public RedisDataTypeDescription getDataTypeDescription() {
return description;
}
#Override
public String getKeyFromTuple(ITuple tuple) {
return tuple.getStringByField("word");
}
#Override
public String getValueFromTuple(ITuple tuple) {
return tuple.getStringByField("count");
}
}
And my pom.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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Storm.practice</groupId>
<artifactId>Storm.Prova</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Storm.Prova</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>0.9.1-incubating</version>
</dependency>
<dependency> #error from here...
<groupId>org.apache.storm</groupId>
<artifactId>storm-redis</artifactId>
<version>{0.9.1-incubating}</version>
<type>jar</type>
</dependency>#... to here
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>Storm.practice.Storm.Prova.ProvaTopology</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
The errors are that Eclipse can't find the dependences and the packages
Based on your scenario, I think you will need some system or code in the middle that will read data from Storm and push to D3. You can try out something like WSO2 CEP [1], which has the ability to connect to Storm and uses websockets to push events to a dashboard based on d3 [2].
In your scenario, you can map your logic in the Storm bolt to a Siddhi query [3] and then get those events from Storm to WSO2 CEP. Then you can create a websocket publisher to send events to your D3 code using the built-in websocket capabilities of the server.
Please note that this is one of the possible solutions based on your requirements and you might be better off utilizing the capabilities of an already existing CEP system that has integration to Storm and D3.
Hope this helps!
[1] http://wso2.com/products/complex-event-processor/
[2] https://docs.wso2.com/display/CEP400/Visualizing+Results+in+the+Analytics+Dashboard
[3] https://docs.wso2.com/display/CEP400/Sample+0501+-+Processing+a+Simple+Filter+Query+with+Apache+Storm+Deployment
I now it's a bit late, almost a year, but I was reviewing my account, and saw this question.
I finally used Redis, interfaced wit Jedis, that I import as a Maven artifact. Once this was working and I was able to see the results with the Redis Monitor via telnet, I created a simple Node.js code, launched it, and the data was arriving to the client, hence to d3. I needed Socket.io and Redis.js to achieve this, but is working now.
If someone need some details, please, ask me and I will help you happily.
I am trying to use a jar given by my teacher in my code. So I placed the jar in a lib directory in my project and ran this command :
mvn install:install-file -Dfile=lib/IDLogger.jar -DgroupId=IDLogger -DartifactId=IDLogger -Dversion=1.0 -Dpackaging=jar
Everything is fine.
Then I add the dependency to the pom :
<dependency>
<groupId>IDLogger</groupId>
<artifactId>IDLogger</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
But then when I try to use the jar, the compilation fails and tells me that the symbol(the class) can't be found. I even tried adding an import statement :
import IDLogger.IDLogger;
but it tells me that there is no such package.
How can I use this jar in my code in maven?
This is the code :
IDLogger logger = IDLogger.getInstance();
...
logger.logID(id);
I get the symbol IDLogger not found error
This is as much as I know about this custom jar...
Try to add your lib in system scope :
1. add in your project :
Your Project/lib
+IDLogger.jar
2. in your pom :
<dependency>
<groupId>IDLogger</groupId>
<artifactId>IDLogger</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/IDLogger.jar</systemPath>
</dependency>
hi i am working with a spring mvc project and i want to be able to do this annotation
#EnableSpringConfigured
in the top of one of my classes like this
#Configuration
#EnableSpringConfigured <---- this one gives me troubles
#ComponentScan( basePackages = {"com.abc.dom", "com.abc.repo", "com.abc.auth"})
#EnableJpaRepositories(basePackages="com.abc.repo")
public class ConfigJPA
{
....
}
what maven dependency should i have in my pom.xml to be able to do this import:
import org.springframework.context.annotation.aspectj.EnableSpringConfigured;
my spring version is 4.0.6.RELEASE
this is how i added the dependency and it worked
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
Reimeus the link to the page that you give the artifactId was added like this
<artifactId>org.springframework.aspects</artifactId>
instead like <artifactId>spring-aspects</artifactId> thats why it dont worked for me, but thanks anyway it helped me too