Hi,
I have this error:
There was an exception while trying to navigate to '' with the exception message 'Error creating bean with name 'org.vaadin.example.MainView': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.vaadin.example.MainView]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.vaadin.flow.component.icon.IronIcon': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}'
This is the code I have:
.ts:
import { LitElement, html, css, customElement } from 'lit-element';
import '@vaadin/vertical-layout/src/vaadin-vertical-layout.js';
import '@polymer/iron-icon/iron-icon.js';
import '@vaadin/horizontal-layout/src/vaadin-horizontal-layout.js';
@customElement('vista-listadecomentarios_item')
export class VistaListadecomentarios_item extends LitElement {
static get styles() {
return css`
:host {
display: block;
height: 100%;
}
`;
}
render() {
return html`
<vaadin-vertical-layout id="VL_listacomentarios_mainContainer" theme="" style="width: 100%; height: 100%; border: 2px solid blue; align-items: center; justify-content: center;
position: aboslute;">
<vaadin-horizontal-layout id="HL_comentario_body" style="width: 100%; height: 70%; flex-grow: 0; flex-shrink: 1;">
<vaadin-vertical-layout id="VL_datos_usuario" style="width: 10%; height: 100%; align-items: center; justify-content: center;">
<vaadin-horizontal-layout id="HL_iconoYDatosUsuario" theme="spacing-s" style="width: 100%; height: 100%; align-items: center; justify-content: flex-start; margin-left: var(--lumo-space-m);">
<iron-icon id="ironIcon_avatarUsuario" style="width: 28%; height: auto;" src="https://icons.getbootstrap.com/assets/icons/person.svg"></iron-icon>
<vaadin-vertical-layout id="VL_nickYUsername" style="width: 100%; height: 100%; flex-grow: 0; flex-shrink: 1;">
<vaadin-horizontal-layout id="HL_nickContainer" style="width: 100%; height: 50%;">
<h4 id="h4_nickUsuario" style="width: auto; height: auto;"> Nick </h4>
</vaadin-horizontal-layout>
<vaadin-horizontal-layout id="HL_usernameContainer" style="height: 100%; width: 50%;">
<label id="label_username">@user</label>
</vaadin-horizontal-layout>
</vaadin-vertical-layout>
</vaadin-horizontal-layout>
</vaadin-vertical-layout>
<vaadin-vertical-layout id="VL_contenidoComentario" style="width: 90%; height: 100%; align-items: center; justify-content: center; border: 2px solid;">
<label id="label_comentarioTexto">Comentario</label>
</vaadin-vertical-layout>
</vaadin-horizontal-layout>
<vaadin-horizontal-layout id="HL_fechaYMeGusta" theme="spacing-xl" style="width: 11%; height: 30%; align-items: center; margin-left: var(--lumo-space-m); justify-content: space-between;">
<label id="label_fechaComentario">Fecha</label>
<iron-icon id="ironIcon_meGusta" src="https://icons.getbootstrap.com/assets/icons/heart-fill.svg"></iron-icon>
</vaadin-horizontal-layout>
</vaadin-vertical-layout>
`;
}
// Evita usar Shadow DOM para que Vaadin LitTemplate encuentre los IDs correctamente
createRenderRoot() {
return this;
}
}
.java:
package vistas;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.littemplate.LitTemplate;
import com.vaadin.flow.dom.Element;
import com.vaadin.flow.component.template.Id;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.icon.IronIcon;
import com.vaadin.flow.component.html.H4;
import com.vaadin.flow.component.html.Label;
@Tag("vista-listadecomentarios_item")
@JsModule("./views/vista-listadecomentarios_item.ts")
public class VistaListadecomentarios_item extends LitTemplate {
@Id("ironIcon_meGusta")
private IronIcon ironIcon_meGusta;
@Id("label_fechaComentario")
private Label label_fechaComentario;
@Id("HL_fechaYMeGusta")
private HorizontalLayout hL_fechaYMeGusta;
@Id("label_comentarioTexto")
private Label label_comentarioTexto;
@Id("VL_contenidoComentario")
private Element vL_contenidoComentario;
@Id("label_username")
private Label label_username;
@Id("HL_usernameContainer")
private HorizontalLayout hL_usernameContainer;
@Id("h4_nickUsuario")
private H4 h4_nickUsuario;
@Id("HL_nickContainer")
private HorizontalLayout hL_nickContainer;
@Id("VL_nickYUsername")
private Element vL_nickYUsername;
@Id("ironIcon_avatarUsuario")
private IronIcon ironIcon_avatarUsuario;
@Id("HL_iconoYDatosUsuario")
private HorizontalLayout hL_iconoYDatosUsuario;
@Id("VL_datos_usuario")
private Element vL_datos_usuario;
@Id("HL_comentario_body")
private HorizontalLayout hL_comentario_body;
@Id("VL_listacomentarios_mainContainer")
private Element vL_listacomentarios_mainContainer;
public VistaListadecomentarios_item() {
// You can initialise any data required for the connected UI components here.
}
public IronIcon getIronIcon_meGusta() {
return ironIcon_meGusta;
}
public void setIronIcon_meGusta(IronIcon ironIcon_meGusta) {
this.ironIcon_meGusta = ironIcon_meGusta;
}
public Label getLabel_fechaComentario() {
return label_fechaComentario;
}
public void setLabel_fechaComentario(Label label_fechaComentario) {
this.label_fechaComentario = label_fechaComentario;
}
public HorizontalLayout gethL_fechaYMeGusta() {
return hL_fechaYMeGusta;
}
public void sethL_fechaYMeGusta(HorizontalLayout hL_fechaYMeGusta) {
this.hL_fechaYMeGusta = hL_fechaYMeGusta;
}
public Label getLabel_comentarioTexto() {
return label_comentarioTexto;
}
public void setLabel_comentarioTexto(Label label_comentarioTexto) {
this.label_comentarioTexto = label_comentarioTexto;
}
public Element getvL_contenidoComentario() {
return vL_contenidoComentario;
}
public void setvL_contenidoComentario(Element vL_contenidoComentario) {
this.vL_contenidoComentario = vL_contenidoComentario;
}
public Label getLabel_username() {
return label_username;
}
public void setLabel_username(Label label_username) {
this.label_username = label_username;
}
public HorizontalLayout gethL_usernameContainer() {
return hL_usernameContainer;
}
public void sethL_usernameContainer(HorizontalLayout hL_usernameContainer) {
this.hL_usernameContainer = hL_usernameContainer;
}
public H4 getH4_nickUsuario() {
return h4_nickUsuario;
}
public void setH4_nickUsuario(H4 h4_nickUsuario) {
this.h4_nickUsuario = h4_nickUsuario;
}
public HorizontalLayout gethL_nickContainer() {
return hL_nickContainer;
}
public void sethL_nickContainer(HorizontalLayout hL_nickContainer) {
this.hL_nickContainer = hL_nickContainer;
}
public Element getvL_nickYUsername() {
return vL_nickYUsername;
}
public void setvL_nickYUsername(Element vL_nickYUsername) {
this.vL_nickYUsername = vL_nickYUsername;
}
public IronIcon getIronIcon_avatarUsuario() {
return ironIcon_avatarUsuario;
}
public void setIronIcon_avatarUsuario(IronIcon ironIcon_avatarUsuario) {
this.ironIcon_avatarUsuario = ironIcon_avatarUsuario;
}
public HorizontalLayout gethL_iconoYDatosUsuario() {
return hL_iconoYDatosUsuario;
}
public void sethL_iconoYDatosUsuario(HorizontalLayout hL_iconoYDatosUsuario) {
this.hL_iconoYDatosUsuario = hL_iconoYDatosUsuario;
}
public Element getvL_datos_usuario() {
return vL_datos_usuario;
}
public void setvL_datos_usuario(Element vL_datos_usuario) {
this.vL_datos_usuario = vL_datos_usuario;
}
public HorizontalLayout gethL_comentario_body() {
return hL_comentario_body;
}
public void sethL_comentario_body(HorizontalLayout hL_comentario_body) {
this.hL_comentario_body = hL_comentario_body;
}
public Element getvL_listacomentarios_mainContainer() {
return vL_listacomentarios_mainContainer;
}
public void setvL_listacomentarios_mainContainer(Element vL_listacomentarios_mainContainer) {
this.vL_listacomentarios_mainContainer = vL_listacomentarios_mainContainer;
}
}
Screenshot with error: