Can not determine Markup. Component is not yet connected to a parent in Wicket

4.8k views Asked by At

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.

3

There are 3 answers

1
cringe On

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

0
Flux On

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.

0
publicMee On

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