java.net.MalformedURLException: unknown protocol: classpath

前端 未结 2 805
南方客
南方客 2021-01-18 07:46

I am trying to import the xsd schema from local drive using schemalocation classpath in spring. I added the required file in the classpath and added the reference of this fi

相关标签:
2条回答
  • 2021-01-18 08:04

    I have resolved the issue, as i was using the wrong jar of spring-social-web but not spring-social-facebook that contain the xsd. I don't required to use the classpath any more. thanks M. Deinum.

    0 讨论(0)
  • 2021-01-18 08:17

    You shouldn't be messing around with other locations and use the defaults. For Spring Social Facebook you should use http://www.springframework.org/schema/social/spring-social-facebook-1.1.xsd or preferably the version less one http://www.springframework.org/schema/social/spring-social-facebook.xsd.

    Spring will always first load the xsd from the jars from the classpath. Spring ships with a custom EntityResolver, the PluggableSchemaResolver which uses the different spring.schemas files in the META-INF directory of Spring jar files.

    The only reasons to get an error like you get (and why you try to work around it) is

    1. You haven't included the spring-social-facebook needed dependencies
    2. You have included the wrong spring-social-facebook dependencies
    3. You are using incompatible Spring and Spring Social versions.

    I would bet on option 2 not having all the 1.1.0 versions of spring-social-facebook but mixing versions of jars.

    0 讨论(0)
提交回复
热议问题