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

Upgrading to 1.1.2 breaks Classloading on Windows #1145

Closed
arafalov opened this issue Jun 25, 2014 · 5 comments
Closed

Upgrading to 1.1.2 breaks Classloading on Windows #1145

arafalov opened this issue Jun 25, 2014 · 5 comments
Labels
type: blocker An issue that is blocking us from releasing type: regression A regression from a previous release
Milestone

Comments

@arafalov
Copy link

Running Fat Jar works in 1.1.1.RELEASE. Change dependency to 1.1.2.RELEASE breaks jar execution with several different classpath-related issues:

2014-06-25 09:17:05.353  WARN 3740 --- [           main] o.s.boot.SpringApplication               : Banner not printable: class path resource [banner.txt] (class java.io.FileNotFoundException: 'class path resource [banner.txt] cannot be opened because it does not exist')

java.io.FileNotFoundException: class path resource [banner.txt] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
        at org.springframework.boot.SpringApplication.printBanner(SpringApplication.java:475)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:281)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:944)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:933)
        at org.un.oict.efms.support.server.EnhanceServer.main(EnhanceServer.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
        at java.lang.Thread.run(Thread.java:745)

banner.txt file is at \src\main\resources\banner.txt

Also (project details changed):

2014-06-25 09:17:05.781 ERROR 3740 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: JAR entry /x/y/z/ not found in ...\projectname-0.7.4.jar
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:313)
        at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
        at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:134)
        at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:249)
        at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:218)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:155)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:299)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:683)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:944)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:933)
        at org.un.oict.efms.support.server.EnhanceServer.main(EnhanceServer.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: JAR entry /x/y/z/ not found in ...\projectname-0.7.4.jar
        at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:117)
        at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:107)
        at org.springframework.boot.loader.jar.JarURLConnection.getJarFile(JarURLConnection.java:133)
        at org.springframework.boot.loader.jar.JarURLConnection.getJarFile(JarURLConnection.java:36)
        at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(PathMatchingResourcePatternResolver.java:443)
        at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:347)
        at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:271)
        at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1170)
        at org.springframework.context.support.GenericApplicationContext.getResources(GenericApplicationContext.java:223)
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:268)
        ... 24 common frames omitted

The pom file is:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>


    <groupId>x.y.z</groupId>
    <artifactId>project-name</artifactId>
    <version>0.7.4</version>


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.1.2.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.10-FINAL</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <!-- http://docs.spring.io/spring-boot/docs/1.1.0.RELEASE/reference/html/production-ready-endpoints.html -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <java.version>1.8</java.version>
        <start-class>x.y.z.MainClass</start-class>
        <build.timestamp>${maven.build.timestamp}</build.timestamp>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

</project>

Windows 7, Java 8, building from IntelliJ

@philwebb
Copy link
Member

I just replicated this locally in a Windows VM.

@philwebb philwebb added this to the 1.1.3 milestone Jun 25, 2014
@philwebb philwebb changed the title Upgrading to 1.1.2 breaks Classloading Upgrading to 1.1.2 breaks Classloading on Windows Jun 25, 2014
@philwebb
Copy link
Member

I think I've now fixed this. Could you please try the latest SNAPSHOT?

@arafalov
Copy link
Author

Works with 1.1.3.BUILD-SNAPSHOT

@philwebb
Copy link
Member

Thanks for testing. We've setup a Windows CI build to hopefully catch these issues next time before we release. We'll get a 1.1.3 release out shortly since it's such a critical bug.

@arafalov
Copy link
Author

Glad to help. It's a cool project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: blocker An issue that is blocking us from releasing type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

2 participants