on 2015 Apr 17 3:48 PM
Hi,
I thought I'd write an article or two about using Vaadin as a UI library for a SAP Hana backed applications. I got something up and running, based on the EJB example that comes with the SDK, but also got couple of questions related to the provided Java EE Web Profile execution environment.
First is about CDI? It'd be awesome helper for Vaadin apps and also other UI frameworks. That would help both injecting the EJB to UI classes and also to write cleaner UI code. Vaadin CDI integration library looks for BeanManager in some cases via JNDI lookup from java:comp/BeanManager. This don't seem to be in SAP Hana Cloud server, although it should be there by the specification. Is there some alternative JNDI location where it could be searched for?
Another question is about JPA provider. I see that you are using EclipseLink, which is my favourite as well 😉 But the question is, is it on purpose added to war files as a normal dependency (and jar file to WEB-INF/lib)? Shouldn't that be provided by the execution environment and have <scope>provided</scope> in the dependency declaration?
I was also struggling to get the local development server setup up and running, but this is probably an issue in my tunnel setup.
cheers,
matti
Hi Matti,
First of all, sorry for the delayed reply. I did saw your post but was on vacation then, and after that I totally forgot to follow up on it.
Next, thank you for your interest in HCP and especially for your willingness to share and write about using Vaadin on HCP. Being an open PaaS, such kind of articles and blog posts describing the usage of various popular frameworks and libraries are very much appreciated!
So, I did a small test and indeed - java:comp/BeanManager lookup doesn't seem to work. What does work however is simple DI of it, e.g. in a Servlet:
public class MyServlet extends HttpServlet {
@Inject BeanManager beanMngr;
-- which is pretty much weird. Not sure if that could be an alternative approach for the Vaadin CDI integration? but anyway, I asked a colleague to have a look into this issue.
As to EclipseLink - yes, it is provided by the runtime execution environment and there is no need to be packaged in the war file. I believe the only reason it has <scope>system</scope> in the sample pom.xml is because it's also required for the tests which are also shipped with the samples.
Cheers,
--Vlado
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vlado, thanks for your answer!
Do you have some issue tracker where I could subscribe to get notified if the issue is fixed?
I'd need to create a custom version of Vaadin CDI (or use some less modern method to fetch EJB reference) so I think I'll base my example on Spring (Boot) at this point, but it would be cool to have it also on standard Java EE stack as well.
cheers,
matti
I finally decided to wrote my example with Java EE, but just without CDI:
https://github.com/mstahv/sap-hana-with-vaadin
I just wrote a helper to get a reference to the EJB injected directly to a servlet and it works fine like that. But ping me when the issue is solved, I'd love to clean up the example a bit with CDI.
I also blogged about it to here at SAP Community Network, but it is still waiting for moderation.
cheers,
matti
Hi,
I just tried HCP Java EE execution environment version 2.66 with latest version of Vaadin CDI and all seems to work perfectly now. Big thanks!
I need to update my example and write a short blog to get user on the right track right from the start.
cheers,
matti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bump.
Does anybody have any idea on any of these questions?
chers,
matti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.