Wicket - MarkupNotFoundException: Markup of type 'html' for component 'com.hello.Hello' not found

dorcsi

I know it is a very basic topic but unfortunately I cannot figure it out why I am getting the above error message.... I am trying to generate a simple HelloWorld Wicket application but I keep getting a html markup error...

My code is the following:

Hello class

package com.hello;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.WebPage;

public class Hello extends WebPage {

    public Hello() {
        add(new Label("message", "Hello Wicket World"));
    }
}

Hello html

<!DOCTYPE html>
<html lang="en" xmlns:wicket="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Wicket World, szevasztok!</title>
</head>
<body>
    <h1>
        <span wicket:id="message">message comes here</span>
    </h1>
</body>
</html>

MyApplication class

package com;

import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import com.hello.Hello;

public class MyApplication extends WebApplication {

    @Override
    public Class<? extends Page> getHomePage() {
        return Hello.class;
    }
}

web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
<display-name>Wicket Web Application</display-name>

<filter>
    <filter-name>wicket</filter-name>
    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
        <param-name>applicationClassName</param-name>
        <param-value>com.MyApplication</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>wicket</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>wicket</groupId>
<artifactId>WicketExample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>WicketExample</name>

<dependencies>
    <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket</artifactId>
        <version>1.4.17</version>
    </dependency>

    <!-- slf4j-log4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.6</version>
    </dependency>
</dependencies>

<build>
    <finalName>WicketExample</finalName>

      <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>

      <plugins>
          <plugin>
              <inherited>true</inherited>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                  <source>1.6</source>
                  <target>1.6</target>
                  <debug>true</debug>
              </configuration>
          </plugin>
      </plugins>
  </build>


</project>

I receive the following error:

enter image description here

I have already googled for it, tried several refactoring, but I keep getting the same....

Any idea?

Sorry for this very basic topic.... :(

rstolle

The code looks ok to me, I guess the problem lies in your project structure which isn't entirely visible to me.

Since you're using maven anyway, why don't you just create a Wicket Quickstart project to get started? This generates you in zero time a working file structure with a decent pom.xml you can learn from:

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket \
  -DarchetypeArtifactId=wicket-archetype-quickstart \
  -DarchetypeVersion=7.10.0 \
  -DgroupId=com.dorcsi.wicket \
  -DartifactId=hello \
  -DarchetypeRepository=https://repository.apache.org/ \
  -DinteractiveMode=false

This stub project even contains an embedded jetty servlet conatiner, so you can run your application as simply as that:

    mvn jetty:run 

Furthermore, as already stated by martin-g, there is not point starting a new project with wicket 1.4. The example above generates a wicket 7.10 project. As a matter of fact, I am using wicket 8 since the end of last year without any problems.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Java/Wicket: Compile Basic Hello World with Resources

From Dev

gitignore: Understanding "hello/" vs. "hello/*"

From Dev

How to type String content:encoded = "Hello"; in java?

From Dev

Simple 'Hello World' type setup of TextAngular fails

From Dev

Simple HTML page not loading Javascript Hello World

From Dev

How can to create a JavaScript Hello World in a Mule component

From Dev

Hello World ScalaTest Failing: not found: type MyScalatraServlet

From Dev

Wicket fails to find markup file

From Dev

Basic Spring 4 MVC - Hello World - Error 404 File Not Found

From Dev

Simple Jersey Hello World 404 resource not found

From Dev

Can I add same wicket component under differrent parents in a markup page

From Dev

'hello/Hello.h' file not found - Trying to build/run iOS gomobile Hello app

From Dev

Fatal error: Uncaught Error: Class 'Project\Router\Hello' not found

From Dev

Django assert failure: assertInHTML('hello', '<html>hello</html>')

From Dev

Transclude HTML in Apache Wicket component

From Dev

DBT 404 Not found: Dataset hello-data-pipeline:staging_benjamin was not found in location EU

From Dev

Netbeans 10.0 <main classes not found> for simple Hello world program

From Dev

Render of app component renders the hello component or what does it exactly do ?Is it jsx?

From Dev

Render of app component renders the hello component or what does it exactly do ?Is it jsx?

From Dev

gitignore: Understanding "hello/" vs. "hello/*"

From Dev

Hello World ScalaTest Failing: not found: type MyScalatraServlet

From Dev

HTTP Status 404 - /com.demo/rest/hello - with Rest project

From Dev

Script _ Enter Greeting "hello" _ Echo Hello

From Dev

Can't run docker hello-world: mountpoint for devices not found

From Dev

error TemplateNotFound: hello.html from flask

From Dev

Snap (snapd) hello-world example not working (path not found?)

From Dev

Wicket: Can I create the markup before initializing the java component?

From Dev

butterknife Required view 'hello' with ID 2131427413 for field 'hello' was not found

From Dev

How to make a Hello World application without HTML tags?

Related Related

  1. 1

    Java/Wicket: Compile Basic Hello World with Resources

  2. 2

    gitignore: Understanding "hello/" vs. "hello/*"

  3. 3

    How to type String content:encoded = "Hello"; in java?

  4. 4

    Simple 'Hello World' type setup of TextAngular fails

  5. 5

    Simple HTML page not loading Javascript Hello World

  6. 6

    How can to create a JavaScript Hello World in a Mule component

  7. 7

    Hello World ScalaTest Failing: not found: type MyScalatraServlet

  8. 8

    Wicket fails to find markup file

  9. 9

    Basic Spring 4 MVC - Hello World - Error 404 File Not Found

  10. 10

    Simple Jersey Hello World 404 resource not found

  11. 11

    Can I add same wicket component under differrent parents in a markup page

  12. 12

    'hello/Hello.h' file not found - Trying to build/run iOS gomobile Hello app

  13. 13

    Fatal error: Uncaught Error: Class 'Project\Router\Hello' not found

  14. 14

    Django assert failure: assertInHTML('hello', '<html>hello</html>')

  15. 15

    Transclude HTML in Apache Wicket component

  16. 16

    DBT 404 Not found: Dataset hello-data-pipeline:staging_benjamin was not found in location EU

  17. 17

    Netbeans 10.0 <main classes not found> for simple Hello world program

  18. 18

    Render of app component renders the hello component or what does it exactly do ?Is it jsx?

  19. 19

    Render of app component renders the hello component or what does it exactly do ?Is it jsx?

  20. 20

    gitignore: Understanding "hello/" vs. "hello/*"

  21. 21

    Hello World ScalaTest Failing: not found: type MyScalatraServlet

  22. 22

    HTTP Status 404 - /com.demo/rest/hello - with Rest project

  23. 23

    Script _ Enter Greeting "hello" _ Echo Hello

  24. 24

    Can't run docker hello-world: mountpoint for devices not found

  25. 25

    error TemplateNotFound: hello.html from flask

  26. 26

    Snap (snapd) hello-world example not working (path not found?)

  27. 27

    Wicket: Can I create the markup before initializing the java component?

  28. 28

    butterknife Required view 'hello' with ID 2131427413 for field 'hello' was not found

  29. 29

    How to make a Hello World application without HTML tags?

HotTag

Archive