Skip to content

"Unknown protocol: hdfs" error when testing with Accumulo #47

@dlmarion

Description

@dlmarion

Getting the following error when testing locally with a jar in HDFS.

2026-01-16T17:26:02,198 [lcc.LocalCachingContextClassLoaderFactory] ERROR: Error parsing updated context definition at file:///tmp/contexts.json. Classloader NOT updated!
com.google.gson.JsonSyntaxException: java.net.MalformedURLException: unknown protocol: hdfs
        at com.google.gson.Gson.fromJson(Gson.java:1375) ~[gson-2.12.1.jar:?]
        at com.google.gson.Gson.fromJson(Gson.java:1262) ~[gson-2.12.1.jar:?]
        at com.google.gson.Gson.fromJson(Gson.java:1199) ~[gson-2.12.1.jar:?]
        at org.apache.accumulo.classloader.lcc.definition.ContextDefinition.fromRemoteURL(ContextDefinition.java:85) ~[local-caching-classloader-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.accumulo.classloader.lcc.LocalCachingContextClassLoaderFactory.getDefinition(LocalCachingContextClassLoaderFactory.java:222) ~[local-caching-classloader-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
        at org.apache.accumulo.classloader.lcc.LocalCachingContextClassLoaderFactory.checkMonitoredLocation(LocalCachingContextClassLoaderFactory.java:261) ~[local-caching-classloader-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]

We do the following in the tests which resolves this issue:

  URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory(new Configuration()));

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions