You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by rwengr <rw...@bellsouth.net> on 2014/03/31 20:37:32 UTC

Re: car-maven-plugin and Geronimo Bean references problem - UPDATE

The root cause of this problem was traced back to the presence of this code
in the gbean.

class SynchWorker implements Runnable {
  final Object lock = new Object();
  boolean stop;
        
  public void run() {
    while ( !stop ) {
      synchronized ( lock ) {
        try {
          lock.wait( apacheDS.getSynchPeriodMillis() );
        } catch ( InterruptedException e ) {
          log.warn( "SynchWorker failed to wait on lock.", e );
        }
      }
      try {
        apacheDS.getDirectoryService().sync();
      } catch ( Exception e ) {
        log.error( "SynchWorker failed to synch directory.", e );
      }
    }
  }
}

First of all, the Junit passes.  All indications are the problem is related
to a class load issue that must occur when car-maven-plugin is starting
Geronimo.

Commenting out the code made it work OK so I tried to defeat it by adding a
system property to the run line

if (System.getProperty("car-maven-plugin) == null) { .... }

It should not run when the Java world is car-maven-plugin.  But
car-maven-plug still fails. So I experimented with rewriting the SynchWorker
class using a constructor, instead of relying on default no-arg constructor
and now it works if that makes any sense.  A bad day for open source.



--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/car-maven-plugin-and-Geronimo-Bean-references-problem-tp3987759p3987784.html
Sent from the Users mailing list archive at Nabble.com.

Re: car-maven-plugin and Geronimo Bean references problem - UPDATE

Posted by rwengr <rw...@bellsouth.net>.
I redesigned the way this code was implementing a thread and now the
car-maven-plugin does not get an error, which to me does not make any sense. 
Basically, the code does the same thing, but now the thread has a
constructor.  It does not rely on default constructor.



--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/car-maven-plugin-and-Geronimo-Bean-references-problem-tp3987759p3987850.html
Sent from the Users mailing list archive at Nabble.com.