? equals = myPojoProviderService.getAllMyPojos()

You don’t need to use “new” because it’s done for you in the getInstance() factory method. As I mentioned in the previous post, wrap the line in a try-catch block.

List<Product> products;
try{
    products = ProductDbUtil.getInstance().getProducts();
} catch (Exception e) {
}

Grid<Product> grid = new Grid<>(Product.class);
grid.setItems(products);

trying right now!

Excellent, thank you.

The local variable products may not have been initialized
31916.png

ok, I applied quick fix
and it has no errors but still does not display the grid

one moment shall make a video note

Below is the code

package com.dataSQL.basic;

import java.util.List;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Grid;
import com.vaadin.ui.UI;

@Theme("maintheme")
public class MainUI extends UI {

    @Override
    protected void init(VaadinRequest vaadinRequest) {        
        List<Product> products = null;
        try{
            products = ProductDbUtil.getInstance().getProducts();
        } catch (Exception e) {
        }
        Grid<Product> grid = new Grid<>(Product.class);
        grid.setItems(products);     
    }
    @WebServlet(urlPatterns = "/*", name = "MainUIServlet", asyncSupported = true)
    @VaadinServletConfiguration(ui = MainUI.class, productionMode = false)
    public static class MainUIServlet extends VaadinServlet {
    }
}

do I have to put in the layout?

video notes
https://www.useloom.com/share/124a632267b143e683045e56cbd3edf1

Shall try again.

Your Jetty server is not starting cleanly, it throws several exceptions because it can’t resolve jdbc/webdata. As I mentioned in an earlier post, you need to have a WebContent folder that is mapped to / in the deployment assembly. This folder can be created for you by adding the Dynamic Web Module facet. In that folder are WEB-INF and a META-INF, which are the locations for your xml configuration files.

Also, you never attach the grid (or anything) to the UI (
docs here
).

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        try{
            List<Product> products = ProductDbUtil.getInstance().getProducts();
            Grid<Product> grid = new Grid<>(Product.class);
            grid.setItems(products);
            setContent(grid);
        } catch (Exception e) { }
    }

– AC

Excellent!

I have a WebContent folder that was created by adding the Dynamic Web Module facet, and I have both WEB-INF and META-INF folder which has the xml configuration files:

Context.xml
Web.xml

I followed your instructions – and shall double check here again:

If you have m2e and m2e-wtp installed in Eclipse, then you can add the Dynamic Web Module facet to your Vaadin archetype project (right click your project, select Properties, choose Project Facets from the left pane). If your project is not already in faceted form, converting it and adding Dynamic Web Module will give you a WebContent folder with a WEB-INF and a META-INF, so you now have a destination for your web.xml and context.xml.

Your deployment assembly (also under project properties) must include the following mappings:

/WebContent => /
/src/main/webapp => /
Maven Dependencies => WEB-INF/lib

I’ve attached an image that shows you the mappings I have for one of my projects that deploys to a server (instead of using the jetty-maven plugin). Note the options in the “New Assembly Directive” dialog box. If you don’t see these options (e.g. Java Build Path Entries), then make sure m2e and m2e-wtp are installed correctly.

Finally, I recommend making your mysql jdbc connector 5.1.40 a maven dependency instead of a referenced library. You can do that by adding the following lines to your pom.xml in the section:

12345

mysql
mysql-connector-java
5.1.40

It WORKED!

I have a VAADIN GRID populated with remote data!

Jetty did not run, HTTP ERROR: 503
Problem accessing /. Reason:Service UnavailablePowered by Jetty:// 9.3.9.v20160517

But it ran locally using Tomcat

video notes:
https://www.useloom.com/share/5e22c850dac8425a8b412ec49e5554e4

Congrats! Pop the champagne!

Final thoughts from your video post:

  1. Adding project

    facets

    in Eclipse is not the same as "Java Server

    Faces

    " or JSF. Totally different. All the same, you got it working.
  2. There is no error in the app. The reason that there is nothing to the right of the grid is because you don’t have any code that puts anything to the right of the grid. All you have is a UI subclass that takes a grid. To get the rest, take the code from a working example and merge that into your init() method on your UI class.

Best of luck.

– AC

And it deploys to the web !

THANK YOU!

Shall figure out why jetty is having the problem and NOW deployed on AWS
http://duelchem.us-west-2.elasticbeanstalk.com/

Thank you Mr. Alejandro C De Baca.

Cannot wait to gain extreme knowledge of VAADIN.

Thank you for all the time you shared with me.

Cordially,

Jon

Yes, shall do!

Going to use the download example and add that code into the grid code, then print the CRUD Vaadin example code and add the Create, Update and Delete part.

Thank you!

Sorry to have taken up so much of your time.

Shall always be grateful for your guidance and instruction.

Thank you.

Any thought WHY Jetty is returning the error?

I shall re-boot and then try again.
https://www.useloom.com/share/43ad7aae97b64a568d58ffbeb653cbfe