1
votes

Unless I put META-INF in the root, context.xml along with the resources defined (queues, jdbc connection pool, etc) are not read correctly and Spring throws exceptions during start up.

Now I end up with two META-INF folders, I need one on the classpath (WEB-INF/classes/META-INF) due to persistence.xml.

Is is okay to have two META-INF's? I always configured resources in Spring's applicationContext so didn't notice before.

Thanks.

1

1 Answers

6
votes

I guess it is all right. They both might have slightly different purposes.

webapp-root/META-INF is directory for metadata of the web application, which you can access via servletContext.getResource("/META-INF/foo").

webapp-root/WEB-INF/classes/META-INF is directory for metadata of java classes, which you can read via getContextClassLoader().getResource("/META-INF/foo").