ScalaFXML Application Cannot Find Controller - scala

I have a ScalaFX application and I am using FXML for my views. I am having a terrible time connecting the views to the controllers. I cannot find much information online except examples on Github and it doesn't work even when I try to mimic how they did it. Here is how I connect it in the FXML.
imports...
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="520.0" minWidth="880.0" prefHeight="520.0"
prefWidth="880.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="scala/scalafxml/ToolbarController">
<center....
Here is my controller class...
#sfxml
class ToolbarController extends JFXApp {
//open new form
def newForm = {
val resource = getClass.getResource("/scala/scalafxml/form.fxml")
The stack trace says it specifically can't find the controller class referenced by fx:controller. Here it is.
Exception in Application start method
Workaround until RT-13281 is implemented: keep toolkit alive
[error] (run-main-0) java.lang.RuntimeException: Exception in Application start method
java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182)
at com.sun.javafx.application.LauncherImpl$$Lambda$9/777613804.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/Users/patrickslagle/scala/MyApps/PattyCakesWorksheet/target/scala-2.10/classes/scalafxml/calendar.fxml:9
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2605)
at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:104)
at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:918)
at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:967)
at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:216)
at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:740)
at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2711)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2531)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2445)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3218)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3179)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3152)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3128)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3108)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3101)
at FXMLMain$delayedInit$body.apply(FXMLMain.scala:16)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scalafx.application.JFXApp$$anonfun$init$1.apply(JFXApp.scala:297)
at scalafx.application.JFXApp$$anonfun$init$1.apply(JFXApp.scala:297)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
at scalafx.application.JFXApp$class.init(JFXApp.scala:297)
at FXMLMain$.init(FXMLMain.scala:10)
at scalafx.application.AppHelper.start(AppHelper.scala:33)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
at com.sun.javafx.application.LauncherImpl$$Lambda$60/206252937.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl$$Lambda$56/1146564181.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl$$Lambda$58/354390534.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl$$Lambda$57/1198063642.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: java.lang.ClassNotFoundException: scala/scalafxml/ToolbarController
at java.lang.ClassLoader.findClass(ClassLoader.java:530)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[trace] Stack trace suppressed: run last compile:run for the full output.
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: 11 s, completed May 24, 2016 3:32:56 PM
The FXML file is found at src/main/resources/scalafxml/calendar.fxml and the controller is in src/main/scala/scalafxml/ToolbarController.scala.
I may have something obviously wrong as I'm pretty green at Scala. Any pointers are greatly appreciated.

Take a look at this standalone example:
https://github.com/vigoo/scalafxml-unit-converter-example
You should have a separate controller class and a JFXApp, and use theFXMLView constructor from ScalaFXML to create the view.

Related

Unable to run the jbehave story file through junit

I am creating a frame work for automation testing using jbehave story files and junit for running it.
PFB:
This is my class file from where I am running the code:
I have defined the path of the story file even then junit is not able to collect the story for execution. getting this response:
org.jbehave.core.io.StoryResourceNotFound: Story path 'ConnectedDevicesManagementPage.story' not found by class loader sun.misc.Launcher$AppClassLoader#2f0e140b
at org.jbehave.core.io.LoadFromClasspath.resourceAsStream(LoadFromClasspath.java:44)
at org.jbehave.core.io.LoadFromClasspath.loadResourceAsText(LoadFromClasspath.java:29)
at org.jbehave.core.io.LoadFromClasspath.loadStoryAsText(LoadFromClasspath.java:38)
at org.jbehave.core.embedder.PerformableTree.storyOfPath(PerformableTree.java:193)
at org.jbehave.core.embedder.PerformableTree.addStories(PerformableTree.java:68)
at org.jbehave.core.embedder.StoryManager.runStories(StoryManager.java:78)
at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:203)
at com.cdm.BrowserFactory.BrowserSelector.storyPaths(BrowserSelector.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at de.codecentric.jbehave.junit.monitoring.JUnitReportingRunner.getStoryPathsFromJUnitStories(JUnitReportingRunner.java:142)
at de.codecentric.jbehave.junit.monitoring.JUnitReportingRunner.<init>(JUnitReportingRunner.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
If I am changing the storypath as below then getting this in console:
Sep 23, 2016 5:43:33 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1474632816231 Marionette INFO Listening on port 53647
Sep 23, 2016 5:43:38 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Processing system properties {}
Using controls EmbedderControls[batch=false,skip=false,generateViewAfterStories=true,ignoreFailureInStories=false,ignoreFailureInView=false,verboseFailures=false,verboseFiltering=false,storyTimeoutInSecs=300,threads=1]
(BeforeStories)
(AfterStories)
Generating reports view to 'C:\Users\CMD_AUTOMATION\CDM_AUTOMATIOM\target\jbehave' using formats '[stats, console, txt, junitscenarioreporter]' and view properties '{reports=ftl/jbehave-reports-with-totals.ftl, decorateNonHtml=true}'
Reports view generated with 0 stories (of which 0 pending) containing 0 scenarios (of which 0 pending)
I have stuck with this from two days, trying lot of things from google but unable to solve it yet..please help me to resolve this.
First, update your jbehave core from 4.0 to 4.0.5 since junit runner is using reflection to do the work.
then, in your storyPaths method no need to call embedder.runStoriesAsPaths, it will be called from the run method.
just add this in storyPaths method:
#Override
public List<String> storyPaths() {
List<String> stories = new StoryFinder().findPaths(
codeLocationFromClass(this.getClass()), "**/*.story", "**/excluded*.story");
return stories;
}

Issue while Upgrading the SmartGWT version from 5.0 to 6.0

I have an application which is developed on SmartGWT. While upgrading SmartGWT 5.0 to 6.0 , This might be easy but no luck .i am getting the below exception
and i am using GWT 2.6.1 , can any one help me out to solve this issue.
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default) on project px-smartgwt-client: Failed to read module XML file sun
.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85: invalid LOC header (bad signature) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default) on project px-smartgwt-client: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.codehaus.mojo.gwt.shell.CompileMojo.compilationRequired(CompileMojo.java:576)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:437)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:351)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.codehaus.mojo.gwt.utils.GwtModuleReaderException: Failed to read module XML file sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream#541afb85
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:240)
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:194)
at org.codehaus.mojo.gwt.GwtModule.getLocalInherits(GwtModule.java:189)
at org.codehaus.mojo.gwt.GwtModule.getInherits(GwtModule.java:149)
at org.codehaus.mojo.gwt.GwtModule.getEntryPoints(GwtModule.java:114)
at org.codehaus.mojo.gwt.shell.CompileMojo.compilationRequired(CompileMojo.java:490)
... 24 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:61)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:717)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:420)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.codehaus.plexus.util.xml.XmlReader.getBOMEncoding(XmlReader.java:635)
at org.codehaus.plexus.util.xml.XmlReader.doRawStream(XmlReader.java:459)
at org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:180)
at org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:143)
at org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:86)
at org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:104)
at org.codehaus.mojo.gwt.AbstractGwtModuleMojo.readModule(AbstractGwtModuleMojo.java:233)
... 29 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/d...utionException
I am able to solve the above issue..Issue is with smartgwt jar is corrupted.. i downloaded the jar from this link (http://www.smartclient.com/builds/Sm...rtgwt-6.0p.zip)

Problems running REST example from Project Wonder wiki

I am new to Project Wonder and I am trying to run the second example in the tutorial, using REST. Even after adding the simple code to the Author and BlogEntry classes, I run into problems:
ERChangeNotification: Initializing ERChangeNotification framework
[2015-8-11 14:23:30 CEST] A fatal exception occurred:
java.lang.NoClassDefFoundError:
org/exolab/core/util/URI$MalformedURIException [2015-8-11 14:23:30
CEST] com.webobjects.foundation.NSForwardException
[java.lang.NoClassDefFoundError]
org/exolab/core/util/URI$MalformedURIException:java.lang.NoClassDefFoundError:
org/exolab/core/util/URI$MalformedURIException at
com.webobjects.foundation.NSForwardException._runtimeExceptionForThrowable(NSForwardException.java:43)
at
com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:124)
at
com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
at
com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
at
com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
at
com.webobjects.appserver.WOApplication.run(WOApplication.java:1239)
at
com.webobjects.appserver.WOApplication.main(WOApplication.java:548)
at your.app.Application.main(Application.java:10) Caused by:
java.lang.NoClassDefFoundError:
org/exolab/core/util/URI$MalformedURIException at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:274) at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242) at
javax.naming.InitialContext.(InitialContext.java:216) at
er.changenotification.ERCNConnectionKeeper.openConnection(ERCNConnectionKeeper.java:60)
at
er.changenotification.ERCNNotificationCoordinator.initialize(ERCNNotificationCoordinator.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606) at
com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
... 6 more Caused by: java.lang.ClassNotFoundException:
org.exolab.core.util.URI$MalformedURIException at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:425) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 21 more
I imported the PW source as instructed in the wiki and put it in the build path. In case there were build problems I deleted all the frameworks and started all over again, but I am getting the same problem.
Solved it. Seems there was some conflict with the libraries. I eliminated most of them and it started working. Thanks.

Actor creation error in akka

trying to create an actor in akka and call its receive function. I keep getting this error.
[ERROR] [10/26/2013 18:53:29.313] [messagespreading-akka.actor.default-dispatcher-4] [akka://messagespreading/user/$a] error while processing Create(-1187846526)
70ec3d6a-184d-403c-8166-04aec76200c9akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:169)
at akka.actor.ActorCell.create(ActorCell.scala:496)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:351)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:256)
at akka.dispatch.Mailbox.run(Mailbox.scala:211)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:502)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)
at scala.util.Random.nextInt(Random.scala:65)
at NetworkBuilder.<init>(pastry.scala:431)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at akka.util.Reflect$.instantiate(Reflect.scala:39)
at akka.actor.FromClassCreator.apply(Props.scala:187)
at akka.actor.FromClassCreator.apply(Props.scala:186)
at akka.actor.ActorCell.newActor(ActorCell.scala:461)
at akka.actor.ActorCell.create(ActorCell.scala:479)
... 8 more
CODE TO CREATE AND CALL ACTOR RECEIVE.
val system = ActorSystem("messagespreading")
var NetworkBuilderObj:ActorRef= system.actorOf(Props[NetworkBuilder])
NetworkBuilderObj ! test
When you get an exception occurring in third-party code, you need to look to see if there is a Caused by. In this case it says
Caused by: java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)
at scala.util.Random.nextInt(Random.scala:65)
at NetworkBuilder.(pastry.scala:431)
so there is the error - it has nothing to do with the code you posted per se.

ClassNotFoundException / NoClassDefFoundError when running a Scala jar

Having a Scala project exported to a .jar with eclipse, the application started with java -jar app.jar dies with the error java.lang.ClassNotFoundException: scala.Predef$.
Full output:
Exception in Application start method
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:490)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:829)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:150)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: scala/Predef$
at main.App$.debug(App.scala:69)
at main.App.start(App.scala:23)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:772)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:260)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:223)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:220)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:220)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:94)
Caused by: java.lang.ClassNotFoundException: scala.Predef$
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:353)
at java.lang.ClassLoader.loadClass(ClassLoader.java:422)
at java.lang.ClassLoader.loadClass(ClassLoader.java:355)
... 9 more
The referenced line at main.App$.debug(App.scala:69):
object App {
//...
def debug(s: String) {
println("DEB: "+s)
}
// ...
}
This seems to be caused because the Scala libraries are not contained in the jar. How do I fix this?
I have read about solutions with maven plugins but I would prefer a manual option.
Manually push the libs there in jar.. or you have good option to script it down