pentaho/pentaho-kettle · error · IllegalArgumentException

URL cannot be null

Error message

URL cannot be null

What it means

Constructor guard in RepositoryClient: the JCR solution configuration was supplied with a null URL, so no endpoint can be addressed. The IllegalArgumentException fires immediately, before any connection is attempted.

Solutions

  1. Supply a valid server URL (e.g. http://host:port/pentaho) when constructing RepositoryClient
  2. Read the URL via getMandatoryProperty from ConfigReader so a missing value fails earlier with a clear key name
  3. Validate/normalize the URL (non-null, correct scheme) before constructing the client

Example fix

// before
RepositoryClient client = new RepositoryClient( cfg, config.getUrl(), auth ); // url null
// after
String url = reader.getMandatoryProperty( "repovfs.ws.url" );
Objects.requireNonNull( url );
RepositoryClient client = new RepositoryClient( cfg, url, auth );
Defensive patterns

Strategy: validation

Validate before calling

// Guard before construction
String url = reader.getMandatoryProperty( "repovfs.ws.url" );
if ( url == null || url.trim().isEmpty() || !( url.startsWith( "http://" ) || url.startsWith( "https://" ) ) ) {
  throw new IllegalArgumentException( "repovfs.ws.url must be a non-empty http(s) URL" );
}

Type guard

boolean isValidUrl( String u ) {
  return u != null && !u.trim().isEmpty() && u.startsWith( "http" );
}

Try / catch

try {
  RepositoryClient c = new RepositoryClient( cfg, url, auth );
} catch ( IllegalArgumentException e ) {
  log.error( "Server URL not configured: {}", e.getMessage() );
}

Prevention

When it happens

Trigger: Constructing RepositoryClient with url == null, typically because ConfigReader produced no value, the caller passed an uninitialized variable, or the JCRSolutionConfig lacked a URL and code passed null onward.

Common situations: Missing mandatory property in repo-vfs-ws configuration; config file not loaded; refactoring that stopped defaulting the URL; environment variable/profile not set in the deployment.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/9f6c296dffc8a911. Report an issue: GitHub.

Appendix: source

Thrown at plugins/repo-vfs/repo-vfs-ws/src/main/java/org/pentaho/di/plugins/repovfs/ws/repo/RepositoryClient.java:89

    public RepositoryClientException( String msg ) {
      super( msg );
    }

    public RepositoryClientException( ClientResponse response ) {
      super( "Failed with status: " + response.getStatus() );
      this.response = Optional.of( response );
    }

    public RepositoryClientException( String msg, Exception e ) {
      super( msg, e );
    }
  }

  public RepositoryClient( JCRSolutionConfig cfg,
                           String url,
                           BasicAuthentication auth ) {
    if ( url == null ) {
      throw new IllegalArgumentException( "URL cannot be null" );
    }
    this.url = url;
    this.cfg = cfg;

    CookieHandler.setDefault( new CookieManager( null, CookiePolicy.ACCEPT_ALL ) );

    this.client = createClient( cfg, auth );
  }

  private static Client createClient( JCRSolutionConfig cfg, BasicAuthentication auth ) {
    ClientConfig config = new ClientConfig();
    config.property( ClientProperties.FOLLOW_REDIRECTS, true );
    config.property( ClientProperties.READ_TIMEOUT, cfg.getTimeOut() );
    config.register( MultiPartWriter.class );
    config.register( JacksonFeature.class );
    Client client = ClientBuilder.newClient( config );
    auth.applyToClient( client );

View on GitHub (pinned to f3058517a1)