Announcement Announcement Module
Collapse
No announcement yet.
Problem with finding spring.schemas Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with finding spring.schemas

    I keep getting the error below if I try to run spring with any of my projects in eclipse. I have all three dist jars in my library. My spring.jar contains the file in the /meta-inf directory. I rebuilt my distributions and the directory is always in lower case. I don't know if that is the issue, as the class where this problem is being generated is "PluggableSchemaResolver implements EntityResolver" and the DEFAULT_SCHEMA_MAPPINGS_LOCATION = "META-INF/spring.schemas"; is in caps. Anyway, here is the error from my console. Please, try to help me out, as you will probably help other people who are flattening their heads over these types of errors, of which I have found submmitals, but no reasonable reply.

    Exception in thread "main" org.springframework.beans.FatalBeanException: Unable to load schema mappings from location [META-INF/spring.schemas]; nested exception is java.util.zip.ZipException: The system cannot find the path specified
    Caused by: java.util.zip.ZipException: The system cannot find the path specified
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.http://www.protocol.jar.JarURLConnec...onnect(Unknown Source)
    at sun.net.http://www.protocol.jar.JarURLConnec...Stream(Unknown Source)
    at org.springframework.core.io.support.PropertiesLoad erUtils.loadAllProperties(PropertiesLoaderUtils.ja va:110)
    at org.springframework.beans.factory.xml.PluggableSch emaResolver.<init>(PluggableSchemaResolver.java:98 )
    at org.springframework.beans.factory.xml.PluggableSch emaResolver.<init>(PluggableSchemaResolver.java:79 )
    at org.springframework.beans.factory.xml.DelegatingEn tityResolver.<init>(DelegatingEntityResolver.java: 62)
    at org.springframework.beans.factory.xml.ResourceEnti tyResolver.<init>(ResourceEntityResolver.java:67)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.<init>(XmlBeanDefinitionReader.java:13 5)
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFactory.java:51)
    at org.springframework.beans.factory.xml.XmlBeanFacto ry.<init>(XmlBeanFactory.java:61)
    at com.apress.springbook.chapter01.spring.SpringBoots trap.main(SpringBootstrap.java:32)

    Thank you,

    Curtis Fisher

  • #2
    I will answer my own question...

    I finally found the issue, and I thank my compatriot Gordon Zheng for the assistance he gave in helping to resolve this. We narrowed it down to the public abstract class PropertiesLoaderUtils and the method loadAllProperties(...).

    The problem was that I normally organize my workspaces on a drive with a !Workspaces. The bang (!) sorts the directories to the top of the list and with my short attention span, it helps me to focus quickly. I have never had an issue until using Spring (not Spring's fault of course).

    The issue was that Spring could not find the meta-inf/spring.schema. When running through the debugger, we noticed the resourceName argument file:/F:/!Workspaces/.../spring.jar!meta-inf/spring.schema and viola', we figured it out (Doh!). The meta character ! at the F:/!Workspaces results in the url as: orkspaces/.../meta-inf/spring.jar!meta-inf/spring.schema.

    So the mystery is solved, and I understand why many of you viewed this, scratched your head, and moved on. Most people don't use meta characters in directory paths (for good reason), and the path was not explained completely in the error.

    Hopefully, I will have more substantial and problematic issues brought on by growth, and not stupid directory tricks! For those of you who thought longer than a millisecond or three on this, I thank you... We have moved on.

    Curtis Fisher

    Comment

    Working...
    X