Hello,
I've deployed javaeetutorial5/examples/ejb/cart-secure example in NB6.1 final with bundled SJSAS 9.1_02 (build b04-fcs).
The main method in app-client is like this
try {
cartBean.initialize("Duke d'Url", "123");
[...]
System.exit(0);
} catch (BookException ex) {
System.err.println("Caught a BookException: " + ex.getMessage());
System.exit(1);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
System.exit(1);
}
When the auth is success, the tutorial say that this should be the output:
----------------------8<-----8<---------------
run:
[echo] Running appclient for Cart.
appclient-command-common:
[exec] Infinite Jest
[exec] Bel Canto
[exec] Kafka on the Shore
[exec] Caught a BookException: "Gravitys Rainbow" not in cart.
----------------------8<-----8<---------------
that is what I actually get. But when auth fails, the tutorial say that the client will display the following error:
----------------------8<-----8<---------------
run:
[echo] Running appclient for Cart.
appclient-command-common:
[exec] Caught an unexpected exception!
[exec] javax.ejb.EJBException: nested exception is: java.rmi.AccessException:
CORBA NO_PERMISSION 9998 Maybe; nested exception is:
[exec] org.omg.CORBA.NO_PERMISSION:
----------BEGIN server-side stack trace----------
[exec] org.omg.CORBA.NO_PERMISSION: vmcid: 0x2000 minor code: 1806
----------------------8<-----8<---------------
and instead of that I'm getting following output:
----------------------8<-----8<---------------
WARNING: ACC003: Application threw an exception.
com.sun.enterprise.InjectionException: Exception attempting to inject Resolved Ejb-Ref cart.secure.client.CartClient/cartBean@jndi: jacc_mr_CartBean - > CartBean into class cart.secure.client.CartClient
at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:387)
at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:206)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionManagerImpl.java:144)
at com.sun.enterprise.util.InjectionManagerImpl.injectClass(InjectionManagerImpl.java:136)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:420)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Caused by: javax.naming.NamingException: ejb ref resolution error for remote business interfacecart.secure.ejb.Cart [Root exception is java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is:
org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace----------
org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:576)
[...]
----------------------8<-----8<---------------
So it seems that the ACC isn't actually throwing the exception, it simply prints a warning message in System.err and exits the app.
Is it normal? How can I get the tutorial expected behaviour?
Thanks
Mario