Skip to content

java.lang.NoSuchMethodError: No static method newFactory() Ljavax/xml/stream/XMLInputFactory #283

Closed

Description

I am working on an android app using semantic kernel and I have this issue that I have been battling for 2 days now. In the semantic kernel code, the use of the newFactory() static method for prompt parsing is the root cause. I think this is not needed and newInstance() can do the job.

This github issue is talking about the problem I am facing but in another library: FasterXML/jackson-dataformat-xml#533

I have this issue when I use invokePromptAsync() but not when I use getChatMessageContentsAsync().

The problem is easy to reproduce, create a new project in android studio and use any sample that has a call to invokePromptAsync()

Activity

  1. karianna commented on Feb 9, 2025

    @karianna
    Member

    @samimejri Can you send in the snippet of code you're executing?

  2. johnoliver commented on Feb 11, 2025

    @johnoliver
    Member

    @samimejri have you tried adding the stax-api dependency to your project:

    <dependency>
      <groupId>javax.xml.stream</groupId>
      <artifactId>stax-api</artifactId>
      <version>1.0-2</version>
    </dependency>
    
  3. johnoliver commented on Feb 11, 2025

    @johnoliver
    Member

    @samimejri yeah I agree moving it to newInstance should fix it

  4. karianna commented on Feb 12, 2025

    @karianna
    Member

    Do you want me to create a pull request? I am no java/kotlin expert but the change seems to be simple enough!

    Yes please!

  5. karianna commented on Feb 12, 2025

    @karianna
    Member

    Do you want me to create a pull request? I am no java/kotlin expert but the change seems to be simple enough!

    Yes please!

    Sorry but I am not permitted to push code to this repo.

    Can you fork this repo and create a PR?

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions