Hello,

when i refactored my sources to fit the new package structure ( 
com.google.web.bindery.requestfactory ) of the requestfactory i ended up 
with a mess :/
When i try to launch my application i get the following error:

SCHWERWIEGEND: de.systemagmbh.gf.dwr.ui.shared.context.ReportRequestContext 
is not a RequestContext
05.05.2011 16:05:51 
com.google.gwt.requestfactory.server.ServiceLayerDecorator die
SCHWERWIEGEND: The RequestContext type 
de.systemagmbh.gf.dwr.ui.shared.context.ReportRequestContext did not pass 
validation
05.05.2011 16:05:51 
com.google.gwt.requestfactory.server.RequestFactoryServlet doPost
SCHWERWIEGEND: Unexpected error
com.google.gwt.requestfactory.server.UnexpectedException: The RequestContext 
type de.systemagmbh.gf.dwr.ui.shared.context.ReportRequestContext did not 
pass validation
at 
com.google.gwt.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:205)

After a debugging session i found out that perhaps something went wrong with 
the move to the new package.
This is what i have found:

In the class ResolverServiceLayer the method 
validator.validateRequestContext(requestContextClass); sets the validator to 
poisened.

  @Override
  public Method resolveRequestContextMethod(String requestContextClass, 
String methodName) {
    synchronized (validator) {
      validator.antidote();
      validator.validateRequestContext(requestContextClass);
      if (validator.isPoisoned()) {
        die(null, "The RequestContext type %s did not pass validation", 
requestContextClass);
      }
    }
    Class<?> searchIn = forName(requestContextClass);
    for (Method method : searchIn.getMethods()) {
      if (method.getName().equals(methodName)) {
        return method;
      }
    }
    return report("Could not locate %s method %s::%s", 
RequestContext.class.getSimpleName(),
        requestContextClass, methodName);
  }

This is because of the following in the RequestFactoryInterfaceValidator. 
The method isAssignable(logger, requestContextIntf, requestContextType) goes 
wrong.

  public void validateRequestContext(String binaryName) {
    if (fastFail(binaryName)) {
      return;
    }

    Type requestContextType = 
Type.getObjectType(BinaryName.toInternalName(binaryName));
    final ErrorContext logger = parentLogger.setType(requestContextType);

    // Quick sanity check for calling code
    if (!isAssignable(logger, requestContextIntf, requestContextType)) {
      logger.poison("%s is not a %s", print(requestContextType),
          RequestContext.class.getSimpleName());
      return;
    }

    Type domainServiceType = getDomainType(logger, requestContextType);
    if (domainServiceType == errorType) {
      logger.poison(
          "The type %s must be annotated with a @%s or @%s annotation",
          BinaryName.toSourceName(binaryName), 
Service.class.getSimpleName(),
          ServiceName.class.getSimpleName());
      return;
    }

    for (RFMethod method : getMethodsInHierarchy(logger, 
requestContextType)) {
      // Ignore methods in RequestContext itself
      if (findCompatibleMethod(logger, requestContextIntf, method, false, 
true,
          true) != null) {
        continue;
      }

      // Check the client method against the domain
      checkClientMethodInDomain(logger, method, domainServiceType,
          !clientToLocatorMap.containsKey(requestContextType));
      maybeCheckReferredProxies(logger, method);
    }

    checkUnresolvedKeyTypes(logger);
  }

And this finally is because my Context is not extended from the old 
RequestContext anymore.
The isAssignable() method does the following:

  private boolean isAssignable(ErrorContext logger, Type possibleSupertype,
      Type possibleSubtype) {
    // Fast-path for same type
    if (possibleSupertype.equals(possibleSubtype)) {
      return true;
    }

    // Supertype calculation is cached
    List<Type> allSupertypes = getSupertypes(logger, possibleSubtype);
    return allSupertypes.contains(possibleSupertype);
  }

The list allSupertypes contains OBJECT my RequestContext interface and its 
superclass wich is ...bindery..requestContext.
The problem is that possible superType somehow* is the old RequestContext 
(old package) *which can obviously then not be
in the possible supertypes list.

What is going on here? 
What could i have done wrong?
Is it right now not possible to move to the new Requestfactory packages 
because something was overlooked here?
I do not want to use all these deprecated classes? 
Do we need to wait for a fix here?

Hope for some help on this one
QB!T

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to