Git Product home page Git Product logo

Comments (19)

biswanaths avatar biswanaths commented on July 17, 2024

Which scala version are you using ? Did you updated your scala version recently ?

from scala-xml.

jrudolph avatar jrudolph commented on July 17, 2024

See also: http://stackoverflow.com/questions/32087774/to-compile-xml-syntax-the-scala-xml-package-must-be-on-the-classpath

@Chikooo starting with Scala 2.11.x you can only use XML literals if you add an explicit dependency to scala-xml to your build. How to do this depends on the build system you use. The most recent artifact is currently this one: http://search.maven.org/#artifactdetails|org.scala-lang.modules|scala-xml_2.11|1.0.5|bundle

If you use sbt you need to add this line to your build definition:

libraryDependencies += "org.scala-lang.modules" % "scala-xml_2.11" % "1.0.5"

@biswanaths I think the problem is that there's a Scala compiler error message that points to https://github.com/scala/scala-xml without giving enough information about what is wrong if you are a Scala/Java beginner. Maybe the README could contain a section that helps these users to solve the immediate problem.

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

jrudolph:

Exactly without even giving what is wrong it is redirecting to GitHub. I am a scala beginner. I have added that line too in build.sbt
I am trying out spray project using sbt on IntelliJ

biswanaths:

I am using latest version of scala.

from scala-xml.

biswanaths avatar biswanaths commented on July 17, 2024

@jrudolph , Lets augment the non-existent wiki with most commonly faced problems. I think that will be helpful and quick turnaround for common problems faced by the user.

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

@biswanaths
Do you have any idea how to do it in IntelliJ?
I am facing this issue since yesterday and couldn't find solution for it.

from scala-xml.

jrudolph avatar jrudolph commented on July 17, 2024

@Chikooo you need to provide much more details. What did you try exactly? How did you come so far? How did you create your original IntelliJ project? What does it mean that you are "facing this issue since yesterday"? Time is probably not the reason that it now fails if it worked before so something else must have changed as well.

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

@jrudolph
Sorry for abrupt explanation.
I have started reading about Spray from 2 days and wanted to run basic web service to explore how it runs.
I have created a Scala SBT project in IntelliJ.
I have edited "build.sbt" file for the error I have mentioned above but still facing the same issue.
Can you tell me like for "scala-xml" what all files I need to change? and what changes I need to do?
OR
If you are familiar with IntellJ, can you tell me exacts steps to create Spray service from "scratch"?
Later will be helpful.

from scala-xml.

biswanaths avatar biswanaths commented on July 17, 2024

@Chikooo , can you post your sbt file ?

from scala-xml.

biswanaths avatar biswanaths commented on July 17, 2024

Will be closing this issue as without more information, I strongly believe this is a either a sbt configuration issue or intellij issue.

@Chikooo , Please do reopen the issue, if the issue is still persisting with more information.

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

@biswanaths : i could successfully run the code. I have added some line of code to the sbt file. thanks for your help. If you have basic sample spray codes can you send them to me?
If in case I face some issue in future i'll post here.

from scala-xml.

biswanaths avatar biswanaths commented on July 17, 2024

Great that you resolved your issue. I work with spary, but will try to find any basic spray template and send it to you.

You are more than welcome to reach out, if you face any problems.

Have a good day.

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

@biswanaths
I am trying to build Spray service to fetch data from MySQL using scala.
Can you tell me which all files I need to create?
As far as I know, we need to edit

  1. application.conf
  2. case class file
  3. build.sbt
  4. plugins.sbt

Is there anything else I need to create? Do you have sample example for this?

from scala-xml.

jrudolph avatar jrudolph commented on July 17, 2024

@Chikooo you can try asking questions like this on either stackoverflow.com or on the spray-user mailing list at https://groups.google.com/forum/#!forum/akka-user.

This is not the place where you will get answer for a questions about a totally different topic :)

from scala-xml.

Chikooo avatar Chikooo commented on July 17, 2024

@jrudolph oops. I am really sorry. :) I'll ask there.

from scala-xml.

derek-pappas avatar derek-pappas commented on July 17, 2024

Scala newbie here with a solution including steps for updating the libs and refreshing in Eclipse.
If you want to use scala.xml and get compile errors in Eclipse try this:
Add this line to the build.sbt file as the @jrudolph mentioned above.

libraryDependencies += "org.scala-lang.modules" % "scala-xml_2.11" % "1.0.5"

$ sbt

> update
> eclipse

Go to Eclipse and refresh the project
The compile errors in Eclipse should be gone.

from scala-xml.

biswanaths avatar biswanaths commented on July 17, 2024

Hey @derek-pappas , thanks for the steps. This will help lot of people down the line. I will try to put this in wiki. Thanks again.

from scala-xml.

derek-pappas avatar derek-pappas commented on July 17, 2024

Hi

You are welcome. Thank you taking care of the code!

I was stuck until I guessed I had to use set update. I was glad I stuck
with it. I am tired of Java and Python. I can see that Scala can cut my
programming time significantly and make the code more maintainable. But the
entry curve into the language is steep because of the tools. I had problems
getting Eclipse and Intellij working until I figured out that I needed to
upgrade to Java 8. Neither Intellij or Eclipse told me to update the system
to Java 8.

What would be really cool is if in Eclipse and Intellij the error message
would actually tell the user what to do to fix the problem. There is a big
disconnect between what the error message says to do and what actually
needs to be done. I know that this improvement would help newbies like
myself immensely. I have used 6-7 different build tools and ~8 different
languages but the set problem had me stumped. I am not complaining but
informing you of the situation facing newcomers to the Scala/SBT world.

Some message like:
The blah blah lib has not been downloaded to your machine.
The blah blah lib should either be available by running an SBT update which
will then download the lib to the local cache or by setting your Nexus vars
to point to your Nexus server. Blah Blah Blah.

Splitting out the library makes sense but there needs to be a clear set of
instructions not just for scala.xml but for all libs that have to be added
to get the code to compile.

Looking in the ~/.ivy cache after I discovered it gave me a clue about what
the problem was.

Derek Pappas

On Fri, Sep 11, 2015 at 10:28 PM, biswanaths [email protected]
wrote:

Hey @derek-pappas https://github.com/derek-pappas , thanks for the
steps. This will help lot of people down the line. I will try to put this
in wiki. Thanks again.


Reply to this email directly or view it on GitHub
#79 (comment).

from scala-xml.

ratibbrahim avatar ratibbrahim commented on July 17, 2024

Hi Guys
I've a big issue in the same context , I was struggling running this code https://github.com/alejopelaez/VirtualP2P but i couldn't , Please , could anyone give a hand how to resolve this , I'm using eclipse, java 1.8 and scala 2.12
thank you

from scala-xml.

SethTisue avatar SethTisue commented on July 17, 2024

@ratibbrahim try https://users.scala-lang.org perhaps, and show exactly what you tried and what error you got

from scala-xml.

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.