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
5 days, 1 hour
Re: [weld-dev] Overridden equals() are ignored on client proxy
by Martin Kouba
Hi Emily,
yes, the spec is clear and for good reasons. This was already discussed
in EG and weld community - see for example WELD-695 [1]. And the
consensus is: "it does not make sense to delegate equals/hashcode to
bean instances for client proxies".
One of the problems is that client proxies may be shared between
multiple injection points (and in Weld they are).
Also in Weld a client proxy is equal to a client proxy for the same bean.
Anyway, it seems it doesn't work on OWB either - see also OWB-458 [2].
Martin
[1]
https://issues.jboss.org/browse/WELD-695?focusedCommentId=12566720&page=c...
[2]
https://issues.apache.org/jira/browse/OWB-458
Dne 3.12.2015 v 00:43 Emily Jiang napsal(a):
> Hi Martin,
>
> For some reason, a proxied bean's equals cannot be called. Are you aware
> of this problem? Although the spec says:
>
> The behavior of all methods declared by java.lang.Object, except for
> toString(), is
> undefined for a client proxy. Portable applications should not invoke
> any method declared by
> java.lang.Object, except for toString(), on a client proxy.
>
> I thought the overridden equals is different from the methods defined by
> Object class and it should be invoked.
>
> Please find attached a very simple test case that shows a .equals()
> method not being invoked on a bean proxied by Weld.
>
>
> In a debugger one can see that GenericBean.equals() is not invoked
> within the Servlet:
>
> protected void doGet(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException {
> PrintWriter pw = response.getWriter();
> pw.println ("Hello");
> if (gb.equals(new GenericBean(10))) { // GenericBean.equals() is
> not invoked; test prints 'fail'
> pw.println("pass");
> } else {
> pw.println ("fail");
> }
> }
>
> The .war contains source and object code. As you can see there's only
> two classes.
>
> Many thanks,
> Emily
> ===========================
> Emily Jiang
> WebSphere Application Server, CDI Development Lead
>
> MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
> Phone: +44 (0)1962 816278 Internal: 246278
>
> Email: emijiang(a)uk.ibm.com
> Lotus Notes: Emily Jiang/UK/IBM@IBMGB
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
--
Martin Kouba
Software Engineer
Red Hat, Czech Republic
10 years, 1 month
Overridden equals() are ignored on client proxy
by Emily Jiang
Hi Martin,
For some reason, a proxied bean's equals cannot be called. Are you aware
of this problem? Although the spec says:
The behavior of all methods declared by java.lang.Object, except for
toString(), is
undefined for a client proxy. Portable applications should not invoke any
method declared by
java.lang.Object, except for toString(), on a client proxy.
I thought the overridden equals is different from the methods defined by
Object class and it should be invoked.
Please find attached a very simple test case that shows a .equals() method
not being invoked on a bean proxied by Weld.
In a debugger one can see that GenericBean.equals() is not invoked within
the Servlet:
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw = response.getWriter();
pw.println ("Hello");
if (gb.equals(new GenericBean(10))) { //
GenericBean.equals() is not invoked; test prints 'fail'
pw.println("pass");
} else {
pw.println ("fail");
}
}
The .war contains source and object code. As you can see there's only two
classes.
Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server, CDI Development Lead
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone: +44 (0)1962 816278 Internal: 246278
Email: emijiang(a)uk.ibm.com
Lotus Notes: Emily Jiang/UK/IBM@IBMGB
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
10 years, 1 month