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

Spring boot support #496

Closed
ojecborec opened this issue Sep 13, 2023 · 6 comments
Closed

Spring boot support #496

ojecborec opened this issue Sep 13, 2023 · 6 comments

Comments

@ojecborec
Copy link

I'm having issues with running the latest Manifold 2023.1.24 with Spring Boot 3.1.3. I've tried to use @NoBootstrap annotation as suggested by #22 but had no luck. I've noticed that my app starts successfully once I remove these 2 artifacts from my pom.xml file.

    <dependencies>
        <!-- javac plugins -->
        <dependency>
            <groupId>systems.manifold</groupId>
            <artifactId>manifold-props-rt</artifactId>
            <version>${manifold-version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    ....
                    
                    <annotationProcessorPaths>
                        <path>
                            <groupId>systems.manifold</groupId>
                            <artifactId>manifold-props</artifactId>
                            <version>${manifold-version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>
Caused by: java.io.FileNotFoundException: URL [manifoldclass://622488023/.../] cannot be resolved to absolute file path because it does not reside in the file system: manifoldclass://622488023/.../
	at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:217) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:173) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.core.io.UrlResource.getFile(UrlResource.java:285) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:791) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:576) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:329) ~[spring-core-6.0.11.jar:6.0.11]
	at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1431) ~[spring-context-6.0.11.jar:6.0.11]
	at org.springframework.context.support.GenericApplicationContext.getResources(GenericApplicationContext.java:262) ~[spring-context-6.0.11.jar:6.0.11]
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:422) ~[spring-context-6.0.11.jar:6.0.11]
@rsmckinney
Copy link
Member

Hi @ojecborec. I made a simple Spring Boot 3.1.3 demo project (attached). I had no problems building or running it. Perhaps there are other aspects of your project that contribute to the issue? Can you share your project's build config here?

demo.zip

@ojecborec
Copy link
Author

@rsmckinney This looks like a regression caused by spring-projects/spring-framework#29226 where a catch block is missing around the new fallback getFile() call there. Should be fixed in Spring Framework 6.0.12.

spring-projects/spring-framework#31216

@rsmckinney
Copy link
Member

@ojecborec Good to know, thanks. Can you supply your build config? If you are using manifold normally, there shouldn’t be any need for resolving paths like manifoldclass://622488023/.../. This is indicative of using manifold dynamically, which usually can be avoided.

@ojecborec
Copy link
Author

@rsmckinney I've just realized what I was doing wrong. After removing following dependency my Spring Boot application works as expected. Sorry for the false alarm.

    <dependencies>
        <dependency>
            <groupId>systems.manifold</groupId>
            <artifactId>manifold-strings</artifactId>
            <version>${manifold-version}</version>
        </dependency>
    </dependencies>

@rsmckinney
Copy link
Member

Ah, good to hear, that is what I suspected. If you haven’t already, you should instead use manifold-strings as an annotation processor path instead.

<annotationProcessorPaths>
    <path>
        <groupId>systems.manifold</groupId>
        <artifactId>manifold-strings</artifactId>
        <version>${manifold.version}</version>
    </path>
</annotationProcessorPaths>

@ojecborec
Copy link
Author

I’m was using that one two as well at it seems to be the right way to do.

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