Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
The goal was to inject bean in facesconverter via CDI, but I don't have this need anymore, since faces converter is not an eligible injection point, so I opted to use request scoped JSF managed beans that have facesconverter defined within the bean. That's working fine. Thanks. Okay, I can cc

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Mark Struberg
you could also have used CODI BeanManagerProvider#getReference to get access to the bean. The support you need out of the box will come in JSF-2.2. LieGrue, strub - Original Message - From: Howard W. Smith, Jr. smithh032...@gmail.com To: us...@openejb.apache.org; MyFaces

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
Interesting and noted, thanks. Yes, I did hear JSF 2.2 will allow CDI in facesconverter. Thanks. On Nov 20, 2012 8:34 AM, Mark Struberg strub...@yahoo.de wrote: you could also have used CODI BeanManagerProvider#getReference to get access to the bean. The support you need out of the box will

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Rafael Pestano
you can also use CODI @Advanced and then inject anything in the converter, see [1]. i hope it helps. [1]:https://cwiki.apache.org/EXTCDI/jsf-usage.html#JSFUsage-DependencyInjection   Att,  Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Rafael Pestano
you can also use CODI @Advanced and then inject anything in the converter, see [1]. i hope it helps. [1]:https://cwiki.apache.org/EXTCDI/jsf-usage.html#JSFUsage-DependencyInjection Att,  Rafael M. Pestano Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul Graduando em

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
MyFaces Users, Please read OP (or my original email below), and then read this email, and advise. Romain, Yes, I have a code snippet; please continue reading beyond/below first code snippet. Below is the code that is called by multiple beans as well as the bean where this method is defined.

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
Rafael, I saw that page about CODI @Advanced. :) I tried CODI @Advanced, but CDI managed bean was not injected voa @Inject, and then I tried to inject Stateless EJB via @Inject, and that stateless EJB was not injected either. Thanks, Howard On Tue, Nov 20, 2012 at 9:02 AM, Rafael Pestano

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Mark Struberg
CDI injection using @Advanced should work perfectly fine. We tested this excessively and use it on several containers in production. I'm curious why it doesn't work for you. LieGrue, strub - Original Message - From: Howard W. Smith, Jr. smithh032...@gmail.com To: MyFaces Discussion

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Mark Struberg
Hi! One of my first advice is to make sure that beans.xml is really there for the container. I've seen this pretty often if someone starts the webapp directly from Eclipse. In that case the CDI container sometimes cannot find WEB-INF/beans.xml as eclipse doesn't set the classpath entries

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Mark Struberg
oh, if you are using OpenEJB/TomEE/ other EE server then you can also use @Timeout in an EJB instead of Quartz. LieGrue, strub - Original Message - From: Mark Struberg strub...@yahoo.de To: MyFaces Discussion users@myfaces.apache.org; us...@openejb.apache.org

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Mark, Cool beans and agreed about @Asynchronous! Since I read about @Asynchronous on Stackoverflow.com (a post by David Blevins), I decided to give it a try, but I think I did read that 'asynchronous' (runnable, etc...) tasks are not all that good in web application. So, while you were writing

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
I am considering @Timeout or @Schedule, but I think I want @Timeout (which offers more control), as I didn't like how @Schedule was behaving when I undeploy app on Glassfish, since I shutdown derby server via shutdown hook or @predestroy (forgot how I did it). On Tue, Nov 20, 2012 at 9:51 AM,

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
I want to know why it didn't work either. I am using latest version of TomEE (1.5 SNAPSHOT), Myfaces 2.1.9, and CODI. Didn't work almost 12 hours ago, when I was attempting to use it. Did you all test @Advanced with @FacesConverter(forClass=someClass.class)? That's how I was using it, and bean

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Mark Struberg
Dropping OpenEJB as we are now back to core JSF and related. I don't want to spam them ;) 1.): each container has pros and cons. And each of them needs different workarounds in edge cases :) 2.) I'm not using NetBeans, but it's basically the same scenario. In my project I opted for only

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Mark Struberg
Nope, I'm mostly using it with @JsfPhaseListeners. We also don't have unit tests in CODI for converters. Please try BeanManagerProvider.getInstance().getContextualReference(Yourclass.class); inside the converter if you need it. If it's a NormalScoped bean (Request-, Application-,

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Well, you and others 'sold' me onto TomEE, so here I am. If I can get this migration to TomEE and CDI complete, and my endusers are happy, then more than likely, I will remain TomEE (supporter and user) for life, and will not plan to return to Glassfish. :) In production, my (PrimeFaces 3.4.1)

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
Okay. I've already completed 'hours' of work having a java package filled with JSF (requestscoped) managed beans that 'only' contain @FacesConverter(forClass=someClass.class) for each of my database entity classes; did that last night. I may try to test what you recommended below for injecting

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Thomas Andraschko
Sorry for the off topic, but if you think that your biggest bottleneck is in your data-layer, you should give batoo jpa a try ;) 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Well, you and others 'sold' me onto TomEE, so here I am. If I can get this migration to TomEE and CDI

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Thomas, I'm trying to use batoo-jpa now, but the dependencies include transaction JAR that may be 'ignored' by TomEE container. Everytime I start TomEE (or deploy to app from NetBeans 7.2), the following shows up in my server log: Nov 20, 2012 11:44:43 AM

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Also, my persistence.xml has the following: persistence version=2.0 xmlns=http://java.sun.com/xml/ns/persistence; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/persistence

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Mark, I confirmed and 'opted' to do the same as what you mentioned below, and web app is working fine. I 'moved' beans.xml from WEB-INF to META-INF, and app is running well, and running same as when beans.xml was in WEB-INF. I'll keep beans.xml in META-INF as per your recommendation. *2.) I'm

Re: Migrating to CDI: @Asynchronous

2012-11-20 Thread Howard W. Smith, Jr.
Doh, NetBeans is probably not following the specification, because NetBeans has squiggly line under the bean class name, and has the following as a tip: CDI artifact is found but there is no beans.xml file. So, to avoid this, I need to have beans.xml in WEB-INF instead of META-INF. Per what I

Re: MyFaces 2.1.9 / Glassfish 3.1.2.2: Migrating to CDI Managed Beans

2012-11-20 Thread Gerhard Petracek
hi howard, @ codi (documentation and setup): see [1] (and e.g. [2]) + you can generate a simple demo e.g. with mvn archetype:generate -DarchetypeCatalog= http://people.apache.org/~gpetracek/myfaces/ (it's a subset of mvn archetype:generate -DarchetypeCatalog= http://myfaces.apache.org) and as

Re: MyFaces 2.1.9 / Glassfish 3.1.2.2: Migrating to CDI Managed Beans

2012-11-20 Thread Howard W. Smith, Jr.
Gerhard, Thanks for the response. I've actually progressed quite well with migration to TomEE and CDI. I'm sure you will see my emails here on this mailing list of any/all questions that I have. I want to thank you all for the responses. This actually is the first forum where I get responses

Re: MyFaces 2.1.9 / Glassfish 3.1.2.2: Migrating to CDI Managed Beans

2012-11-20 Thread Gerhard Petracek
yes - i sent this message a while ago from a different box (it looks like the sending process failed initially - so it was (re-)sent a bit too late...) you are welcome! regards, gerhard 2012/11/20 Howard W. Smith, Jr. smithh032...@gmail.com Gerhard, Thanks for the response. I've actually

Re: Can start in debug, but not in release

2012-11-20 Thread Mark Struberg
The Hibernate serialisation issues look weird. What is your exact situation? Do you have an example of your app to share? LieGrue, strub From: Gerhard Petracek gerhard.petra...@gmail.com To: MyFaces Discussion users@myfaces.apache.org Sent: Tuesday,

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Howard W. Smith, Jr.
Mark, Please read/see below. Per your recommendation, Please try *BeanManagerProvider.getInstance().getContextualReference(Yourclass.class); inside the converter if you need it. If it's a NormalScoped bean (Request-, Application-, SessionScoped, CODI scopes) then you only need to do this once

Re: Migrating to CDI: injecting stateless/facade in Converter via facescontext

2012-11-20 Thread Gerhard Petracek
please have a look at [1] and [2]. regards, gerhard [1] https://issues.apache.org/jira/browse/EXTCDI-302 [2] http://people.apache.org/~gpetracek/myfaces/codi/demos/ http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional