3

I am using my liquibase xml config file (spring integration) with follow notation

<databaseChangeLog 
      xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog  
      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

So.. I would use my app offline mode and i put "classpath" notation into my changelog:

<databaseChangeLog 
      xmlns="http://www.liquibase.org/xml/ns/dbchangelog" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog  
      classpath:xsd/dbchangelog-3.1.xsd">

But i have follow error. Can you help me?

Caused by: java.net.MalformedURLException: unknown protocol: classpath
        at java.net.URL.<init>(URL.java:592)
        at java.net.URL.<init>(URL.java:482)
        at java.net.URL.<init>(URL.java:431)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:610)
        at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
        at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:582)
        at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:685)
        at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:530)
        at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2175)
FabryProg
  • 106
  • 1
  • 8
  • I had found this working solution: http://stackoverflow.com/questions/8609322/need-understanding-of-spring-handlers-and-spring-schemas – FabryProg Apr 13 '16 at 09:45

1 Answers1

3

I fixed this problem by adding the related XSD file dbchangelog-3.5.xsd locally inside the project and updating the Liquibase configuration file (the xsi:schemaLocation part) like this:

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog-3.5.xsd">

So now the XSD file location is configured like dbchangelog-3.5.xsd. Just make sure the XSD file is located in the same directory as the Liquibase configuration file.

informatik01
  • 16,038
  • 10
  • 74
  • 104
Anton Arsentyev
  • 371
  • 1
  • 7
  • 14
  • 1
    Thanks, unfortunately, I have to search for the file in the classpath. Your solution is not the one requested – FabryProg Nov 16 '15 at 10:31