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

Cannot find static method getInstance in java/security/MessageDigest #742

Open
rchjsp opened this issue Jun 16, 2022 · 2 comments
Open

Cannot find static method getInstance in java/security/MessageDigest #742

rchjsp opened this issue Jun 16, 2022 · 2 comments
Labels

Comments

@rchjsp
Copy link

rchjsp commented Jun 16, 2022

Hello, @mirkosertic Thank you for Bytecoder!

I am facing an error:
Cannot find static method getInstance in java/security/MessageDigest with signature java.security.MessageDigest(java.lang.String,java.lang.String)

Could you help me, please? Or give some advice? Thx!

@drgorb
Copy link

drgorb commented Jun 16, 2022

full stack trace:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.RuntimeException: Error linking class com.example.abe.HelloWorld
        at de.mirkosertic.bytecoder.core.BytecodeLinkerContext.resolveClass(BytecodeLinkerContext.java:121)
        at de.mirkosertic.bytecoder.backend.CompileTarget.compile(CompileTarget.java:289)
        at de.mirkosertic.bytecoder.cli.BytecoderCLI.main(BytecoderCLI.java:132)
        ... 8 more
Caused by: java.lang.IllegalStateException: Cannot find static method getInstance in java/security/MessageDigest with signature java.security.MessageDigest(java.lang.String,java.lang.String)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKESTATIC.performLinking(BytecodeInstructionINVOKESTATIC.java:36)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveVirtualMethod(BytecodeLinkedClass.java:370)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKEVIRTUAL.performLinking(BytecodeInstructionINVOKEVIRTUAL.java:55)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveConstructorInvocation(BytecodeLinkedClass.java:401)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKESPECIAL.performLinking(BytecodeInstructionINVOKESPECIAL.java:37)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveVirtualMethod(BytecodeLinkedClass.java:370)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKEVIRTUAL.performLinking(BytecodeInstructionINVOKEVIRTUAL.java:55)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveConstructorInvocation(BytecodeLinkedClass.java:401)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKESPECIAL.performLinking(BytecodeInstructionINVOKESPECIAL.java:37)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveConstructorInvocation(BytecodeLinkedClass.java:401)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKESPECIAL.performLinking(BytecodeInstructionINVOKESPECIAL.java:37)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveStaticMethod(BytecodeLinkedClass.java:452)
        at de.mirkosertic.bytecoder.core.BytecodeInstructionINVOKESTATIC.performLinking(BytecodeInstructionINVOKESTATIC.java:35)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveMethodSignatureAndBody(BytecodeLinkedClass.java:482)
        at de.mirkosertic.bytecoder.core.BytecodeLinkedClass.resolveStaticMethod(BytecodeLinkedClass.java:452)
        at de.mirkosertic.bytecoder.core.BytecodeLinkerContext.resolveClass(BytecodeLinkerContext.java:95)
        ... 10 more

@vamanea
Copy link

vamanea commented Sep 30, 2022

I am also facing the same problem, when I try to compile a BouncyCastle simple demo, for example AES encrypt/decrypt.

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

No branches or pull requests

4 participants