SeniorResearchSquid
SeniorResearchSquid

Reputation: 73

NetBeans can't launch SpringBoot app that can run with 'java -jar'

I'm having a terrible time trying to figure out this problem. We have a group of SpringBoot apps that all have a shared parent module, except for one of them, which has a parent:

<parent>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir</artifactId>
        <version>6.0.5</version>
</parent>

I'll call this oddball module 'fhir'. All of the modules use spring boot 2.7.18. All of them also include classes from another module called 'core'. One of these classes is called JwtTool and uses org.springframework.security.authentication.CredentialsExpiredException

At some point in the past year or two, the fhir module can no longer be launched with NetBeans, though it can still run with 'java -jar' and one of my teammates apparently runs it successfully with Eclipse, though I'm not sure how that's configured.

Netbeans (ver 14) has the default config for running all of the apps: enter image description here

It gives this error when trying to launch the fhir app:

[main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [****.fhir.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class *****.backend.security.JwtTool
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
    at ****.fhir.Application.main(Application.java:48)
Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class *****.backend.security.JwtTool
    at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:162)
    ... more
Caused by: java.lang.IllegalStateException: Failed to introspect Class [****.backend.security.JwtTool] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@67424e82]
    at
    ... more
Caused by: java.lang.NoClassDefFoundError: org/springframework/security/authentication/CredentialsExpiredException
org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
    ... more
Caused by: java.lang.ClassNotFoundException: org.springframework.security.authentication.CredentialsExpiredException
    at ...

But if the CredentialsExpiredException is really missing, why does it run with 'java -jar'?

Really confused trying to get this to work.

I've tried comparing the pom.xml between the working apps and the not working one, but I can't find the relevant difference.

Thanks!

Upvotes: 0

Views: 107

Answers (0)

Related Questions