[jboss-user] [EJB 3.0] - Re: unable to find LoginModule class
JPagera
do-not-reply at jboss.com
Sat Sep 15 08:26:26 EDT 2007
Hi friend
thankx vr muh 4 ur hlp
the problem was im using 2 copy of JBoss and i used the one who dont has my login module jar file
i just forgot to chang th JBOSS_HOME...........
but i faced another exception
i run JSF page the code here run oky and the login succed
...............................
String securityDomain = "JPassivateSecurityDomain";
CallbackHandler callbackHandler =
new JPageraCallbackHandler("name","pass");
LoginContext lc =
new LoginContext( securityDomain,
callbackHandler );
lc.login();
......................................................
but when i tried to lookup Session it didnt get me exception
like that
...................................................
Properties pro = new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
pro.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
pro.put(Context.PROVIDER_URL,"jnp://jpagera:1099");
pro.put(Context.SECURITY_PRINCIPAL,"name");
pro.put(Context.SECURITY_CREDENTIALS,"pass");
try {
final Context context = new InitialContext(pro);
session = context.lookup(sessionName);
} catch (Exception ex) {
ex.printStackTrace();
}
......................................................
but when im tryin to use the Session it gave these exceptions
session.callMethod();
Exception ...
javax.ejb.EJBAccessException: Authentication failure
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSe
curityException(Ejb3AuthenticationInterceptor.java:70)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
ationInterceptor.java:70)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3Auth
enticationInterceptor.java:102)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
ptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
usInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo
ntainer.java:263)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.
java:58)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP
roxy.java:102)
at $Proxy100.findAllUserTab(Unknown Source)
...........................................................
i dont know where is the problem did my lookedup correctly ???
in OC4J
when using Custom login module u should gave the RMI lookup specefic ROLE
that every user lookingup any Session ( by using my custom login module ) he must has that Role ............
its like that ..................
<grant>
| <grantee>
| <principals>
| <principal>
| <class>com.jpagera.login.JPageraPrincipal</class>
| <name>JPageraAdminRole</name>
| </principal>
| </principals>
| </grantee>
| <permissions>
| <permission>
| <class>com.evermind.server.rmi.RMIPermission</class>
| <name>login</name>
| </permission>
| </permissions>
| </grant>
In %OC4J_HOME%\j2ee\home\config\system-jazn-data.xml
all my user must has this ROLE ( JPageraAdminRole )
it just give him the permission to using RMI to lookup Sessions
....................................
is there anything like that in JBoss ..
( should i gave my Users some kind of role to enable them to lookingup an Session )
and Tnk u vy muh 4 hlp
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084731#4084731
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084731
More information about the jboss-user
mailing list