WELD-862 and Seam Cron
by Peter Royle
Hi,
I'm aiming to make a release of Seam Cron available within the next two weeks. Currently there is an outstanding issue (https://issues.jboss.org/browse/WELD-862) which prevents Cron from running properly with Weld. I have been able to carry on developing Cron by testing it against OpenWebBeans, but obviously if we are to release a Seam module it should work against Weld.
It would be nice if WELD-862 could be fixed as soon a possible so that all future versions will work well with Cron.
But more importantly I also probably need to do something special in Cron so that it will work with the version of Weld already deployed in JBoss AS and Glassfish, which will contain the bug. The workaround mentioned in the bug report is to deep copy the InvocationContext. I attempted to do this by serialising and unserialising the InvocationContext but couldn't due to UnserializableExceptions. Does anyone have any advice for me about how I might be able to work around this bug to support existing versions of Weld?
Cheers,
Pete R
4 days, 1 hour
About an official CDI tutorial
by Antoine Sabot-Durand
Hi,
There have been discussion on the CDI spec ML about providing an official CDI tutorial (implementation agnostic)[1]. Pete launched the idea of using part of Weld documentation after cleaning it from all Weld references except for the credit.
Before going further I wanted to check with you if were comfortable with this idea and get your input or suggestion on that matter.
Many thanks
[1] http://cdi-specification-mailing-list.26218.n7.nabble.com/Having-an-offic...
Antoine Sabot-Durand
———————————————
Twitter : @antoine_sd
CDI co-spec lead & eco-system development
Agorava tech lead
12 years, 1 month
BeanManager.getReference() VS Context.get()
by Muhammad Bhutto
Hi All,
Can you please explain me this one, I have confusion which one is better.
1.
Bean<MyBean> bean = (Bean<MyBean>)
beanManager.resolve(beanManager.getBeans(MyBean.class));
MyBean= (MyBean) beanManager.getReference(bean, bean.getBeanClass(),
beanManager.createCreationalContext(bean));
2.
Bean<MyBean> bean = (Bean<MyBean>)
beanManager.resolve(beanManager.getBeans(MyBean.class));
MyBean bean = beanManager.getContext(bean.getScope()).get(bean,
beanManager.createCreationalContext(bean));
As i know BeanManager.getReference() always creates a whole new proxy
instance, while the Context.get() reuses an existing proxy instance if
already created before.
Is BeanManager.getReference() is more use full than Context.get() ??
Thanks
Muhammad Asif Bhutto
12 years, 1 month
Issue with weld 2.1.0.Final on OSGI
by Charles Moulliard
Hi,
The following code which is working fine and returns a bean when we run
Junit Test with DeltaSpike does not work when Weld 2.1.0.Final is
deployed on Karaf (OSGI v4.3) with Pax-CDI. Apparently the bean is not
retrieved when we call "beanManager.getBeans("
protected CamelContext getCamelContext(String context, BeanManager
beanManager) {
if (camelContextMap == null) {
Set<Bean<?>> beans =
beanManager.getBeans(CamelContextMap.class, new AnyLiteral()); // return
null
Bean<?> bean = beanManager.resolve(beans); // return null
CreationalContext<?> creationalContext =
beanManager.createCreationalContext(bean);
camelContextMap = (CamelContextMap)
beanManager.getReference(bean, bean.getBeanClass(), creationalContext);
ObjectHelper.notNull(camelContextMap, "Could not resolve
CamelContextMap");
}
return camelContextMap.getCamelContext(context);
}
Question : How does WeldContainer loads the class when we use getBeans
as I suspect that we have a problem with the classloader used ?
Regards,
Charles
12 years, 1 month
Difference behavior between Weld 1 and 2 on EL resolution and InjectionPoint
by Antoine Sabot-Durand
Hi all,
I’m experiencing what I think being a regression and a specification violation.
In my use case I have a producer annotated with @Named injecting an InjectionPoint:
@Produces
@Named
public OAuthSession getCurrentSession(InjectionPoint ip) {…}
When I call #{currentSession} in JSF with Weld 1.x producer is called with InjectionPoint set to null. Now with weld 2.x an exception is thrown by InjectionPointBean.getInjectionPoint() method.
Form what I understand from section 6.5.3. Contextual reference for a bean of the CDI 1.1 spec, the behavior should the Weld 1.X one : returning null instead of throwing an exception. I may be wrong but I can’t find anything in the spec about that.
Thanks for your feedback on that point,
Antoine Sabot-Durand
———————————————
Senior Software engineer
CDI co-spec lead
CDI eco-system development
12 years, 2 months
Re: [weld-dev] Fwd: Issue with weld 2.1.0.Final on OSGI
by Charles Moulliard
Done a comparaison between beanTypes resolved when running a junit test
using weld 2.1.0.Final + DeltaSpike + camel vs Weld 2.1.0.Final + Camel
+ PaxCDI on Karaf and it appears that my class CamelContextBean is not
listed. This is why I get a NPE. So I supect again a classloading issue
when WeldContainer loads the classes of a bundle including also classes
to be imported from another bundle ....
https://gist.github.com/7384007 <https://gist.github.com/7384007>
On 08/11/13 19:15, Charles Moulliard wrote:
> FYI
>
>
> -------- Original Message --------
> Subject: Issue with weld 2.1.0.Final on OSGI
> Date: Fri, 08 Nov 2013 19:11:59 +0100
> From: Charles Moulliard <cmoulliard(a)redhat.com>
> To: weld-dev(a)lists.jboss.org, Antoine Sabot-Durand
> <asabotdu(a)redhat.com>, Jason Porter <jporter(a)redhat.com>, Peter Muir
> <pmuir(a)redhat.com>
>
>
>
> Hi,
>
> The following code which is working fine and returns a bean when we run
> Junit Test with DeltaSpike does not work when Weld 2.1.0.Final is
> deployed on Karaf (OSGI v4.3) with Pax-CDI. Apparently the bean is not
> retrieved when we call "beanManager.getBeans("
>
>
> protected CamelContext getCamelContext(String context, BeanManager
> beanManager) {
> if (camelContextMap == null) {
> Set<Bean<?>> beans =
> beanManager.getBeans(CamelContextMap.class, new AnyLiteral()); // return
> null
> Bean<?> bean = beanManager.resolve(beans); // return null
> CreationalContext<?> creationalContext =
> beanManager.createCreationalContext(bean);
> camelContextMap = (CamelContextMap)
> beanManager.getReference(bean, bean.getBeanClass(), creationalContext);
> ObjectHelper.notNull(camelContextMap, "Could not resolve
> CamelContextMap");
> }
> return camelContextMap.getCamelContext(context);
> }
>
> Question : How does WeldContainer loads the class when we use getBeans
> as I suspect that we have a problem with the classloader used ?
>
> Regards,
>
> Charles
>
>
>
>
12 years, 2 months