Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin in wildfly 8.1
Im new to Vaadin and i've been reading various webpages about it but im still unable to get it up running.
I happened to stumble upon a post from Adam Bien -> http://www.adam-bien.com/roller/abien/entry/essential_vaadin_7_java_ee
which i thought was nice and since i have a need for a way to expose some of my entities in the most simple way, i thought i would examine if vaadin is the way to go.
So im running IntelliJ 14, wildfly 8.1, maven and a project with some entities (no web and no web.xml)
I got Adam Bien's example up and running and wanted to expand it to be able to show a simple entity
So i would need a JPAContainer to be able to select som data from my datasource, but even that is not possible to me.
After some reading i seem to understand that im supposed to download a vaadin sdk (vaadin-all-7.5.6.zip)
but where do i extract it to and which parts ?? (since im only interested in a simple ui for viewing/editing a few jpa's ?)
Hi,
Don't use JPAContainer. I'm pretty sure it would be Adam's opinion as well. Create service layer via you access your entities. Check out e.g. this example to get started with Vaadin and JPA with a better angle. I tend to suggest also people to throw in DeltaSpike Data these days. This bit more complete Java EE example uses DeltaSpike Data as well.
cheers,
matti
I looked at the example and tried to use bits of it here and there but still i think i'll give up now
All this maven configuration is driving me mad
vaadin-cdi
switch
vaadin-themes
cdi-helpers
etc.
and their different versions - some of them exists and others dont, then some conflict in versions etc etc.
My own wildfly/maven config works without problems - but still im not sure if its a vaadin thing
or its the combination of vaadin and my project.
Anyway im not gonna spend more time with it than i already did.
Thanks
Hi,
Some Vaadin add-ons are only available via maven repository of the Directory. Add this to your pom.xml (or settings.mls):
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
If it is still not working, I'd really like to figure out what is the problem with your project, could you share its sources?
cheers,
matti
I added the repo and got following error :
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project PIntegration: Compilation failure
[ERROR] /C:/workspace/<projectName>/src/main/java/dk/danskespil/presentation/JobForm.java:[22,8] cannot access org.json.JSONException
[ERROR] class file for org.json.JSONException not found
Even if im not doing anything which includes json.
the java file :
public class JobForm extends AbstractForm<JobExecution> {
@Inject
PostService postService;
TextField name = new MTextField("Name");
TextField number = new MTextField("Number");
TextField email = new MTextField("Email");
DateField birthDate = new PopupDateField("Birth date");
Switch sendChristmasCard = new Switch("Send christmas card");
MultiSelectTable groups = new MultiSelectTable("Groups").withProperties("name").withColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
public static class AddressRow {
EnumSelect type = new EnumSelect().withWidth("6em");
TextField street = new MTextField().withInputPrompt("street");
TextField city = new MTextField().withInputPrompt("city").withWidth("6em");
TextField zip = new MTextField().withInputPrompt("zip").withWidth("4em");
}
ElementCollectionField<JobExecution> jobs = new ElementCollectionField<>(JobExecution.class, AddressRow.class).withCaption("Addressess");
@Override
protected Component createContent() {
groups.setOptions(postService.getJobs());
return new MVerticalLayout(
getToolbar(),
new MHorizontalLayout(
new MFormLayout(
name,
number,
email,
birthDate,
sendChristmasCard
).withMargin(false),
groups.withFullHeight()
),
vJobs
).withMargin(new MMarginInfo(false, true)); }
}
Autch, that has bee nasty issue lately. The Vaadin core used to depend on a JSON library which was changed into another implementation and some add-on appraently on the page, I'd suspect Switch, uses the old API. You probably had a newer version of Vaadin and bit outdated version of something else.
I think there is a more recent version of it available. If you started with the jpa-addressbook example, you could check out the latest versions form its pom.xml. I just yesterday updated its versions (Vaadin, add-ons and cdn.virit.in). It should now also behave better in Eclipse by default as I through in some m2e hints to the experimental cdn.virit.in service.
cheers,
matti