Giter Club home page Giter Club logo

Comments (4)

FrankWork avatar FrankWork commented on May 24, 2024

java -jar SparrowRecSys-1.0-SNAPSHOT-jar-with-dependencies.jar
log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
webRootLocation: jar:file:/mnt/e/work/SparrowRecSys/target/SparrowRecSys-1.0-SNAPSHOT-jar-with-dependencies.jar!/webroot/
Web Root URI: jar:file:/mnt/e/work/SparrowRecSys/target/SparrowRecSys-1.0-SNAPSHOT-jar-with-dependencies.jar!/webroot/
Loading movie data from jar:file:/mnt/e/work/SparrowRecSys/target/SparrowRecSys-1.0-SNAPSHOT-jar-with-dependencies.jar!/webroot/sampledata/movies.csv ...
Exception in thread "main" java.io.FileNotFoundException: jar:file:/mnt/e/work/SparrowRecSys/target/SparrowRecSys-1.0-SNAPSHOT-jar-with-dependencies.jar!/webroot/sampledata/movies.csv (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.(FileInputStream.java:157)
at java.base/java.util.Scanner.(Scanner.java:639)
at com.sparrowrecsys.online.datamanager.DataManager.loadMovieData(DataManager.java:56)
at com.sparrowrecsys.online.datamanager.DataManager.loadData(DataManager.java:41)
at com.sparrowrecsys.online.RecSysServer.run(RecSysServer.java:58)
at com.sparrowrecsys.online.RecSysServer.main(RecSysServer.java:21)

from sparrowrecsys.

x-hacker avatar x-hacker commented on May 24, 2024

通过修改:SparrowRecSys-master/src/main/java/com/sparrowrecsys/online/RecSysServer.java文件里面:
设置为相应文件的绝对路径可以临时解决:
String path = "/Users/github/SparrowRecSys-master/src/main/resources/webroot/";
DataManager.getInstance().loadData(path + "sampledata/movies.csv" .........
具体原因还得等大佬来回答

from sparrowrecsys.

Mccreeeee avatar Mccreeeee commented on May 24, 2024

问题在于本身这个URI指向的是这个jar包,他是个文件,然后底下的load方法尝试使用Scanner去读取文件(jar包)中的文件,这是有问题的,需要改成使用Stream的方式去读取

loadMovieData等方法中修改Scanner读取的方式
Scanner scanner = new Scanner(new BufferedInputStream(this.getClass().getResourceAsStream(movieDataPath)));

然后启动类中修改为相对路径即可
DataManager.getInstance().loadData("/webroot/sampledata/movies.csv",
"/webroot/sampledata/links.csv","/webroot/sampledata/ratings.csv",
"/webroot/modeldata/item2vecEmb.csv",
"/webroot/modeldata/userEmb.csv",
"i2vEmb", "uEmb");

from sparrowrecsys.

iqiancheng avatar iqiancheng commented on May 24, 2024

如果了解一点Spring Boot 不妨看看Java的实现:https://github.com/iqiancheng/sparrow-recsys-spring-boot
欢迎探讨

from sparrowrecsys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.