Errors after use MaskedTextField

Hi everybody,

I try to use phone validation, for this I download jar MaskedTextField from Vaadin site.
If I use this simple code:

[code]
phone = new TextField(“Phone”);
phone.setNullRepresentation(“0”);
phone.addValidator(new IntegerRangeValidator(“Add number of phone”, 0,9));
phone.setValidationVisible(false);
// final MaskedTextField phoneField = new MaskedTextField(“Phone (##) ####-####”, “+55 (##) ####-####”);

verticalLayout.addComponents(login, password, email, phone);
addComponent(verticalLayout);
[/code]The code is working, but if I open string with MaskedTextField I receive a lot of errors. I don’t add
phoneField to verticalLayout only open "final
MaskedTextField…"
I receive:

[code]
2017-11-13 18:00:59.699 ERROR 4540 — [nio-8080-exec-4]
com.vaadin.server.DefaultErrorHandler :

java.lang.NoClassDefFoundError: com/vaadin/terminal/PaintTarget
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_144]

at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_144]

at java.lang.Class.getDeclaredMethod(Class.java:2128) ~[na:1.8.0_144]


2017-11-13 18:00:59.701 ERROR 4540 — [nio-8080-exec-4]
o.a.c.c.C.[.[.
[/]
.[springVaadinServlet]
: Servlet.service() for servlet springVaadinServlet threw exception

java.lang.ClassNotFoundException: com.vaadin.terminal.PaintTarget
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_144]

at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_144]

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_144]


2017-11-13 18:00:59.707 ERROR 4540 — [nio-8080-exec-4]
o.a.c.c.C.[.[.
[/]
.[dispatcherServlet]
: Servlet.service() for servlet [dispatcherServlet]
in context with path threw exception [com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: com/vaadin/terminal/PaintTarget]
with root cause

java.lang.ClassNotFoundException: com.vaadin.terminal.PaintTarget
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_144]

at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_144]

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_144]

[/code]Could you help me to understand where is my misstake?

Hello, seems a dependency version problem. What version of the Vaadin framework are you using? And what is the version of the MaskedTextField add-on?

Seems that the
latest version of the add-on
uses Vaadin 7. Maybe it’s not compatible with Vaadin 6 or 8.

You could also try
OSGiMaskedTextField
, which is a fork off the same project, but has some changes.

-Olli