Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.359 :

Posted: Thu Feb 02, 2017 8:28 am
by peter.varga
"So this option is effectively same as the first one." It is not true. ITeller can not declare a method with name localBeanMethod. Otherwise you would get a compile error due to the reduced method visibility in the bean code.

Re: About Question enthuware.oce-ejbd.v6.2.359 :

Posted: Thu Feb 02, 2017 12:20 pm
by admin
What it is trying to say is "All methods defined in this bean" includes the methods defined in ITeller interface because the bean implements ITeller interface. So there is no difference between the two options with respect to their correctness. Both the options are incorrect for the same reason.

Re: About Question enthuware.oce-ejbd.v6.2.359 :

Posted: Thu Jun 15, 2017 6:33 pm
by adriano.jesus
About "The throws clause of a bean class method exposed through the no-interface view must not include the java.rmi.RemoteException." part explanation:

I deployed a no-interface session bean view with an exposed method declaring a RemoteException throws clause.

I deployed this bean without any error. I even called it from a client code.
I deployed the ejb jar file on WildFly 10 Server and I used the EJB 3.1 server implementation.

Shouldn't it cause an error?

Code: Select all

import java.rmi.RemoteException;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;

@Stateless(mappedName="salutationBean")
@LocalBean
public class Salutation {

	public String getFormalSalutation(String name) throws RemoteException {
		return "Dear " + name;
	}
	
	public String getInformalSalutation(String name) {
		return "Hi " + name;
	}
}

Re: About Question enthuware.oce-ejbd.v6.2.359 :

Posted: Thu Jun 15, 2017 9:46 pm
by admin
It should but there are cases where application containers do not stick to the specification perfectly.

Re: About Question enthuware.oce-ejbd.v6.2.359 :

Posted: Fri Jun 16, 2017 4:46 pm
by adriano.jesus
Thanks. :)