How to solve the error message: "Whitelabel Error Page" for Spring Boot - spring-boot

I'm new with spring boot and I'm trying to make a project with Spring MVC + Spring Boot2 + JSP + Spring Data + DB Oracle.
When I run the simple application, The first message error I was been:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Apr 17 10:20:05 CEST 2020
There was an unexpected error (type=Not Found, status=404).
No message available
I found a lot of documention about this error and I tested different solutions but nothing was fine for my problem. Below the tests I did:
1) I make sure that my main class was in the root package and I put the other packages int the sub level;
2) I used de #ComponentScan in the main class in this way #ComponentScan({"com.dashboard.demo.controller"});
3) in the application.properties I used this command server.servlet.context-path=/oee
This is my code:
Application.properties
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
server.servlet.context-path=/oee
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url= jdbc:oracle:thin:#serverIP:Port:DB11G
spring.datasource.username= Server name
spring.datasource.password= password
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.Oracle10gDialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = create-drop
spring.jpa.show-sql= true
server.port = 8091
Main
package com.dashboard.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
#SpringBootApplication
public class OeeApplication extends SpringBootServletInitializer{
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(OeeApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(OeeApplication.class, args);
}
}
OEEController
package com.dashboard.demo.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.dashboard.demo.entities.OEE;
import com.dashboard.demo.service.OEEService;
#Controller
public class OEEController {
#Autowired
private OEEService oeeService;
#RequestMapping(value = "/oee}", method = RequestMethod.GET)
public String listAll(Model model)
{
List<OEE> oee = oeeService.SelDevice();
model.addAttribute("OEE",oee);
return "oee";
}
}
OEEServiceImpl
package com.dashboard.demo.service;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dashboard.demo.entities.OEE;
import com.dashboard.demo.repository.OEERepository;
#Service
#Transactional
public class OEEServiceImpl implements OEEService{
#Autowired
private OEERepository oeeRepository;
#Override
public List<OEE> SelDevice()
{
return oeeRepository.findAll();
}
}
OEERepository
package com.dashboard.demo.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.dashboard.demo.entities.OEE;
import com.dashboard.demo.entities.OEEid;
#Repository
public interface OEERepository extends JpaRepository<OEE, OEEid>
{
}
I'm managing a composite key and I've create a class for the composite key and another to manage the entity. I'm catching the error int this package.
package com.dashboard.demo.entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;
#Data
#Embeddable
public class OEEid implements Serializable{
/**
*
*/
private static final long serialVersionUID = 4512114330774744082L;
#DateTimeFormat(pattern = "dd-MM-yy HH:mm:ss")
#Column(name = "MSO_GIORNO_LAV")
private Date date;
#Column(name = "MSO_MACCHINA")
private String device;
public OEEid(Date date, String device) {
super();
this.date = date;
this.device = device;
}
}
package com.dashboard.demo.entities;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.IdClass;
import javax.persistence.Table;
import lombok.Data;
#Entity
#Table(name = "MES_OEE")
#Data
public class OEE implements Serializable
{
/**
*
*/
private static final long serialVersionUID = -7738922358421962399L;
#EmbeddedId
private OEEid oeeID;
#Basic(optional = false)
#Column(name = "MSO_QUANTITA")
private int amount;
#Basic(optional = false)
#Column(name = "MSO_OEE")
private float oee;
}
oee.jsp
<!DOCTYPE html>
<%# taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css"
href="webjars/bootstrap/3.3.7/css/bootstrap.min.css" />
<c:url value="/css/main.css" var="jstlCss" />
<link href="${jstlCss}" rel="stylesheet" />
</head>
<body>
<div class="container">
<header>
<h1>Spring MVC + JSP + JPA + Spring Boot 2</h1>
</header>
<div class="starter-template">
<h1>Users List</h1>
<table
class="table table-striped table-hover table-condensed table-bordered">
<tr>
<th>Date</th>
<th>Device</th>
<th>Amount</th>
<th>OEE</th>
</tr>
<c:forEach items="${OEE}" var="oee">
<tr>
<td>${oee.oeeID.date}</td>
<td>${oee.oeeID.device}</td>
<td>${oee.amount}</td>
<td>${oee.oee}</td>
</tr>
</c:forEach>
</table>
</div>
</div>
<script type="text/javascript"
src="webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
Can anyone give me any suggestions to solve this error message?
Thanks
This is my project directory

Can you please try by removing this server.servlet.context-path=/oee from properties file and try with localhost:8080/oeee

Related

Request method 'GET' not supported There was an unexpected error (type=Method Not Allowed, status=405)

My scenario is as follows:
There are several entities, and I need to send custom designed email for each entity "by Id". For example, I am trying to send the email by this URL for "babs" entity:
http://localhost:8081/api/v1/test/babss/sendmail/b1d0c331-35ac-430d-87ca-1718b06351c3
Sample entity for BaBS:
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import javax.persistence.*;
import java.util.UUID;
#Getter
#Setter
#NoArgsConstructor
#AllArgsConstructor
#Builder
#Entity
#Table(name = "babs")
public class BaBs {
#Id
#Column(name = "id")
private UUID id;
#Column(name = "accountCode")
private String accountCode;
#Column(name = "accountName")
private String accountName;
#Column(name = "eMail")
private String eMail;
#ManyToOne
#JsonBackReference
#JoinColumn(name = "accountid")
private Account account;
}
email Sending Service
import gokhan.mutabakatcore.models.BaBs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
#Component
public class SentBaBsEmail {
#Autowired
private JavaMailSender sender;
public HttpStatus mailBaBs(BaBs baBs) throws MailException {
SimpleMailMessage mail = new SimpleMailMessage();
mail.setTo(baBs.getEMail());
mail.setSubject("Trial Mail for Sending BaBs");
mail.setText("Normally Details from Object ");
sender.send(mail);
System.out.println("eMail sent");
return HttpStatus.GONE;
}
}
Corresponding part of BaBS Controller
import gokhan.mutabakatcore.models.BaBs;
import gokhan.mutabakatcore.services.BaBsService;
import gokhan.mutabakatcore.utils.SentBaBsEmail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.function.Function;
#RestController
#RequestMapping("/api/v1/test/babss")
public class BaBsController {
private final BaBsService baBsService;
public BaBsController(BaBsService baBsService) {
this.baBsService = baBsService;
}
#Autowired
SentBaBsEmail baBsEmail;
#RequestMapping(value = "/sendmail/{Id}", method = { RequestMethod.GET, RequestMethod.POST })
public ResponseEntity<?> eMailBaBsByCustomerId(#PathVariable("Id") UUID uuid){
try{
if (!baBsService.findById(uuid).equals(Optional.empty())){
// Converts Optional Object to Normal Object
BaBs baBs = (BaBs) toList(baBsService.findById(uuid));
baBsEmail.mailBaBs(baBs);
return new ResponseEntity(baBs ,HttpStatus.CREATED);
}
return new ResponseEntity<>("Unrecorded BaBS!", HttpStatus.BAD_REQUEST);
} catch (Exception e) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
}
}
Application.properties Mailing part
#SMTP Email Properties
spring.mail.host=mail.xyz.com
spring.mail.port=587
spring.mail.username=info#xyz.com
spring.mail.password=password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.starttls.enable=true
spring.mail.properties.mail.starttls.required=true
Relavant POM.xml dependencies
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
The error I got:
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Sat Aug 06 08:39:31 EET 2022
There was an unexpected error (type=Method Not Allowed, status=405).
Request method 'GET' not supported
org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported
I'll appreciate if you can show me the issue...

getting below mention Exception while executing the query(Spring Boot+JPA+Hibernate)

This is the error received when try to execute the sample query. Please help me to get out of this.
org.hibernate.hql.internal.ast.QuerySyntaxException: Transaction is not mapped
below is the entity class with mapping
Transaction.java
package org.npst.mb.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.stereotype.Component;
#Entity
#Table(name="transaction")
public class Transaction implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy=GenerationType.AUTO)
#Column(name="transactionid")
private int transactionid;
#Column(name="appid")
private int appid;
public int getTransactionid() {
return transactionid;
}
public void setTransactionid(int transactionid) {
this.transactionid = transactionid;
}
public int getAppid() {
return appid;
}
public void setAppid(int appid) {
this.appid = appid;
}
}
Install .java(Spring Boot App Stater)
package org.npst.mb.install;
import org.npst.mb.controller.JobLauncherController;
import org.npst.mb.dao.TransactionDao;
import org.npst.mb.service.TransactionService;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
#SpringBootApplication
#EnableBatchProcessing
#ImportResource("classpath:batchjob.xml")
#ComponentScan(basePackages ={"org.npst.mb.entity.*"},basePackageClasses= {TransactionService.class,TransactionDao.class,JobLauncherController.class})
public class Install {
public static void main(String[] args) {
SpringApplication.run(Install.class, args);
}
}
DAOIMPL(Query to interact with DB)
package org.npst.mb.dao.impl;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.npst.mb.dao.TransactionDao;
import org.npst.mb.entity.Transaction;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
#Transactional
#Repository
public class TransactionDaoImpl implements TransactionDao {
#PersistenceContext
private EntityManager entityManager;
#Override
public boolean addTransaction(Transaction txndata) {
return true;
}
#Override
public long getMaxTid() {
try {
System.out.println("maxtxnid::");
String hql="from Transaction where transactionid > 0";
entityManager.createQuery(hql).getMaxResults();
return 0;
}
catch(Exception sql) {
System.out.println(sql.getMessage());
sql.printStackTrace();
return 0;
}
}
}
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/test1
spring.datasource.username=root
spring.datasource.password=naveen123
spring.datasource.tomcat.max-wait=20000
spring.datasource.tomcat.max-active=50
spring.datasource.tomcat.max-idle=20
spring.datasource.tomcat.min-idle=15
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.id.new_generator_mappings = false
spring.jpa.properties.hibernate.format_sql = true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create
spring.data.jpa.repositories.enabled=true
spring.jpa.open-in-view=true
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
As I understand, #ComponentScan scans and creates beans for the classes annotated #Component, #Service, #Controller,#Repository.
#EntityScan annotation is used to identify JPA entities(persistent classes).
Can you try by adding #EntityScan("org.npst.mb.entity")?

Can not Fetch Data with JPQL using Postgres Database Spring MVC

I am trying to develop SpringMVC framework, everything working fine but when I run my codes, data are not fetched from Postgres database using JPQL.
domain model class
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Version;
#Entity
#Table(name = "Contact")
#NamedQueries({
#NamedQuery(name="Contact.findAll", query="select c from Contact c")
})
public class Contact implements Serializable {
private Long id;
private int version;
private String firstName;
private String lastName;
private String description;
getter and setter defined
Repository Class
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.apress.prospring3.ch17.domain.Contact;
#Repository
#Transactional
public class ContactRepository implements CrudRepository {
#PersistenceContext
private EntityManager manager;
public List<Contact> findAll() {
List<Contact> contact = manager.createNamedQuery("Contact.findAll",
Contact.class).getResultList();
return contact;
}
}
Controller Class
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.apress.prospring3.ch17.domain.Contact;
import com.apress.prospring3.ch17.service.ContactService;
#RequestMapping("/contact")
#Controller
public class ContactController {
#Autowired
ContactService contactService;
#RequestMapping(method = RequestMethod.GET)
public String list(Model uiModel) {
List<Contact> contacts = contactService.findAll();
uiModel.addAttribute("contacts", contacts);
return "contacts/list";
}
}
Front View (list.jspx)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:joda="http://www.joda.org/joda/time/tags" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:output omit-xml-declaration="yes" />
<h1>Contact Listing</h1>
<table>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Birth Date</th>
</tr>
</thead>
<tbody>
<c:forEach items="${contacts}" var="contact">
<tr>
<td>${contact.firstName}</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
Server Logs
Hibernate: select contact0_.ID as ID1_0_, contact0_.DESCRIPTION as
DESCRIPT2_0_, contact0_.FIRST_NAME as FIRST_NA3_0_,
contact0_.LAST_NAME as LAST_NAM4_0_, contact0_.VERSION as VERSION5_0_
from Contact contact0_
Jan 24, 2016 2:19:14 PM org.apache.jasper.compiler.TldLocationsCache
tldScanJar INFO: At least one JAR was scanned for TLDs yet contained
no TLDs. Enable debug logging for this logger for a complete list of
JARs that were scanned where no TLDs were found. Skipping JAR scanning
can improve startup time and JSP compilation time.
Output
Postgres DataBase data
Please correct me what I am missing.
Thank you so much.
Finally I realized what I have missed.
I forget to declare empty constructor for my model class.
public class Contact implements Serializable {
private Long id;
private int version;
private String firstName;
private String lastName;
private String description;
public Contact(){} // This invoke to model with Entity class and interact with Database
getter and setter defined

bootstrap template & spring boot ( can not display an html page)

I'am using a bootstrap template and spring boot , i wanted to test the controller , for that i code a simple restfull service wich retun the index page of the template but it didn't work it gives me an error.
Here's the architecture of the project
And here's my controller
package demo.controllers;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.view.RedirectView;
import demo.connection.SingletonConnection;
import demo.dao.IDatabase;
import demo.dao.IEntities;
import demo.entities.DB;
#RestController
public class DatabaseController implements ErrorController{
private static final String PATH = "/error";
protected Connection conn;
#Autowired
private IDatabase db;
#Autowired
private IEntities entities;
// En cas d'érreur
#RequestMapping(value = PATH)
public String error() {
return "Error";
}
#Override
public String getErrorPath() {
return PATH;
}
#RequestMapping(value="/")
public String index(Model model){
return "pages/index.html";
}
}
when i run the application with the path : http://localhost:8080/test

Passing String from jsp to Controller in Spring

I created a project with Spring + JPA + Hibernate. I want to pass a string from jsp to controller(removeUtente method). If I click on the link I delete the row from the database .. Where am I doing wrong? Excuse me for my english..The controller receives the string from jsp and calls the method to remove it.
Thanks
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%#taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h2>Lista utenti</h2>
<table border="1">
<c:forEach var="utente" items="${lista }">
<tr>
<td>
<c:out value="${utente.id}"/>
</td>
<td>
<c:out value="${utente.cognome}"/>
</td>
<td>
<c:out value="${utente.nome}"/>
</td>
<td>
<c:out value="${utente.eta}"/>
</td>
<td>
<c:url var="url" value="/remove">
<c:param name="id" value="${utente.id }"/>
</c:url>
click to delete
</td>
</tr>
</c:forEach>
</table>
</body>
</html>
UtenteController.java
package controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import persistence.UtenteDAO;
import bean.Utente;
#Controller
public class UtenteController {
#Autowired
UtenteDAO utenteDAO;
#RequestMapping(value="/add",method=RequestMethod.POST)
public String addUtente(#ModelAttribute Utente u){
utenteDAO.inserisciUtente(u);
return "index";
}//addUtente
#RequestMapping(value="/show",method=RequestMethod.GET)
public String getUtenti(ModelMap model){
List<Utente> lista=utenteDAO.listaUtenti();
model.addAttribute("lista", lista);
return "showlista";
}//getUtenti
#RequestMapping(value="/remove",method=RequestMethod.GET)
public String removeUtente(#RequestParam String id){
utenteDAO.rimuovi(id);
return "showlista";
}//removeUtente
}//UtenteController
Utente.java
package bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
#Entity
#Table(name="utente")
public class Utente {
#Id
#GeneratedValue
#Column(name="id")
private Integer id;
#Column(name="cognome")
private String cognome;
#Column(name="nome")
private String nome;
#Column(name="eta")
private Integer eta;
public Integer getId(){return id;}//getId
public void setId(Integer id){this.id=id;}//setId
public String getCognome(){return cognome;}//getCognome
public void setCognome(String cognome){this.cognome=cognome;}//setCognome
public String getNome(){return nome;}//getNome
public void setNome(String nome){this.nome=nome;}//setNome
public Integer getEta(){return eta;}//getEta
public void setEta(Integer eta){this.eta=eta;}//setEta
#Override
public String toString(){
return "id:"+id+" cogn:"+cognome+" nome:"+nome+" eta:"+eta;
}//toString
}//Utente
UtenteDAOImpl.java
package persistence;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.transaction.annotation.Transactional;
import bean.Utente;
#Transactional
public class UtenteDAOImpl implements UtenteDAO {
#PersistenceContext
EntityManager em;
public void inserisciUtente(Utente u){
em.persist(u);
}//inserisciUtente
#SuppressWarnings("unchecked")
public List<Utente> listaUtenti(){
Query q=em.createQuery("SELECT u FROM Utente u");
List<Utente> ris=q.getResultList();
return ris;
}//listaUtenti
public void rimuovi(String idUtente){
Query q=em.createQuery("DELETE FROM Utente AS u WHERE u.id =:id");
q.setParameter("id", idUtente);
q.executeUpdate();
}//rimuovi
}//inserisciUtente

Resources