How to add IronMQ to my Play! java project?

420 views Asked by At

I am having problems with IronMQ in java. could not find how to get it from maven. so downloaded the jar into my lib folder. then kept getting runtime error.

[NoClassDefFoundError: com/google/gson/JsonSyntaxException]

now i'm stuck on this. waiting for an answer from support.

1

There are 1 answers

0
Or Gal On

this answer came from their support.

you use these maven settings and add them to your build.scala file.

it uses gson so you need that too.

<repositories>
<repository>
<id>iron-io-repo</id>
<name>Iron.io Maven repository on GitHub</name>
<url>http://iron-io.github.com/maven/repository/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ironmq</groupId>
<artifactId>ironmq</artifactId>
<version>0.0.8</version>
<scope>compile</scope>
</dependency>
</dependencies> 

and here is my build.scala for it:

val appDependencies = Seq(
            // Add your project dependencies here,
            "com.google.code.morphia" % "morphia" % "0.99",
            "org.mongodb" % "mongo-java-driver" % "2.7.3",
            "com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
            "com.github.mumoshu" %% "play2-memcached" % "0.2.1-SNAPSHOT",
            "com.rabbitmq" % "amqp-client" % "2.8.4",
            "com.google.code.gson" % "gson" % "2.1",
            "ironmq" % "ironmq" % "0.0.8"
    )

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
            // Add your own project settings here
            resolvers += "Maven repository" at "http://morphia.googlecode.com/svn/mavenrepo/",
            resolvers += "MongoDb Java Driver Repository" at "http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/",
            resolvers += "Spy Repository" at "http://files.couchbase.com/maven2",
            resolvers += "Iron.io Maven repository on GitHub" at "http://iron-io.github.com/maven/repository/"
    )

and of course run reload and update after that. it should run successfully.