How to access javax/persistence/ from client? - jpa

When running java hwai.Main from directory target/classes, I get an error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/Persistence
at hwai.Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: javax.persistence.Persistence
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
...
I get the same error when I'm running java hwai.Main from directory target/test1/WEB-INF/classes
This is my project structure after running mvn package glassfish:redeploy:
├── pom.xml
├── src
│   └── main
│   ├── java
│   │   ├── hwai
│   │   │   ├── helloWorld.java
│   │   │   ├── helloWorldResource.java
│   │   │   ├── Main.java
│   │   │   ├── StudentPOJO.java
│   │   │   ├── StudentRest.java
│   │   │   └── Todo.java
│   │   └── META-INF
│   │   └── persistence.xml
│   └── webapp
│   ├── index.html
│   └── WEB-INF
│   └── web.xml
└── target
├── classes
│   └── hwai
│   ├── helloWorld.class
│   ├── helloWorldResource.class
│   ├── Main.class
│   ├── StudentPOJO.class
│   ├── StudentRest.class
│   └── Todo.class
├── generated-sources
│   └── annotations
├── maven-archiver
│   └── pom.properties
├── maven-status
│   └── maven-compiler-plugin
│   └── compile
│   └── default-compile
│   ├── createdFiles.lst
│   └── inputFiles.lst
├── test1
│   ├── index.html
│   ├── META-INF
│   └── WEB-INF
│   ├── classes
│   │   └── hwai
│   │   ├── helloWorld.class
│   │   ├── helloWorldResource.class
│   │   ├── Main.class
│   │   ├── StudentPOJO.class
│   │   ├── StudentRest.class
│   │   └── Todo.class
│   ├── lib
│   │   ├── commonj.sdo-2.1.1.jar
│   │   ├── eclipselink-2.7.0.jar
│   │   ├── javax.json-1.0.4.jar
│   │   ├── javax.persistence-2.0.0.jar
│   │   └── validation-api-1.1.0.Final.jar
│   └── web.xml
└── test1.war
Searching the internet, I found Eclipse Warnings: class javax.persistence.* not found and java.lang.NoClassDefFoundError: javax/persistence/Persistence, but neither helped me. I'm quite a javaee newbie.
pom.xml contains among others
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
The import - statement in Main.java is
import javax.persistence.Persistence;

Related

Specs2 can't see a defined class in lift

Here is the code (from the Lift Framework Cookbook):
package code.snippet
import scala.xml.Text
import net.liftweb.util.Helpers._
/**
* Created by kaiyin on 20/06/15.
*/
class Animals {
def list = {
val animals = List(
("Dog", "(Canis lupus)"),
("Cat", "(Felis catus)"),
("Giraffe", "(Giraffa camelopardalis)"),
("Lion", "(Panthera leo)"),
("Horse", "(Equus ferus caballus)")
)
"li *" #> animals.map{
a =>
".name *" #> Text(a._1) &
".sname *" #> Text(a._2)
}
}
}
package code.snippet
/**
* Created by kaiyin on 20/06/15.
*/
import org.specs2.mutable._
class AnimalsSpec extends Specification {
"Animals list" should {
"contains 5 animals" in {
val result = <ul>
<li><span class="name">Dog</span> - <span class="sname">(Canis lupus familiaris)</span> </li>
<li><span class="name">Cat</span> - <span class="sname">(Felis catus)</span></li>
<li><span class="name">Giraffe</span> - <span class="sname">(Giraffa camelopardalis)</span></li>
<li><span class="name">Lion</span> - <span class="sname">(Panthera leo)</span></li>
<li><span class="name">Horse</span> - <span class="sname">(Equus ferus caballus)</span></li>
</ul>
val nodeSeq = Animals.list(<ul><li><span class="name"></span> - <span class="sname"></span></li></ul>)
nodeSeq.toString must ==/ (result)
// result.toString must ==/ (result.toString)
}
// "trivial" in {
// "what" must ==/ ("what")
// }
}
}
When I test in sbt, I got an error:
[error] /private/tmp/lift-lift_26_sbt-d71cccf/scala_211/contacts-app/src/test/scala/code/snippet/AnimalsSpec.scala:21: not found: value Animals
[error] val nodeSeq = Animals.list(<ul><li><span class="name"></span> - <span class="sname"></span></li></ul>)
[error] ^
[error] one error found
[error] (test:compile) Compilation failed
[error] Total time: 0 s, completed Jun 21, 2015 12:14:12 AM
It seems specs2 can't recognize the existence of the Animals class.
Directory structure:
.
├── build.sbt
├── console.devmode.log
├── project
│   ├── build.properties
│   ├── plugins.sbt
│   ├── project
│   │   └── target
│   │   └── config-classes
│   │   ├── $3e6a7b084670fb8947b9$.class
│   │   ├── $3e6a7b084670fb8947b9.cache
│   │   ├── $3e6a7b084670fb8947b9.class
│   │   ├── $8ee94f9a958d7b2659d3$.class
│   │   ├── $8ee94f9a958d7b2659d3.cache
│   │   ├── $8ee94f9a958d7b2659d3.class
│   │   ├── $f7c7d83ab25f0dfdaa50$.class
│   │   ├── $f7c7d83ab25f0dfdaa50.cache
│   │   └── $f7c7d83ab25f0dfdaa50.class
│   └── target
│   ├── config-classes
│   │   ├── $0849881d22cdcd44948f$$anonfun$$sbtdef$1.class
│   │   ├── $0849881d22cdcd44948f$.class
│   │   ├── $0849881d22cdcd44948f.cache
│   │   ├── $0849881d22cdcd44948f.class
│   │   ├── $249c304e0f040361c72d$$anonfun$$sbtdef$1.class
│   │   ├── $249c304e0f040361c72d$.class
│   │   ├── $249c304e0f040361c72d.cache
│   │   ├── $249c304e0f040361c72d.class
│   │   ├── $2a1513b04e5e84f6d714$$anonfun$$sbtdef$1.class
│   │   ├── $2a1513b04e5e84f6d714$.class
│   │   ├── $2a1513b04e5e84f6d714.cache
│   │   ├── $2a1513b04e5e84f6d714.class
│   │   ├── $3067d2a3c14aabb8a3f0$$anonfun$$sbtdef$1.class
│   │   ├── $3067d2a3c14aabb8a3f0$.class
│   │   ├── $3067d2a3c14aabb8a3f0.cache
│   │   ├── $3067d2a3c14aabb8a3f0.class
│   │   ├── $3a0715de5358d1f4e97f$$anonfun$$sbtdef$1.class
│   │   ├── $3a0715de5358d1f4e97f$.class
│   │   ├── $3a0715de5358d1f4e97f.cache
│   │   ├── $3a0715de5358d1f4e97f.class
│   │   ├── $86ef5cf155e942bdbe26$$anonfun$$sbtdef$1.class
│   │   ├── $86ef5cf155e942bdbe26$.class
│   │   ├── $86ef5cf155e942bdbe26.cache
│   │   ├── $86ef5cf155e942bdbe26.class
│   │   ├── $9696ca6e6d83674bcec7$$anonfun$$sbtdef$1.class
│   │   ├── $9696ca6e6d83674bcec7$.class
│   │   ├── $9696ca6e6d83674bcec7.cache
│   │   ├── $9696ca6e6d83674bcec7.class
│   │   ├── $99247c8be4b0760fec21$$anonfun$$sbtdef$1.class
│   │   ├── $99247c8be4b0760fec21$.class
│   │   ├── $99247c8be4b0760fec21.cache
│   │   ├── $99247c8be4b0760fec21.class
│   │   ├── $ad1c698366eb4866d3f8$$anonfun$$sbtdef$1.class
│   │   ├── $ad1c698366eb4866d3f8$.class
│   │   ├── $ad1c698366eb4866d3f8.cache
│   │   ├── $ad1c698366eb4866d3f8.class
│   │   ├── $b5fc3f4c63982e743df0$$anonfun$$sbtdef$1.class
│   │   ├── $b5fc3f4c63982e743df0$.class
│   │   ├── $b5fc3f4c63982e743df0.cache
│   │   ├── $b5fc3f4c63982e743df0.class
│   │   ├── $cec870caf77a892e02d5$$anonfun$$sbtdef$1$$anonfun$apply$1.class
│   │   ├── $cec870caf77a892e02d5$$anonfun$$sbtdef$1.class
│   │   ├── $cec870caf77a892e02d5$.class
│   │   ├── $cec870caf77a892e02d5.cache
│   │   ├── $cec870caf77a892e02d5.class
│   │   ├── $e22cedfd25e30fceaff3$.class
│   │   ├── $e22cedfd25e30fceaff3.cache
│   │   ├── $e22cedfd25e30fceaff3.class
│   │   ├── $e73abf325c03d09873ef$$anonfun$$sbtdef$1.class
│   │   ├── $e73abf325c03d09873ef$.class
│   │   ├── $e73abf325c03d09873ef.cache
│   │   └── $e73abf325c03d09873ef.class
│   ├── resolution-cache
│   │   ├── default
│   │   │   └── contacts-app-build
│   │   │   └── scala_2.10
│   │   │   └── sbt_0.13
│   │   │   └── 0.1-SNAPSHOT
│   │   │   ├── resolved.xml.properties
│   │   │   └── resolved.xml.xml
│   │   └── reports
│   │   ├── default-contacts-app-build-compile-internal.xml
│   │   ├── default-contacts-app-build-compile.xml
│   │   ├── default-contacts-app-build-docs.xml
│   │   ├── default-contacts-app-build-optional.xml
│   │   ├── default-contacts-app-build-plugin.xml
│   │   ├── default-contacts-app-build-pom.xml
│   │   ├── default-contacts-app-build-provided.xml
│   │   ├── default-contacts-app-build-runtime-internal.xml
│   │   ├── default-contacts-app-build-runtime.xml
│   │   ├── default-contacts-app-build-scala-tool.xml
│   │   ├── default-contacts-app-build-sources.xml
│   │   ├── default-contacts-app-build-test-internal.xml
│   │   ├── default-contacts-app-build-test.xml
│   │   ├── ivy-report.css
│   │   └── ivy-report.xsl
│   ├── scala-2.10
│   │   └── sbt-0.13
│   └── streams
│   ├── $global
│   │   ├── $global
│   │   │   └── $global
│   │   │   └── out
│   │   ├── ivyConfiguration
│   │   │   └── $global
│   │   │   └── out
│   │   ├── ivySbt
│   │   │   └── $global
│   │   │   └── out
│   │   ├── projectDescriptors
│   │   │   └── $global
│   │   │   └── out
│   │   └── update
│   │   └── $global
│   │   ├── inputs
│   │   ├── out
│   │   └── output
│   ├── compile
│   │   ├── $global
│   │   │   └── $global
│   │   │   └── data
│   │   ├── compile
│   │   │   └── $global
│   │   │   ├── export
│   │   │   └── out
│   │   ├── copyResources
│   │   │   └── $global
│   │   │   ├── copy-resources
│   │   │   └── out
│   │   ├── definedSbtPlugins
│   │   │   └── $global
│   │   │   └── out
│   │   ├── dependencyClasspath
│   │   │   └── $global
│   │   │   └── export
│   │   ├── exportedProducts
│   │   │   └── $global
│   │   │   └── export
│   │   ├── externalDependencyClasspath
│   │   │   └── $global
│   │   │   └── export
│   │   ├── incCompileSetup
│   │   │   └── $global
│   │   ├── internalDependencyClasspath
│   │   │   └── $global
│   │   │   └── export
│   │   ├── managedClasspath
│   │   │   └── $global
│   │   │   └── export
│   │   ├── unmanagedClasspath
│   │   │   └── $global
│   │   │   └── export
│   │   └── unmanagedJars
│   │   └── $global
│   │   └── export
│   └── runtime
│   ├── dependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── exportedProducts
│   │   └── $global
│   │   └── export
│   ├── externalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── fullClasspath
│   │   └── $global
│   │   └── export
│   ├── internalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── managedClasspath
│   │   └── $global
│   │   └── export
│   ├── unmanagedClasspath
│   │   └── $global
│   │   └── export
│   └── unmanagedJars
│   └── $global
│   └── export
├── sbt
├── sbt-launch-0.13.1.jar
├── sbt.bat
├── src
│   ├── main
│   │   ├── resources
│   │   │   ├── logback.xml
│   │   │   ├── props
│   │   │   │   └── default.props
│   │   │   ├── resources.properties
│   │   │   ├── resources_de.properties
│   │   │   └── resources_fr_FR.properties
│   │   ├── scala
│   │   │   ├── bootstrap
│   │   │   │   └── liftweb
│   │   │   │   └── Boot.scala
│   │   │   └── code
│   │   │   ├── comet
│   │   │   ├── lib
│   │   │   │   └── SendEmail.scala
│   │   │   ├── model
│   │   │   ├── snippet
│   │   │   │   ├── Animals.scala
│   │   │   │   ├── Calculator.scala
│   │   │   │   ├── EmailSnippet.scala
│   │   │   │   ├── HelloWorld.scala
│   │   │   │   ├── Inner.scala
│   │   │   │   ├── ListUser.scala
│   │   │   │   ├── Localization.scala
│   │   │   │   ├── Outer.scala
│   │   │   │   └── Table.scala
│   │   │   └── view
│   │   └── webapp
│   │   ├── WEB-INF
│   │   │   └── web.xml
│   │   ├── contacts
│   │   │   ├── create.html
│   │   │   ├── delete.html
│   │   │   ├── edit.html
│   │   │   ├── list.html
│   │   │   └── view.html
│   │   ├── images
│   │   │   └── ajax-loader.gif
│   │   ├── index.html
│   │   ├── send.html
│   │   ├── static
│   │   │   └── index.html
│   │   └── templates-hidden
│   │   ├── default.html
│   │   └── wizard-all.html
│   └── test
│   ├── resources
│   │   └── logback-test.xml
│   └── scala
│   ├── RunWebApp.scala
│   └── code
│   └── snippet
│   └── AnimalsSpec.scala
└── target
├── resolution-cache
│   ├── net.liftweb
│   │   └── lift-2-6-starter-template_2.11
│   │   └── 0.0.4
│   │   ├── resolved.xml.properties
│   │   └── resolved.xml.xml
│   └── reports
│   ├── ivy-report.css
│   ├── ivy-report.xsl
│   ├── net.liftweb-lift-2-6-starter-template_2.11-compile-internal.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-compile.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-container.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-docs.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-optional.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-plugin.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-pom.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-provided.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-runtime-internal.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-runtime.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-scala-tool.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-sources.xml
│   ├── net.liftweb-lift-2-6-starter-template_2.11-test-internal.xml
│   └── net.liftweb-lift-2-6-starter-template_2.11-test.xml
├── scala-2.11
│   ├── classes
│   │   ├── bootstrap
│   │   │   └── liftweb
│   │   │   ├── Boot$$anonfun$1.class
│   │   │   ├── Boot$$anonfun$10.class
│   │   │   ├── Boot$$anonfun$11.class
│   │   │   ├── Boot$$anonfun$12.class
│   │   │   ├── Boot$$anonfun$13.class
│   │   │   ├── Boot$$anonfun$14.class
│   │   │   ├── Boot$$anonfun$15.class
│   │   │   ├── Boot$$anonfun$2$$anonfun$apply$mcZ$sp$1.class
│   │   │   ├── Boot$$anonfun$2$$anonfun$apply$mcZ$sp$2.class
│   │   │   ├── Boot$$anonfun$2.class
│   │   │   ├── Boot$$anonfun$3.class
│   │   │   ├── Boot$$anonfun$4.class
│   │   │   ├── Boot$$anonfun$5.class
│   │   │   ├── Boot$$anonfun$6.class
│   │   │   ├── Boot$$anonfun$7.class
│   │   │   ├── Boot$$anonfun$8.class
│   │   │   ├── Boot$$anonfun$9.class
│   │   │   ├── Boot$$anonfun$boot$1.class
│   │   │   ├── Boot$$anonfun$boot$2.class
│   │   │   ├── Boot$$anonfun$boot$3.class
│   │   │   ├── Boot$$anonfun$configureMailer$1$$anonfun$apply$1$$anon$1.class
│   │   │   ├── Boot$$anonfun$configureMailer$1$$anonfun$apply$1.class
│   │   │   ├── Boot$$anonfun$configureMailer$1.class
│   │   │   └── Boot.class
│   │   ├── code
│   │   │   ├── lib
│   │   │   │   ├── SendEmail$.class
│   │   │   │   └── SendEmail.class
│   │   │   └── snippet
│   │   │   ├── Animals$$anonfun$list$1$$anonfun$apply$1$$anonfun$apply$2.class
│   │   │   ├── Animals$$anonfun$list$1$$anonfun$apply$1$$anonfun$apply$3.class
│   │   │   ├── Animals$$anonfun$list$1$$anonfun$apply$1.class
│   │   │   ├── Animals$$anonfun$list$1.class
│   │   │   ├── Animals.class
│   │   │   ├── Calculator$$anonfun$plus$1.class
│   │   │   ├── Calculator.class
│   │   │   ├── EmailSnippet$$anonfun$sendEmail$1$$anonfun$apply$1.class
│   │   │   ├── EmailSnippet$$anonfun$sendEmail$1.class
│   │   │   ├── EmailSnippet$$anonfun$sendNow$1.class
│   │   │   ├── EmailSnippet.class
│   │   │   ├── HelloWorld$$anonfun$howdy$1.class
│   │   │   ├── HelloWorld.class
│   │   │   ├── Inner$$anonfun$logged$1.class
│   │   │   ├── Inner$$anonfun$nonlogged$1.class
│   │   │   ├── Inner.class
│   │   │   ├── ListUser$$anonfun$list$1.class
│   │   │   ├── ListUser$$anonfun$list$2$$anonfun$apply$1.class
│   │   │   ├── ListUser$$anonfun$list$2.class
│   │   │   ├── ListUser$$anonfun$log$1.class
│   │   │   ├── ListUser$$anonfun$log$2.class
│   │   │   ├── ListUser$$anonfun$log$3.class
│   │   │   ├── ListUser.class
│   │   │   ├── Localization$$anonfun$dynamic$1.class
│   │   │   ├── Localization.class
│   │   │   ├── Outer$$anonfun$1.class
│   │   │   ├── Outer$$anonfun$choose$1.class
│   │   │   ├── Outer$$anonfun$choose$2.class
│   │   │   ├── Outer.class
│   │   │   ├── Table$$anonfun$1$$anonfun$apply$1.class
│   │   │   ├── Table$$anonfun$1.class
│   │   │   ├── Table$$anonfun$dynamic$1.class
│   │   │   ├── Table$$anonfun$dynamic$2.class
│   │   │   ├── Table$$anonfun$dynamic$3$$anonfun$apply$2$$anonfun$apply$3.class
│   │   │   ├── Table$$anonfun$dynamic$3$$anonfun$apply$2$$anonfun$apply$4.class
│   │   │   ├── Table$$anonfun$dynamic$3$$anonfun$apply$2.class
│   │   │   ├── Table$$anonfun$dynamic$3.class
│   │   │   └── Table.class
│   │   ├── logback.xml
│   │   ├── props
│   │   │   └── default.props
│   │   ├── resources.properties
│   │   ├── resources_de.properties
│   │   └── resources_fr_FR.properties
│   └── test-classes
│   ├── RunWebApp$.class
│   ├── RunWebApp$delayedInit$body.class
│   ├── RunWebApp.class
│   ├── WEB-INF
│   │   └── web.xml
│   ├── code
│   │   └── snippet
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$1$$anonfun$apply$2.class
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$1$$anonfun$apply$3.class
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$1.class
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$4$$anonfun$apply$5.class
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$4$$anonfun$apply$6.class
│   │   ├── AnimalsSpec$$anonfun$1$$anonfun$apply$4.class
│   │   ├── AnimalsSpec$$anonfun$1.class
│   │   └── AnimalsSpec.class
│   ├── contacts
│   │   ├── create.html
│   │   ├── delete.html
│   │   ├── edit.html
│   │   ├── list.html
│   │   └── view.html
│   ├── images
│   │   └── ajax-loader.gif
│   ├── index.html
│   ├── logback-test.xml
│   ├── send.html
│   ├── static
│   │   └── index.html
│   └── templates-hidden
│   ├── default.html
│   └── wizard-all.html
├── specs2-reports
│   └── stats
│   └── code.snippet.AnimalsSpec.stats
└── streams
├── $global
│   ├── $global
│   │   └── $global
│   │   └── out
│   ├── ivyConfiguration
│   │   └── $global
│   │   └── out
│   ├── ivySbt
│   │   └── $global
│   │   └── out
│   ├── projectDescriptors
│   │   └── $global
│   │   └── out
│   └── update
│   └── $global
│   ├── inputs
│   ├── out
│   └── output
├── compile
│   ├── $global
│   │   └── $global
│   │   └── data
│   ├── compile
│   │   └── $global
│   │   ├── export
│   │   └── out
│   ├── copyResources
│   │   └── $global
│   │   ├── copy-resources
│   │   └── out
│   ├── dependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── exportedProducts
│   │   └── $global
│   │   └── export
│   ├── externalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── incCompileSetup
│   │   └── $global
│   │   └── inc_compile
│   ├── internalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── managedClasspath
│   │   └── $global
│   │   └── export
│   ├── unmanagedClasspath
│   │   └── $global
│   │   └── export
│   └── unmanagedJars
│   └── $global
│   └── export
├── container
│   └── $global
│   └── $global
│   └── data
├── runtime
│   ├── dependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── exportedProducts
│   │   └── $global
│   │   └── export
│   ├── externalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── fullClasspath
│   │   └── $global
│   │   └── export
│   ├── internalDependencyClasspath
│   │   └── $global
│   │   └── export
│   ├── managedClasspath
│   │   └── $global
│   │   └── export
│   ├── unmanagedClasspath
│   │   └── $global
│   │   └── export
│   └── unmanagedJars
│   └── $global
│   └── export
└── test
├── $global
│   └── $global
│   └── data
├── compile
│   └── $global
│   ├── export
│   └── out
├── copyResources
│   └── $global
│   ├── copy-resources
│   └── out
├── definedTests
│   └── $global
│   └── out
├── dependencyClasspath
│   └── $global
│   └── export
├── exportedProducts
│   └── $global
│   └── export
├── externalDependencyClasspath
│   └── $global
│   └── export
├── fullClasspath
│   └── $global
│   └── export
├── incCompileSetup
│   └── $global
│   └── inc_compile
├── internalDependencyClasspath
│   └── $global
│   └── export
├── loadedTestFrameworks
│   └── $global
│   └── out
├── managedClasspath
│   └── $global
│   └── export
├── test
│   ├── $global
│   │   ├── out
│   │   └── succeeded_tests
│   └── isModule=false\ name=code.snippet.AnimalsSpec
│   └── out
├── unmanagedClasspath
│   └── $global
│   └── export
└── unmanagedJars
└── $global
└── export
204 directories, 304 files
Not sitting with a compiler at the moment, but should you not use new as it is a class and not an object?
val nodeSeq = Animals.list(...)
Should be
val nodeSeq = new Animals.list(...)
Or you can change class Animals into object Animals.

Unable to access Scala's Akka libraries in JRuby

I'm using jruby 1.7.12 (1.9.3p392) and I want to take advantage of the Scala Akka library. I'm aware of the Mikka gem, but I want to do this manually.
I've downloaded the Akka library "2.3.8" from http://akka.io/downloads/ (specifically the link "Akka 2.3.8 distribution for Scala 2.11").
Below is the file structure (one app.rb JRuby file and the rest is the downloaded Akka library)...
├── akka-2.3.8
| ├── bin
| ├── config
| ├── deploy
| ├── doc
│   ├── lib
│   │   ├── akka
│   │   │   ├── akka-actor_2.11-2.3.8.jar
│   │   │   ├── akka-agent_2.11-2.3.8.jar
│   │   │   ├── akka-camel_2.11-2.3.8.jar
│   │   │   ├── akka-cluster_2.11-2.3.8.jar
│   │   │   ├── akka-contrib_2.11-2.3.8.jar
│   │   │   ├── akka-dataflow_2.11-2.3.8.jar
│   │   │   ├── akka-durable-mailboxes-2.3.8.jar
│   │   │   ├── akka-file-mailbox_2.11-2.3.8.jar
│   │   │   ├── akka-kernel_2.11-2.3.8.jar
│   │   │   ├── akka-mailboxes-common_2.11-2.3.8.jar
│   │   │   ├── akka-multi-node-testkit_2.11-2.3.8.jar
│   │   │   ├── akka-persistence-experimental_2.11-2.3.8.jar
│   │   │   ├── akka-persistence-tck-experimental_2.11-2.3.8.jar
│   │   │   ├── akka-remote-tests_2.11-2.3.8.jar
│   │   │   ├── akka-remote_2.11-2.3.8.jar
│   │   │   ├── akka-slf4j_2.11-2.3.8.jar
│   │   │   ├── akka-testkit_2.11-2.3.8.jar
│   │   │   ├── akka-transactor_2.11-2.3.8.jar
│   │   │   ├── akka-zeromq_2.11-2.3.8.jar
│   │   │   ├── camel-core-2.10.3.jar
│   │   │   ├── config-1.2.1.jar
│   │   │   ├── guava-12.0.jar
│   │   │   ├── hamcrest-core-1.3.jar
│   │   │   ├── hawtjni-runtime-1.8.jar
│   │   │   ├── jna-3.0.9.jar
│   │   │   ├── jnr-constants-0.8.2.jar
│   │   │   ├── jsr305-1.3.9.jar
│   │   │   ├── junit-4.11.jar
│   │   │   ├── leveldb-0.5.jar
│   │   │   ├── leveldb-api-0.5.jar
│   │   │   ├── leveldbjni-1.7.jar
│   │   │   ├── leveldbjni-all-1.7.jar
│   │   │   ├── leveldbjni-linux32-1.5.jar
│   │   │   ├── leveldbjni-linux64-1.5.jar
│   │   │   ├── leveldbjni-osx-1.5.jar
│   │   │   ├── leveldbjni-win32-1.5.jar
│   │   │   ├── leveldbjni-win64-1.5.jar
│   │   │   ├── netty-3.8.0.Final.jar
│   │   │   ├── protobuf-java-2.5.0.jar
│   │   │   ├── scala-continuations-library_2.11-1.0.2.jar
│   │   │   ├── scala-reflect-2.11.0.jar
│   │   │   ├── scala-stm_2.11-0.7.jar
│   │   │   ├── scalatest_2.11-2.1.3.jar
│   │   │   ├── slf4j-api-1.7.5.jar
│   │   │   ├── uncommons-maths-1.2.2a.jar
│   │   │   └── zeromq-scala-binding_2.11-0.0.7-spark.jar
│   │   └── scala-library-2.11.4.jar
│   └── src
│   └── akka
│   ├── akka-actor_2.11-2.3.8-sources.jar
│   ├── akka-agent_2.11-2.3.8-sources.jar
│   ├── akka-camel_2.11-2.3.8-sources.jar
│   ├── akka-cluster_2.11-2.3.8-sources.jar
│   ├── akka-contrib_2.11-2.3.8-sources.jar
│   ├── akka-dataflow_2.11-2.3.8-sources.jar
│   ├── akka-durable-mailboxes-2.3.8-sources.jar
│   ├── akka-file-mailbox_2.11-2.3.8-sources.jar
│   ├── akka-kernel_2.11-2.3.8-sources.jar
│   ├── akka-mailboxes-common_2.11-2.3.8-sources.jar
│   ├── akka-multi-node-testkit_2.11-2.3.8-sources.jar
│   ├── akka-persistence-experimental_2.11-2.3.8-sources.jar
│   ├── akka-persistence-tck-experimental_2.11-2.3.8-sources.jar
│   ├── akka-remote-tests_2.11-2.3.8-sources.jar
│   ├── akka-remote_2.11-2.3.8-sources.jar
│   ├── akka-slf4j_2.11-2.3.8-sources.jar
│   ├── akka-testkit_2.11-2.3.8-sources.jar
│   ├── akka-transactor_2.11-2.3.8-sources.jar
│   └── akka-zeromq_2.11-2.3.8-sources.jar
└── app.rb
The contents of the app.rb file is...
require "java"
$CLASSPATH << "akka-2.3.8"
$: << File.join(File.dirname(__FILE__), "akka-2.3.8")
java_import java.lang.System
java_import "akka.actor.ActorRegistry"
java_import "akka.actor.Actors"
java_import "akka.actor.UntypedActor"
...I appreciate that (in JRuby) $CLASSPATH and the load path $: are mapped, but I thought I would try both.
Running app.rb causes the following error (importing java.lang.System is fine, the akka.actor.ActorRegistry is the first line that breaks)...
NameError: cannot load Java class akka.actor.ActorRegistry
for_name at org/jruby/javasupport/JavaClass.java:1250
get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
java_import at file:/Users/markmcdonnell/.rubies/jruby-1.7.12/lib/jruby.jar!/jruby/java/core_ext/object.rb:26
map at org/jruby/RubyArray.java:2409
java_import at file:/Users/markmcdonnell/.rubies/jruby-1.7.12/lib/jruby.jar!/jruby/java/core_ext/object.rb:22
(root) at size.rb:7
What is the problem here. Have I not downloaded the right files or am I not referencing them properly?
Maybe the << does not add all the individual jars to the classpath? You might have to look for something else to include all jars in lib and lib/akka. Unfortunately I don't know enough JRuby to tell you how to do it.
Also: you are importing classes (ActorRegistry, Actors) that don't exist in Akka 2.3.8. Please check the latest API docs, and make sure you are not trying an Akka 1.x example (as ActorRegistry would indicate).
So, the following seems to work, maybe you can use that as a starting point:
require "java"
$CLASSPATH << "akka-2.3.8/lib/scala-library-2.11.4.jar"
$CLASSPATH << "akka-2.3.8/lib/akka/akka-actor_2.11-2.3.8.jar"
$CLASSPATH << "akka-2.3.8/lib/akka/config-1.2.1.jar"
java_import java.lang.System
java_import "akka.actor.ActorRef"
java_import "akka.actor.ActorSystem"
java_import "akka.actor.Props"
java_import "akka.actor.UntypedActor"

Game_ cannot be resolved to a variable in arquillian persistance example

I was asking on #arquillian Freenode IRC channel about question
Arquillian JPA tutorial: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
when a user told me that he successfully runned
https://github.com/arquillian/arquillian-examples/tree/master/arquillian-persistence-tutorial
so I did
git clone https://github.com/arquillian/arquillian-examples.git
then in Eclipse, I clicked File->Import->Existing Maven Projects and selecte the subdirectory
arquillian-examples/arquillian-persistence-tutorial
Once Eclipse finished importing the project, I obtain in file
/src/test/java/org/arquillian/example/GamePersistenceTest.java
line 146, the error message
Game_ cannot be resolved to a variable
What can I do? In my attempt at the link at beginning of the page, this did not happpen.
I did not change any file downloaded from git repo.
Folder tree
.
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── org
│   │   │   └── arquillian
│   │   │   └── example
│   │   │   └── Game.java
│   │   └── resources
│   │   └── META-INF
│   │   └── persistence.xml
│   └── test
│   ├── java
│   │   └── org
│   │   └── arquillian
│   │   └── example
│   │   └── GamePersistenceTest.java
│   ├── resources
│   │   ├── arquillian.launch
│   │   ├── arquillian.xml
│   │   └── jbossas-ds.xml
│   ├── resources-glassfish-embedded
│   │   ├── glassfish-resources.xml
│   │   ├── logging.properties
│   │   └── test-persistence.xml
│   ├── resources-glassfish-remote
│   │   └── test-persistence.xml
│   └── resources-jbossas-managed
│   └── test-persistence.xml
└── target
├── classes
│   ├── META-INF
│   │   ├── MANIFEST.MF
│   │   ├── maven
│   │   │   └── org.arquillian.example
│   │   │   └── arquillian-persistence-tutorial
│   │   │   ├── pom.properties
│   │   │   └── pom.xml
│   │   └── persistence.xml
│   └── org
│   └── arquillian
│   └── example
│   └── Game.class
└── test-classes
├── arquillian.launch
├── arquillian.xml
├── glassfish-resources.xml
├── jbossas-ds.xml
├── logging.properties
├── org
│   └── arquillian
│   └── example
│   └── GamePersistenceTest.class
└── test-persistence.xml
30 directories, 24 files
The _Game class in that example is generated by the Hibernate JPA 2 metamodel generator (hibernate-jpamodelgen) that is defined as a dependency in the project POM. You'll now need to generate the metamodel by employing one the options outlined in the metamodel generator reference guide.
You could use Eclipse itself by configuring the annotation processing phase. Or you could modify the POM to use the maven-compiler-plugin configuration specified in the guide, to run as part of your build.

Which folders are unnecessary while deploying a play! app?

I have finally made a production worthy app with play, and use the play war -o foo command to create an exploded war. However, its size goes on to 30 MB and there are a lot of folders included. I develop in eclipse, so there are some eclipse folders too. Below is a list of the folders I have. Can anyone help me out with the unnecessary folders? I have zeroed in on the app, conf, public and lib folders. Is my assumption correct?
├── app
│   ├── controllers
│   ├── jobs
│   │   ├── daily
│   │   └── monthly
│   ├── models
│   │   ├── encrypt
│   │   ├── file
│   │   ├── login
│   │   └── mail
│   ├── playground
│   └── views
│   ├── Application
│   └── errors
├── conf
├── eclipse
│   └── classes
│   ├── controllers
│   ├── jobs
│   │   ├── daily
│   │   └── monthly
│   ├── models
│   │   ├── encrypt
│   │   ├── file
│   │   ├── login
│   │   └── mail
│   └── playground
├── lib
├── logs
├── public
│   ├── bootstrap
│   │   ├── css
│   │   ├── img
│   │   ├── js
│   │   │   └── tests
│   │   │   ├── unit
│   │   │   └── vendor
│   │   └── less
│   ├── images
│   ├── javascripts
│   └── stylesheets
├── test
└── tmp
├── bytecode
│   └── DEV
└── classes
├── controllers
├── helpers
├── jobs
│   ├── daily
│   └── monthly
├── models
│   ├── encrypt
│   ├── file
│   ├── login
│   └── mail
└── playground
You need to delete your tmp folder as well, try to use play clean on your project.
All folders in app, conf, lib and public should be kept in your war. Maybe should add precompiled

Lift: Comet component not found / Class not found

For my first steps into Lift I just started with this tutorial but it won't work for me. Instead of the simple chat app I only get these two exceptions:
Error processing snippet: comet
Reason: Comet Component not found
and
Error processing snippet: ChatIn
Reason: Class Not Found
Here is the directory structure of my compiled webapp:
target/chat-1.0-SNAPSHOT/
├── index.html
├── META-INF
└── WEB-INF
├── classes
│   └── code
│   ├── comet
│   │   ├── Chat$$anonfun$lowPriority$1.class
│   │   ├── Chat.class
│   │   ├── ChatServer$$anonfun$lowPriority$1.class
│   │   ├── ChatServer.class
│   │   └── ChatServer$.class
│   └── snippet
│   ├── ChatIn$$anonfun$render$1.class
│   ├── ChatIn.class
│   └── ChatIn$.class
├── lib
│   ├── activation-1.1.jar
│   ├── commons-codec-1.4.jar
│   ├── commons-fileupload-1.2.2.jar
│   ├── derby-10.7.1.1.jar
│   ├── h2-1.2.147.jar
│   ├── htmlparser-1.2.1.jar
│   ├── joda-time-1.6.2.jar
│   ├── lift-actor_2.9.0-2.4-M3.jar
│   ├── lift-common_2.9.0-2.4-M3.jar
│   ├── lift-db_2.9.0-2.4-M3.jar
│   ├── lift-json_2.9.0-2.4-M3.jar
│   ├── lift-mapper_2.9.0-2.4-M3.jar
│   ├── lift-proto_2.9.0-2.4-M3.jar
│   ├── lift-util_2.9.0-2.4-M3.jar
│   ├── lift-webkit_2.9.0-2.4-M3.jar
│   ├── mail-1.4.4.jar
│   ├── paranamer-2.3.jar
│   ├── scala-compiler-2.9.0.jar
│   ├── scala-library-2.9.0.jar
│   ├── scalap-2.9.0.jar
│   └── slf4j-api-1.6.1.jar
└── web.xml
But as you can see, there are the compiled .class files for Chat, ChatServer and ChatIn, so what's wrong?
Please bring this question to the Lift Google group: https://groups.google.com/forum/#!forum/liftweb
It's likely that your Boot.scala doesn't contain the correct information, but without the source, it's tough to figure out the issue.