[Security & JAAS/JBoss] - JAAS authentication over several threads
by taze1701
Hello everybody!
I have got a question concerning sharing a JAAS login over more than one thread. I am using JBoss Security together with Flex Livecycle Data Service. This dataservice uses a Tomcat Valve to authenticate against the realm. The authentication works fine and I can call secured EJBs from within the dataservice.
But: This dataservice creates a pool of threads within JBoss. If another thread is used not the one where the authentication has been performed in the authentication data is lost and I get:
javax.ejb.EJBAccessException: Authorization failure
The difference between the threads is that the SecurityAssocation credential is not set in the other threads.
For beeing able to call the EJBs also within the other threads I have tried to store the Subject which I receive during the Authentication process within the first thread within the Flex Session and use this subject for the EJB call by using Subject.doAs(...). But I get the same exception.
How can I use the authenticated Subject to call a secured EJB even if the authentication has not been performed within the same thread? I do not want to store the users password and call SecurityAssociation.setCredential() in every thread. Can anybody help me?
Thanks in advance,
Taze
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159842#4159842
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159842
17 years, 10 months
[JCA/JBoss] - Connection handle is not associated with the Managed Connect
by ramkumar.k
Hi All,
I am running my batch application in jboss 4.2.2. I am getting the below exception frequently though not every time i run the batch job. I am using spring 2.5.4 and spring-batch 1.0.1. My database is Mysql 5.1.23.
anonymous wrote : org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL [SELECT COUNT(*) FROM BATCH_JOB_EXECUTION WHERE JOB_EXECUTION_ID = ?]; SQL state [null]; error code [0]; Connection handle is not currently associated with a ManagedConnection; nested exception is java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection
I am using HibernateTransactionManager (Hibernate 3.2) in my application.
This is my mysql-ds.xml
<local-tx-datasource>
|
| <jndi-name>DarkDS</jndi-name>
| <connection-url>jdbc:mysql://10.52.91.72/dh_r5</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>ou_user</user-name>
| <password>chi12#$</password>
|
| <new-connection-sql>select 1 from dual</new-connection-sql>
| <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
| <background-validation>true</background-validation>
|
| <min-pool-size>50</min-pool-size>
|
| <max-pool-size>50</max-pool-size>
| <prepared-statement-cache-size>500</prepared-statement-cache-size>
|
| <idle-timeout-minutes>5</idle-timeout-minutes>
| <exception-sorter-class-name> com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
| <valid-connection-checker-class-name> com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker </valid-connection-checker-class-name>
| <connection-property name="useOldAliasMetadataBehavior">true</connection-property>
|
| </local-tx-datasource>
|
Do i need to change something in my ds.xml ? I checked the jboss documentation but i couldn't find any info on this issue
Any fixes?
Please let me know if you need more information from me. I badly need a fix for this.
thanks in advance,
Ram
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159838#4159838
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159838
17 years, 10 months