Jacek Laskowski wrote:
On 10/27/06, Jay D. McHugh <[EMAIL PROTECTED]> wrote:

Is anyone else experiencing this?  Is there a fix or workaround that
anyone knows about?

Oh man, how can we get to Java EE 1.5 if we keep having troubles with
our own build spec ;-)

Seriously, I haven't seen it before so call yourself lucky! ;-)
Another point for you when/if you get it sorted out before others beat
you to it.

Thanks for having caught it! (I wonder how many people left after
having experienced such issues).

Jacek


Jacek,

Thanks for responding.

Reading your email I realized that what I originally sent could possibly be misinterpreted.

So, to try to make sure I am clear...

I was able to build successfully, but I could not start the server because of an error starting the webconsole.

I have gotten this error regardless of which java version (1.4 or 1.5) I have built with and regardless of which java version I tried to start the server with. And I get the error whether I try to start the tomcat or jetty assembly (I have tried all six combinations).

I have already exhausted my meager skills trying to fix the code myself. It appears to be getting an NPE trying to calculate the hash of a brand new variable that -should- have just been declared and assigned about two lines earlier in the code.

Here is most of what I think is relevant in the ContextManager code:
(subjectIds is declared at the top of the class -> private static Map subjectIds = new Hashtable();)

  public static synchronized SubjectId registerSubject(Subject subject) {
       SecurityManager sm = System.getSecurityManager();
       if (sm != null) sm.checkPermission(SET_CONTEXT);

if (subject == null) throw new IllegalArgumentException("Subject must not be null");

AccessControlContext acc = (AccessControlContext) Subject.doAsPrivileged(subject, new PrivilegedAction() {
           public Object run() {
               return AccessController.getContext();
           }
       }, null);

       Context context = new Context();
       context.subject = subject;
       context.context = acc;
Set principals = subject.getPrincipals(GeronimoCallerPrincipal.class);
       if (!principals.isEmpty()) {
           context.principal = (Principal) principals.iterator().next();
} else if (!(principals = subject.getPrincipals(PrimaryRealmPrincipal.class)).isEmpty()) { context.principal = (PrimaryRealmPrincipal) principals.iterator().next(); } else if (!(principals = subject.getPrincipals(RealmPrincipal.class)).isEmpty()) { context.principal = (RealmPrincipal) principals.iterator().next();
       } else if (!(principals = subject.getPrincipals()).isEmpty()) {
           context.principal = (Principal) principals.iterator().next();
       }
       Long id = new Long(nextSubjectId++);
       context.id = new SubjectId(id, hash(id));

       subjectIds.put(context.id, subject);   // this is line 269
       subjectContexts.put(subject, context);

       return context.id;
   }

So, as best as I can tell either:
   - subjectIds is null (shouldn't be since it is global to the class)
   - context.id is null (shouldn't be, it was just assigned on line 267)
- context is null (if it was null, then context.id would be null as well and line 267 should have gotten the error)

Anyway, I am at a loss. If no one else is getting this error, then I will need to take a look at my linux system to see if I can find something out of the ordinary with the way it is configured. I am doubtful that I will be able to find something because I am getting the same error on three different systems that have all been running Geronimo for several months - but I'll look.

Thanks for your help.

Jay

Reply via email to