Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.nosuchmethoderror While using in Apache NiFi #27

Open
faisal-ksolves opened this issue Jul 19, 2023 · 9 comments
Open

java.lang.nosuchmethoderror While using in Apache NiFi #27

faisal-ksolves opened this issue Jul 19, 2023 · 9 comments

Comments

@faisal-ksolves
Copy link

I am using this library in my Apache NiFi project, to perform a walk operation but it shows the following error
java.lang.NoSuchMethodError: 'void net.percederberg.mibble.asn1.Asn1Parser.reset(java.io.Reader, net.percederberg.grammatica.parser.Analyzer)' at net.percederberg.mibble.MibLoader$MibSource.parseMib(MibLoader.java:970) at net.percederberg.mibble.MibLoader.loadQueue(MibLoader.java:724) at net.percederberg.mibble.MibLoader.load(MibLoader.java:550) at net.percederberg.mibble.MibLoader.load(MibLoader.java:451) at org.soulwing.snmp.provider.mibble.CachingMibRepository.load(CachingMibRepository.java:79) at org.soulwing.snmp.provider.mibble.MibbleMib.load(MibbleMib.java:226)
can you help me to resolves it.
Thanks in Advance.

@ceharris
Copy link
Member

Are you using the same versions of the Mibble dependencies as those listed in the top level pom.xml?

@faisal-ksolves
Copy link
Author

here is my complete pom.xml which is using tnm4j 1.2.0 in Apache NiFi
`

4.0.0 com.pnm pnm 1.0

nifi-PNMtest-processors
jar

<dependency>
    <groupId>org.soulwing.snmp</groupId>
    <artifactId>tnm4j</artifactId>
    <version>1.2.0</version>
</dependency>
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-api</artifactId>
</dependency>
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-utils</artifactId>
    <version>1.20.0</version>
</dependency>
<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-mock</artifactId>
    <version>1.20.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <scope>test</scope>
</dependency>
`

@ceharris
Copy link
Member

What version of Java are you using at runtime?

@faisal-ksolves
Copy link
Author

faisal-ksolves commented Jul 25, 2023 via email

@ceharris
Copy link
Member

Are you able to run the examples, particularly Example05_TableRetrievalUsingWalk, as described in the README?

@faisal-ksolves
Copy link
Author

faisal-ksolves commented Jul 26, 2023 via email

@ceharris
Copy link
Member

ceharris commented Jul 26, 2023

I think that if you run mvn dependency:tree in your project, you'll find that one of Apache NiFi dependencies is pulling in a different version of the Mibble dependencies than what is listed in the pom.xml for Tnm4j. You can probably configure an exclusion in your project's pom.xml to keep that from happening.

If you don't know how to interpret the output from mvn dependency:tree, I may be able to help with that.

@faisal-ksolves
Copy link
Author

i try the mvn dependency:tree command and it shows the following data
[INFO] com.pnm:nifi-PNMtest-nar:nar:1.0
[INFO] +- com.pnm:nifi-PNMtest-processors:jar:1.0:compile
[INFO] | +- org.soulwing.snmp:tnm4j:jar:1.2.0:compile
[INFO] | | +- org.snmp4j:snmp4j:jar:2.8.12:compile
[INFO] | | +- net.percederberg.mibble:mibble:jar:2.9.3:compile
[INFO] | | | - net.percederberg.grammatica:grammatica:jar:1.5:compile
[INFO] | | +- net.percederberg.mibble:mibble-mibs:jar:2.9.3:runtime
[INFO] | | - org.slf4j:log4j-over-slf4j:jar:2.0.6:provided
[INFO] | - org.apache.nifi:nifi-utils:jar:1.20.0:compile
[INFO] | - org.apache.nifi:nifi-api:jar:1.20.0:provided
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.9.1:test
[INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | +- org.junit.platform:junit-platform-commons:jar:1.9.1:test
[INFO] | - org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.9.1:test
[INFO] | - org.junit.platform:junit-platform-engine:jar:1.9.1:test
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.9.1:test
[INFO] | - junit:junit:jar:4.13.2:test
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.9.1:test
[INFO] +- org.mockito:mockito-core:jar:3.12.4:test
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.11.13:test
[INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.11.13:test
[INFO] | - org.objenesis:objenesis:jar:3.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:3.12.4:test
[INFO] +- org.slf4j:slf4j-simple:jar:2.0.6:test
[INFO] | - org.slf4j:slf4j-api:jar:2.0.6:provided
[INFO] - org.codehaus.groovy:groovy-test:jar:3.0.14:test
[INFO] - org.codehaus.groovy:groovy:jar:3.0.14:test

but surely there is no conflict.
can you help me.

Thanks

@ceharris
Copy link
Member

ceharris commented Aug 6, 2023

No conflict with the dependencies such as you've configured them, so I suggest you take a very close look at the runtime environment in which you're using Apache NiFi. That NoSuchMethodError indicates that there's an incompatible version of the net.percederberg.mibble.asn1.Asn1Parser class on the runtime class path.

I've offered as much help as I can offer at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants