pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mustafa Motiwala <mustafa.motiw...@gmail.com>
Subject Re: Launching application from SBT.
Date Wed, 19 Dec 2012 16:05:54 GMT
Seems like won't need to create a bug for this. At-least not in the case of
SBT for now. I started out forking the git repo in github & patched the
code for reading the "main" thread name using a system property when I
realized that I could simply just change my project's build.sbt file to
fork a new JVM instead.
Just for future reference - for my sake and anyone else who might be
looking to do the same, the solution is to enable forking your project in
the test/run modes by adding the following line to build.sbt:
      fork in run := true
I am using SBT 0.12.1 YMMV.

On Wed, Dec 19, 2012 at 6:57 PM, Sandro Martini <sandro.martini@gmail.com>wrote:

> Hi Mustafa,
> welcome to Pivot ...
> > java.lang.IllegalStateException: this method can only be called from the
> > event dispatch thread, and not from "run-main"
> > at org.apache.pivot.wtk.Container$1.check(Container.java:949)
> > at
> >
> org.apache.pivot.wtk.Container.assertEventDispatchThread(Container.java:957)
> > ...
> > Could have to do with the way SBT forks the JVM to launch an application,
> > but still - not entirely certain.
> > Don't see this if I create a launcher script to launch the application.
> > However, I still feel that it might have something to do with the way
> pivot
> > determines the thread context.
> >
> you have reason, and this is due to a feature added in 2.0 (or 2.0.1
> if I remember well) to ensure that code is run in the right thread
> (some in the EDT and other not in the EDT).
> The same problem happen if you run a Pivot project done with maven
> (for example using our archetype under apache-extras).
> Some related info here (I have to remember to update even this to
> Pivot-2.0.3 after released):
> http://apache-pivot-users.399431.n3.nabble.com/Pivot-Quickstart-Maven-archetype-updated-to-Pivot-2-0-1-td3675416.html
> > Just want to know if this is a bug/known bug or a feature & will need to
> be worked around.
> probably we should find a way to let common build tools like maven,
> sbt and gradle to bypass (or white-list related launchers) this check
> (if possible).
> To not forget it, could you create a JIRA issue for this ?
> Last, could you attach in the issue (and/or here) a minimal sample sbt
> project to simplify my tests ? This would be a great speedup for my
> tests ...
> Thanks a lot.
> Bye,
> Sandro

View raw message