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

Moderator: admin

Post Reply
peter.varga
Posts: 5
Joined: Wed Dec 16, 2015 3:16 am
Contact:

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

Post 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.

admin
Site Admin
Posts: 10240
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

adriano.jesus
Posts: 4
Joined: Fri Dec 04, 2015 2:26 pm
Contact:

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

Post 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;
	}
}

admin
Site Admin
Posts: 10240
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

It should but there are cases where application containers do not stick to the specification perfectly.
If you like our products and services, please help us by posting your review here.


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest