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

LocalContainerEntityManagerFactoryBean could accept "classpath*:/" path locations [SPR-3979] #8659

Closed
spring-projects-issues opened this issue Oct 16, 2007 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Leonardo Pinho opened SPR-3979 and commented

LocalContainerEntityManagerFactoryBean could use PathMatchingResourcePatternResolver as ResourcePatternResolver and allow to use classpath*:/ location paths to read jar-file from persistent.xml, like:

<persistence>
<persistence-unit name="SpringJpaPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<jar-file>classpath*:/common.jar</jar-file>
</persistence-unit>
</persistence>

Otherwise, we have to use the xml above in order to read some jar ("common.jar" p.ex.) from WEB-INF/lib:

<persistence>
<persistence-unit name="SpringJpaPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<jar-file>/WEB-INF/lib/common.jar</jar-file>
</persistence-unit>
</persistence>
Thanks,
Leonardo


Affects: 2.0.7, 2.1 M4, 2.5 RC1

Backported to: 2.0.9

@spring-projects-issues
Copy link
Collaborator Author

Leonardo Pinho commented

Any comment? :)

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

The problem here is that common.jar is not technically a classpath resource: Its contents are part of the classpath but it cannot be found on the classpath itself.

The idea is still not bad... Maybe we can find some other solution for jar file scanning there.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

"classpath*:" URLs won't work here, but standard location patterns such as "/WEB-INF/lib/*.jar" should work in most environments (provided that the web container makes jar files visible as ServletContext resources). I've added that capability for Spring 2.5.1.

Juergen

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 2.5.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants