Giter Site home page Giter Site logo

Comments (8)

pdolega avatar pdolega commented on July 19, 2024

What's wrong with this project working on 2.11 ? We finalized two projects with bluesprints-scala on Scala 2.11.6 + Java 8.

What are the problems you encounter with this setup ?

from blueprints-scala.

pdolega avatar pdolega commented on July 19, 2024

Builds are passing with all the tests on Scala 2.11 and Java 7 / Java 8:

image

from blueprints-scala.

simerplaha avatar simerplaha commented on July 19, 2024

This the error I am getting trying to run blueprints-scala with OrientDB . I assumed it is due that fact the ScalaObject is deprecated since version 2.10.0. I've read this post on StackOverFlow http://stackoverflow.com/questions/7781547/noclassdeffounderror-scala-scalaobject-in-mixed-scala-java-project and when I check my project's "External Libraries" (Intellij) I have SBT: org.scala-lang:scala-library:2.11.7:jar included. So I am not sure where I am going wrong here.

Exception in thread "main" java.lang.NoClassDefFoundError: scala/ScalaObject
at com.ansvia.graph.util.CaseClassSigParser$.com$ansvia$graph$util$CaseClassSigParser$$isExcluded(Poso.scala:272)
at com.ansvia.graph.util.CaseClassSigParser$.parse(Poso.scala:332)
at com.ansvia.graph.util.CaseClassDeserializer$$anonfun$6.apply(Poso.scala:193)
at com.ansvia.graph.util.CaseClassDeserializer$$anonfun$6.apply(Poso.scala:193)
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:194)
at com.ansvia.graph.util.CaseClassDeserializer$$anon$3.scala$collection$mutable$SynchronizedMap$$super$getOrElseUpdate(Poso.scala:36)
at scala.collection.mutable.SynchronizedMap$class.getOrElseUpdate(SynchronizedMap.scala:40)
at com.ansvia.graph.util.CaseClassDeserializer$$anon$3.getOrElseUpdate(Poso.scala:36)
at com.ansvia.graph.util.CaseClassDeserializer$.serialize(Poso.scala:193)
at com.ansvia.graph.ObjectConverter$.serialize(ObjectConverter.scala:42)
at com.ansvia.graph.DbWrapper.save(DbWrapper.scala:26)
at com.ba.messaging.actor.DatabaseStarterActor$.delayedEndpoint$com$ba$messaging$actor$DatabaseStarterActor$1(DatabaseStarterActor.scala:68)
at com.ba.messaging.actor.DatabaseStarterActor$delayedInit$body.apply(DatabaseStarterActor.scala:12)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at com.ba.messaging.actor.DatabaseStarterActor$.main(DatabaseStarterActor.scala:12)
at com.ba.messaging.actor.DatabaseStarterActor.main(DatabaseStarterActor.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

Caused by: java.lang.ClassNotFoundException: scala.ScalaObject
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 27 more

This is my build.sbt file

name := "messaging-system"

version := "1.0"

scalaVersion := "2.11.7"

crossScalaVersions := Seq("2.11.0", "2.10.0")

scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-language:implicitConversions")

resolvers ++= Seq(
  "typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
  "Ansvia repo" at "http://scala.repo.ansvia.com/releases/",
  "Sonata type" at "https://oss.sonatype.org/content/repositories/snapshots"
)

libraryDependencies ++= {
  val akkaV = "2.3.11"
  val sprayV = "1.3.3"
  val gremlinScalaV = "2.4.2"
  Seq(
    "io.spray" %% "spray-can" % sprayV,
    "io.spray" %% "spray-routing" % sprayV,
    "io.spray" %% "spray-testkit" % sprayV % "test",
    "io.spray" %% "spray-json" % "1.3.2",
    "io.spray" %% "spray-client" % sprayV,
    "io.spray" %% "spray-httpx" % sprayV,
    "com.typesafe.akka" %% "akka-actor" % akkaV,
    "com.typesafe.akka" %% "akka-testkit" % akkaV % "test",
    "org.specs2" %% "specs2-core" % "2.3.11" % "test",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4",
    "com.github.tototoshi" %% "scala-csv" % "1.2.1",
    "com.github.tototoshi" % "slick-joda-mapper_2.10" % "0.2.0",
    "com.typesafe" % "slick_2.10" % "1.0.0-RC2",
    "com.orientechnologies" % "orientdb-core" % "2.0.11",
    "com.orientechnologies" % "orientdb-graphdb" % "2.0.11",
    "com.michaelpollmeier" % "gremlin-scala" % gremlinScalaV,
    "com.ansvia.graph" % "blueprints-scala_2.10" % "0.1.41",
    "com.tinkerpop.gremlin" % "gremlin-java" % "2.5.0"
  )
}

This is the code I am trying to run

implicit val db = new OrientGraphFactory(uri).setupPool(1, 10).getTx()
case class Person(name: String, kind: String)
val hercules = Person("hercules", "demigod")
db.save(hercules)

from blueprints-scala.

pdolega avatar pdolega commented on July 19, 2024

You pulled wrong version of blueprints scala in this line:

...
"com.ansvia.graph" % "blueprints-scala_2.10" % "0.1.41",
...

Just use:

...
"com.ansvia.graph" %% "blueprints-scala" % "0.1.61",
...

from blueprints-scala.

pdolega avatar pdolega commented on July 19, 2024

Now - just after pressing "Comment" I realized that problem may be different (I did quick check which seems to confirm my suspicion).

While we do have releases and Travis builds for Scala 2.11.x we may not have these artifacts published to Maven Central. For me it wasn't a problem since we have our own Jenkins job which at the end published blueprints-scala artifacts to our company's Nexus.

@anvie is it possible that you are not publishing 2.11 artifacts to Maven Central ? (I couldn't find any). By the way is this process automated (e.g. via Travis builds) ? @janm399 wrote nice blog post about that here - we should be able to automate whole thing if it's done manually.

from blueprints-scala.

simerplaha avatar simerplaha commented on July 19, 2024

@pdolega you are right! I was using the wrong version. Just so that I don't have to wait for the latest artifacts to be available on Maven central I have built the project locally and published it to my local ivy repository to use in my project. Hopefully the latest artifacts will be published to Maven soon.

Thanks heaps.

from blueprints-scala.

pdolega avatar pdolega commented on July 19, 2024

@simerplaha cool, good to hear that it works for you now.
@anvie let me know what do you think about releasing artifacts from Travis. It should be possible to do that without exposing your Sonatype credentials (as described here)

from blueprints-scala.

anvie avatar anvie commented on July 19, 2024

@pdolega cool, i dunno if that possible, thx for pointer, I will made changes soon when I have a time.
Looks like @simerplaha problem has been solved, closed.

from blueprints-scala.

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.