Skip to content

errors when using Skills in a GraalVM native image #56

Closed

Description

@joshlong

graalvm hints for META-INF/skills doesn't seem to work

im using

  <dependency>
  	<groupId>com.jamesward</groupId>
  	<artifactId>pooch-palace</artifactId>
  	<version>0.0.4</version>
  </dependency>
  <dependency>
  	<groupId>org.springaicommunity</groupId>
  	<artifactId>spring-ai-agent-utils</artifactId>
  	<version>0.9.0</version>
  </dependency>

and it doesnt seem to register the skill in /META-INF/skills in the .jar

I have to manually register each file individually otherwise I get

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
        at com.example.agent.AgentApplication.main(AgentApplication.java:38)
        at java.base@25.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.lang.RuntimeException: Failed to load skills from resource: class path resource [META-INF/skills]
        at org.springaicommunity.agent.utils.Skills.loadResource(Skills.java:84)
        at org.springaicommunity.agent.tools.SkillsTool$Builder.addSkillsResource(SkillsTool.java:112)
        at com.example.agent.AssistantController.<init>(AgentApplication.java:89)
        at com.example.agent.AssistantController__BeanDefinitions.lambda$getAssistantControllerInstanceSupplier$0(AssistantController__BeanDefinitions.java:23)
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:68)
        at org.springframework.util.function.ThrowingBiFunction.apply(ThrowingBiFunction.java:54)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.lambda$get$1(BeanInstanceSupplier.java:200)
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
        at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.invokeBeanSupplier(BeanInstanceSupplier.java:231)
        at org.springframework.beans.factory.aot.BeanInstanceSupplier.get(BeanInstanceSupplier.java:200)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:1024)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1246)
        ... 20 more
Caused by: java.io.IOException: Unsupported resource protocol for JAR loading: resource
        at org.springaicommunity.agent.utils.Skills.loadJarResource(Skills.java:174)
        at org.springaicommunity.agent.utils.Skills.loadResource(Skills.java:81)

Activity

  1. added this to the 0.13.0 milestone on Oct 3, 2026
  2. tzolov commented on Oct 3, 2026

    @tzolov
    Contributor

    Thanks @joshlong for the report. Fixed for 0.13.0 in 983e246, together with the classpath scanning rework in #90 / 5a8d1cb.

    Cause: in a native image, ClassPathResource.getURL() returns a GraalVM resource: URL, and the old loader only understood jar: URLs, hence Unsupported resource protocol for JAR loading: resource. Classpath skill locations now go through Spring's classpath*: scan, which also works in native images, and the base path is taken from the resource path (GraalVM's resource: file system does not support getFile()).

    Verified with a Spring Boot 4.0.2 app compiled with GraalVM 25.0.3 (-Pnative native:compile), using the app's own META-INF/skills, a SkillsJar dependency and .claude/skills:

    0.12.0 0.13.0-SNAPSHOT
    addSkillsResource(new ClassPathResource("META-INF/skills")) ❌ Unsupported resource protocol … resource ✅ app + SkillsJar skills
    new ClassPathResource(".claude/skills") 0 skills ✅
    Invoking a skill via the Skill tool ❌ ✅

    So there's no need to register each file individually any more. AgentUtilsRuntimeHints registers META-INF/skills/**/*.md and (new) .claude/skills/**/*.md. Skills in other classpath locations, or non-Markdown skill files such as scripts, still need resource hints from the application.

  3. added a commit that references this issue on Oct 4, 2026
    983e246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions