0

I have developed a spring boot applicatoin using sts. I had been using sts inbuilt maven plugin to run the build and have been running it via sts. And it runs fine when I'm running it via sts. (Run As spring boot application option) But when I move the generated jar to server, I'm getting the below error.

o.s.boot.SpringApplication:821 - Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [ABCApplication]; nested exception is java.io.FileNotFoundException: class path resource [a/b/c/d/e.class] cannot be opened because it does not exist

This is my code for ABCApplication.class

@SpringBootApplication
@EnableJpaRepositories({""})
@EntityScan({""})
@ComponentScan({"x.x.x","a.b.c","x.x.x","x.x.x.x","x.x.x.x"})
@EnableJpaAuditing
public class ABCApplication{

    public static void main(String[] args) {
        SpringApplication.run(ABCApplication.class, args);
    }

}

The a/b/c/d/e.class is in a xyz.jar which I have included in the resources folder of my project. And I have added the package to componentScan of ABCApplication.class.

And this is the entry in pom.xml.

        <dependency>
            <groupId>x.x.x</groupId>
            <artifactId>xyz</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/xyz.jar
            </systemPath>
        </dependency>

Someone please help, I'm not able to run it on server but it's running fine on my system via sts. And if i unzip the application jar file, I can see xyz.jar inside BOOT-INF\classes\

The xyz.jar that I have is an external jar that is built using gradle, but I'm assuming that should not be an issue? All the jars are built in jdk 8 xyz.jar does not use the spring-boot plugin. So it's not created as a spring-boot jar

I have validated my pom.xml entry, ensured that the xyz.jar in which the e.class resides in is available inside application jar. The package is also available in componentScan.

0 Answers0