Yes, the problem is known, but there is no apparent universal solution.

The bug is in the JDK and results when Felix' shell TUI reads from System.in...this somehow interferes with something in the JDK leading to some sort of deadlock until there is input on the stream.

One possible solution is to check the input stream for available input before reading, however, this approach works in Eclipse, but doesn't echo characters when you run it from the console under Windows.

The only option is to potentially have a configuration switch that you can flip back and forth when you are running the Felix shell TUI within Eclipse.

Apparently, Equinox does this, but they are able to set the switch automatically so you don't need to change your configuration...

Not sure what we should do...please feel free to comment on:

    http://issues.apache.org/jira/browse/FELIX-619

-> richard

On 5/26/09 12:45 PM, Andreas Mucha wrote:
Hi everybody,

i have a problem to run felix with a gui-bunlde out of eclipse.
i use felix 1.8.0 . i tested eclipse 3.4.1 and 3.4.2 .
i tested some combinations of running eclipse and/or felix
with jre 1.5.19 and/or 1.6.13 .

the problem : my simple bundle activator (a runnable)
looks e.g. like this :
//code adapted from felix gui app example
public void start(BundleContext context) throws Exception
{
  if (SwingUtilities.isEventDispatchThread())
  {
   run();
  }
  else
  {
   try
   {
    javax.swing.SwingUtilities.invokeAndWait(this);             
   }
   catch (Throwable t)
   {
    t.printStackTrace();
   }
  }
}

public void run()
{
  m_frame = new JFrame();
  m_frame.setSize(...);
  m_frame.setVisible(true);
}

when i start felix with my bundle from console, everything is fine.
the frame is displayed as expected.
when i start felix with my bundle in debug mode inside eclipes,
everything is fine. the frame is displayed as expected.

but if i start felix with my bundle inside eclipse as normal
app/launch config, it hangs. the swing thread seems to be blokcing.

felix ps says in that case :
->  ps
START LEVEL 1
    ID   State         Level  Name
[   0] [Starting   ] [    0] System Bundle (1.8.0)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.2.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.2.0)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.0)
[   4] [Starting   ] [    1] my.little.bundle (1.0.0)
->

if i now type 'start 0' then everything goes fine.

in the mail archive i found that this problem is known.
but i couldnt find any suitable solution.

any ideas about that strange behaviour ??

best regards and thanx in advance
andreas mucha

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to