Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import a class from a jar? #45

Open
tribbloid opened this issue Jun 27, 2014 · 10 comments
Open

How to import a class from a jar? #45

tribbloid opened this issue Jun 27, 2014 · 10 comments

Comments

@tribbloid
Copy link

I'm trying to combine it with Apache Spark (one of the hottest framework for data analysis) but I don't know how to do it. Can someone give me a hint so I can possibly implement it myself? Of course, if someone is still maintaining this project.

@MasseGuillaume
Copy link

I think you only need to add it to the kernel dependencies

libraryDependencies ++= Seq(

@tylerprete
Copy link

Tribbloid, I'm trying to get it working with spark as well. Adding it to the kernel allows you to import it, but I'm still running into issues because scala notebook uses akka 2.1.4, while spark 1.0 uses akka 2.2.3. If you get it working, I'd love to hear about it, and I'll do the same.

@tribbloid
Copy link
Author

Hi Tyler,

Thanks a lot! I'm not a proficient sbt user but I've encounter another jar hell problem in maven: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-throws-NoSuchFieldError-when-testing-on-cluster-mode-td8064.html#a8083

The solution in maven is to include maven-shade plugin and rename the akka package in the notebook (since spark-shell will always load himself first). I'll fork this repo and migrate to maven in a few days.

I'm not sure if sbt-assembly has a similar switch that can do this. Perhaps it worths a try :)

Yours Peng

@KenCoder
Copy link
Contributor

I tried upgrading to akka 2.2 but had trouble with the remote forking. Maybe I'll try it again.

Ken

On Jun 29, 2014, at 9:10 PM, Tyler Prete [email protected] wrote:

Tribbloid, I'm trying to get it working with spark as well. Adding it to the kernel allows you to input it, but I'm still running it issues because scala notebook uses akka 2.1.4, while spark 1.0 uses akka 2.2.3. If you get it working, I'd love to hear about it, and I'll do the same.


Reply to this email directly or view it on GitHub.

@andypetrella
Copy link

Hi all, I'm going to give this a try. However, I would prefer to catch up where you guyz are. Is there any sample repo from where I can go ahead?
Thanks in advance

@andypetrella
Copy link

So I started an integration... the hard way, but works quite fine: https://github.com/andypetrella/scala-notebook/tree/spark

@akhld
Copy link

akhld commented Sep 19, 2014

Any doc to get it working with Spark?

@andypetrella
Copy link

I'll try to put some doc in the README, and most probably a blog, however the changes are quite deep and will be hard (non trivial) to migrate back :-(

@akhld
Copy link

akhld commented Sep 20, 2014

I gave this one a try https://github.com/andypetrella/scala-notebook/tree/spark but it couldn't compile the code. See the image below
image

@andypetrella
Copy link

To not pollute this entry, could you fill an issue on the repo? Although this is not a compilation error but a (AFAICS) a misusage of sbt.
There are several manner to use it, the longer but safer:

sbt
project server
run

The fastest:

sbt server/run

elemgee pushed a commit to elemgee/scala-notebook that referenced this issue Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants