[Security & JAAS/JBoss] - Re: Latest JAAS Tutorial for Database communication
by changemylife
Hi all!
Today, all things are ok (they worked!). My project is EJB3.0. Inside folder \server\default\conf, I add some informations:
<application-policy name = "DB-Domain">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
| flag = "required">
| <module-option name = "unauthenticatedIdentity">guest</module-option>
| <module-option name = "dsJndiName">java:/DefaultDS</module-option>
| <module-option name = "principalsQuery">SELECT PASSWD FROM USERS WHERE USERID=?</module-option>
| <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM ROLES WHERE USERID=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
My jboss.xml :
<jboss>
| <security-domain>DB-Domain</security-domain>
| <enterprise-beans>
| <session>
| <ejb-name>ClientActionBean</ejb-name>
| <resource-ref>
| <res-ref-name>jdbc/DefaultDS</res-ref-name>
| <jndi-name>java:/DefaultDS</jndi-name>
| </resource-ref>
| </session>
| </enterprise-beans>
| </jboss>
and ejb-jar.xml:
<enterprise-beans>
| <session>
| <ejb-name>ClientActionBean</ejb-name>
| <resource-ref>
| <res-ref-name>jdbc/DefaultDS</res-ref-name>
| <res-type>javax.sql.DataSource</res-type>
| <res-auth>Container</res-auth>
| </resource-ref>
| </session>
| </enterprise-beans>
| <assembly-descriptor>
| <Security-role>
| <role-name>doctor</role-name>
| </Security-role>
| <Security-role>
| <role-name>nurse</role-name>
| </Security-role>
| <method-permission>
| <role-name>doctor</role-name>
| <method>
| <ejb-name>ClientActionBean</ejb-name>
| <method-name>getCallInfo</method-name>
| </method>
| ....
I use Eclipse to write client app, bean and package my bean enclose two file jboss.xml and ejb-jar.xml (inside META-INF). Restart server, and run client app!
Note: I installed Jboss server and mySQL on the machine 1(hostname:abc), and on the machine 2 (hostname:xxx). All things ok!
Hope this helps!!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024535#4024535
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024535
17Â years, 10Â months
[Remoting] - Re: Connection between servers through JNDI?
by ron.sigalï¼ jboss.com
Hi,
JBREM-534 was specific to multiplex, and it looks like the changes that led to the closing of JBREM-534 were included in the 2.0.0 CR1 and GA releases. I think, therefore, that you are seeing some other phenomenon.
I don't quite understand, yet, what you seeing. First of all, let me describe the difference between a "clean" detection and a "non-clean" detection (I don't think we have an official name for the latter). In the latter case, the detector believes whatever information it gets from the JNDI server and uses it to update its local information. In the case of a clean detection, it actually tried to ping each server to see for itself if the server is alive or not. The value of the Clean Detection Number indicates how many times to do a "non-clean" detection before doing a clean detection, so setting it to zero is not terrible; it just causes some additional network traffic, but gets you a more reliable picture of the state of the servers in the domain.
Anyway, it would be natural for the first clean detection after a server goes down to result in a failed attempt to contact the defunct server. However, it should also be the case that when the detector discovers a new server and informs your client of the new server's InvokerLocator, your client should be able to contact the new server. Are you saying that the latter is not happening? If so (or if not), could you elaborate on what you are trying to do and what is and is not happening? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024534#4024534
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024534
17Â years, 10Â months