Closed azwc closed 5 years ago
This line from exception:
Caused by: java.lang.RuntimeException: Unable to read XML file 'SimpleExtension.xml' near class: com.github.sinyat.SimpleDecoration
Basically says that your SimpleExtension.xml
file cannot be found near the SimpleDecoration
class. It has to be located in the very same package to retrieve it as a resource. If it's not - you will receive that exception.
But if you did place it in the SimpleDecoration
class package and are still getting that error - there might be some issues with your IDE actually copying the XML resource to the output before running the application, try rebuilding your project/checking IDE configuration for XML to be considered a resource.
thanks,after your prompt, the problem has been solved.
add the following configuration: pom.xml
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
Glad it helped :)
Overall it's not necessary to use exactly that XmlSkinExtension
constructor - you can have extension/skin files located anywhere, but you'll need to provide a correct path to them in that case.
Glad it helped :) Overall it's not necessary to use exactly that
XmlSkinExtension
constructor - you can have extension/skin files located anywhere, but you'll need to provide a correct path to them in that case.
I also tried to put the xml file in src/main/resources, but I found that the XmlSkinExtension class path parameter does not support the use of "classpath"
Some pathing options are indeed inconvenient (or don't work the way you would probably expect them to), but I do have some plans to improve them in future updates along with some other QoL changes.
code from wiki page
exception message:
What can I do to solve this exception?