Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6345147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:45:57+00:00 2026-05-24T20:45:57+00:00

When trying to run a simple JavaFX 2.0 beta application written in Scala 2.8.1

  • 0

When trying to run a simple JavaFX 2.0 beta application written in Scala 2.8.1 from sbt 0.10.1 an exception is thrown after the application window is closed:

> run
[info] Running com.tradex.priceviewer.Main
  Exception while removing reference: java.lang.InterruptedException
  java.lang.InterruptedException
  [       at java.lang.Object.wait(Native Method)success
  ]       at java.lang.ref.ReferenceQueue.remove(Unknown Source)Total time: 5 s, completed Aug 5, 2011 1:12:04 PM

  at java.lang.ref.ReferenceQueue.remove(Unknown Source)
  at com.sun.glass.utils.Disposer.run(Disposer.java:64)>
  at java.lang.Thread.run(Unknown Source)

When running the application from the command line no exception is thrown and the returned status is 0. The code of the application is given below:

class Starter extends Application {

  def main(args: Array[String]) {
   Application.launch(args)
  } 

  override def start(s: Stage) {
   s.setVisible(true)
  }
}

object Main {

  def main(args: Array[String]) {
    val gui = new Starter
    gui.main(args)
  }
}

After the exception is thrown one has to exit and start sbt again (reload doesn’t work). When running the same application from Scala 2.8.1 console the following exception is thrown after the second run:

scala> m.main(Array(""))

scala> m.main(Array(""))
java.lang.IllegalStateException: Application launch must not be called more than once
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:41)
    at javafx.application.Application.launch(Application.java:115)
    at com.tradex.priceviewer.Starter.main(Main.scala:19)
    at .<init>(<console>:11)
    at .<clinit>(<console>)
    at RequestResult$.<init>(<console>:9)
    at RequestResult$.<clinit>(<console>)
    at RequestResult$scala_repl_result(<console>)
    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 scala.tools.nsc.Interpreter$Request$$anonfun$loadAndRun$1$$anonfun$apply$17.appl...
scala>

Would anybody have any clue how to exit this scala/javafx application properly (so one wouldn’t need to restart sbt or scala console)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:45:58+00:00Added an answer on May 24, 2026 at 8:45 pm

    I was able to reproduce this on my system. I found that running it from sbt generated the InterruptedException while running from the command-line the app ran fine.

    I added the following to the project settings in SBT:

    fork in run := true
    

    That tells SBT to run the app (and tests) in a separate JVM than SBT itself. After doing that I am able to run the app multiple times and do not get the InterruptedException.

    I think what you may be running into here is the SecurityManager that SBT uses when running apps in the same JVM. It must not be able to handle whatever the JavaFX app is doing. By running in a separate JVM you bypass that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run a simple Hibernate application, but I get this error: org.hibernate.exception.SQLGrammarException:
when i am trying to run a simple android application in netbeans 6.9.1 i
I am trying to run simple code from examples: require.paths.unshift('/etc/npm'); // path to modules
I'm trying to run this simple query over a JDBC connection: select _fk_DeptBillTo from
I am trying to run some simple interceptor on controller behind /index url. Usisng
I am trying to run simple perl dbi example script to connect to mysql
I'm trying run a simple Java/MySQL web app tutorial in NetBeans. I am able
I am trying to run a simple program using a spring configuration file. In
I am trying to convert a working simple Java application to an applet. The
I got this error when I am trying to run a simple PhP script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.