'Can not determine Markup. Component is not yet connected to a parent in Wicket
I am getting the "Can not determine Markup. Component is not yet connected to a parent" issue in Wicket.I see that the html files are present in the package where class files are present in both application installation location of glassfish server and the WAR file.
Solution 1:[1]
Make sure you include the filtering settings in our pom.xml:
<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
...
</build>
You can check the generated pom.xml after creating a quickstart project following https://wicket.apache.org/start/quickstart.html
Solution 2:[2]
If you're using Gradle, include the following in your build.gradle file:
sourceSets {
main {
resources {
srcDirs += ['src/main/java']
includes = ["**"]
// or specifically: includes = ["**/*.html"]
}
}
}
This ensures that the HTML files will be added to the WAR file.
Solution 3:[3]
Check if:
- the HTML file is misnamed
- the resolving component fails to find the corresponding HTML file to the Wicket java class
- the HTML files are not included in the WAR
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | cringe |
| Solution 2 | Flux |
| Solution 3 | publicMee |
