Running Scala on command line error

441 views
Skip to first unread message

Jean-Rassaire Fouefack

unread,
Nov 28, 2017, 8:59:23 AM11/28/17
to scalismo
Hi
due to the memory issue, I am trying to use the university server to run my code on the command line with Linux.
I  connected to the server properly and run SBT project. After running it gives option number as following to run each method.

When I select a number I got the error below as you can see below I selected number 20.

Please look at the error below and let me know what could be the problem.



login as: ffcjea001

Multiple main classes detected, select one to run:

 [1] PCA.PCScore
 [2] Plugins.FittingwithModel
 [3] StatisticalAnalysis.MANOVA
 [4] PCA.Eigenvalues
 [5] Plugins.SurfaceToSurfaceDifference
 [6] NormalisedPCA.NormalisedDataMatrix
 [7] TangentSpace.TransformMeshToMatrix
 [8] PCACrossdata.CrossDataEigDecomp
 [9] VerticesSelection.MeshToSignificantVector
 [10] Plugins.MeasureDrift
 [11] Plugins.DataMatrixWithtreshold
 [12] Plugins.SSMPcaWithflexibility
 [13] ScalismoPCA.NormalisedPCAWithTreshold
 [14] VerticesSelection.EllipsoidVolumCsvfile
 [15] Plugins.ReflectionObject
 [16] ScalismoPCA.NormalisedPCA
 [17] Plugins.CentroidSizeOfMesh
 [18] MarginalPCA.MarginalAreaOfshape
 [19] NormalisedVerticeSelection.NormalisedEllipsoidVolumeOfVertex
 [20] ScalismoPCA.pca
 [21] VerticesSelection.EllipsoidVolumeOfVertex
 [22] StatisticalAnalysis.DiscriminantAnalysis
 [23] Plugins.LandmarkError
 [24] TangentSpace.ProjectionToTangentSpace
 [25] VerticesSelection.getcorrespendpointOfId
 [26] PCA.DataMatrix
 [27] NormalisedVerticeSelection.NormalisedEllipsoidVolumCsvfile
 [28] NormalisedPCA.NormalisedDataMatrixWithtreshold
 [29] Plugins.MeshToVector
 [30] Plugins.meshTomatrix
 [31] ScalismoPCA.PCAWithTreshold
 [32] Plugins.FemurDataRigidAligned
 [33] Plugins.Hausdorff
 [34] NormalisedPCA.NormalisedPCScore
 [35] Plugins.SSMPca
 [36] VerticesSelection.testsinglecode
 [37] Plugins.ExampleApp
 [38] Plugins.MeshWithcolorvariation
 [39] MarginalPCA.MarginalDataMatrix
 [40] PCA.NaitivePCs

Enter number: 20

[info] Running ScalismoPCA.pca 3



It seems like there's an exception while loading the JOGL libraries.
The reason might be that the program is running on a headless system.
If that is the case, try enabling the "java.awt.headless" property,
e.g. java -Djava.awt.headless=true -jar program.jar



scalismo.support.nativelibs.NativeLibraryException: javax.media.nativewindow.NativeWindowException: X11Util.Display: Unable to create a display(nil) connection. Thread run-main-0
        at scalismo.support.nativelibs.NativeLibraryException.wrap(NativeLibraryException.java:45)
        at scalismo.support.nativelibs.jogl.JoglLibraryBundle.onInitializeEnd(JoglLibraryBundle.java:105)
        at scalismo.support.nativelibs.impl.NativeLibraryBundle.initialize(NativeLibraryBundle.java:192)
        at scalismo.support.nativelibs.NativeLibraryBundlesImplementation.initialize(NativeLibraryBundlesImplementation.java:131)
        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 scalismo.support.nativelibs.NativeLibraryBundles.delegateInitializeCall(NativeLibraryBundles.java:166)
        at scalismo.support.nativelibs.NativeLibraryBundles.initialize(NativeLibraryBundles.java:56)
        at scalismo.package$.initialize(package.scala:30)
        at ScalismoPCA.pca$.main(pca.scala:34)
        at ScalismoPCA.pca.main(pca.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 sbt.Run.invokeMain(Run.scala:67)
        at sbt.Run.run0(Run.scala:61)
        at sbt.Run.sbt$Run$$execute$1(Run.scala:51)
        at sbt.Run$$anonfun$run$1.apply$mcV$sp(Run.scala:55)
        at sbt.Run$$anonfun$run$1.apply(Run.scala:55)
        at sbt.Run$$anonfun$run$1.apply(Run.scala:55)
        at sbt.Logger$$anon$4.apply(Logger.scala:85)
        at sbt.TrapExit$App.run(TrapExit.scala:248)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.media.nativewindow.NativeWindowException: X11Util.Display: Unable to create a display(nil) connection. Thread run-main-0
        at jogamp.nativewindow.x11.X11Util.openDisplay(X11Util.java:452)
        at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.isDeviceSupported(X11GLXDrawableFactory.java:246)
        at jogamp.opengl.SharedResourceRunner.getOrCreateShared(SharedResourceRunner.java:187)
        at jogamp.opengl.x11.glx.X11GLXDrawableFactory.getOrCreateSharedResourceImpl(X11GLXDrawableFactory.java:379)
        at jogamp.opengl.x11.glx.X11GLXDrawableFactory.getOrCreateSharedResourceImpl(X11GLXDrawableFactory.java:81)
        at jogamp.opengl.GLDrawableFactoryImpl.getOrCreateSharedResource(GLDrawableFactoryImpl.java:100)
        at jogamp.opengl.GLDrawableFactoryImpl.createSharedResourceImpl(GLDrawableFactoryImpl.java:129)
        at javax.media.opengl.GLDrawableFactory.createSharedResource(GLDrawableFactory.java:375)
        at javax.media.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1877)
        at javax.media.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1838)
        at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1807)
        at javax.media.opengl.GLProfile.access$000(GLProfile.java:77)
        at javax.media.opengl.GLProfile$1.run(GLProfile.java:201)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:187)
        at scalismo.support.nativelibs.jogl.JoglLibraryBundle$1.run(JoglLibraryBundle.java:124)
        at scalismo.support.nativelibs.jogl.JoglLibraryBundle.onInitializeEnd(JoglLibraryBundle.java:95)
        ... 24 more

Exception: sbt.TrapExitSecurityException thrown from the UncaughtExceptionHandler in thread "run-main-0"
java.lang.RuntimeException: Nonzero exit code: 1
        at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 35 s, completed Nov 28, 2017 11:06:04 AM
ffcjea001@srvslshpc001:~/project-code-10-07-2017>

Please, what could be the issue?

Marcel Luethi

unread,
Nov 28, 2017, 11:11:26 AM11/28/17
to Jean-Rassaire Fouefack, scalismo
Hi Jean-Raissaire,

You need to run the jvm in headless mode like this:
sbt -Djava.awt.headless=true run

Best regards,

Marcel
> --
> You received this message because you are subscribed to the Google Groups
> "scalismo" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scalismo+u...@googlegroups.com.
> To post to this group, send email to scal...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/scalismo/a6e32a7a-9bcb-4496-ad85-5327de2a362d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages