[JCA/JBoss] - Re: TransactionLocal: How to use it?
by adrianï¼ jboss.org
TransactionLocal works the same way as ThreadLocal,
just replace the notion of thread with transaction.
Like thread local, if you want to pass references under the wire of an interface
you need a singleton (or some way to get the same instance).
| public MySingleton
| {
| public static final TransactionLocal singleton = new TransactionLocal();
| }
|
Such singletons have a number of problems:
1) Unless you implement something a lot less naive than the above
the information in the singleton is public and so could cause security issues
if the information is sensistive
or just broken behaviour if somebody modifies the data unexpectedly/maliciously.
2) They lead to breakage of the type system (ClassCastException)
in more complicated classloading schemes when not deployed correctly.
3) Singletons that store state usually lead to memory leaks unless handled correctly.
At least with the TransactionLocal, the data is "tidied up" when the tranasction ends.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023837#4023837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023837
17Â years, 2Â months
[Security & JAAS/JBoss] - Help needed please, Authentication info propagation don't wo
by lujop
What I try to do is:
Programatically establish an indentity in a servlet and propagate it to be disposable to all the web applications on the same realm.
(I have to do it programatically for: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=102853
The code of my servlet is:
| try {
| UsernamePasswordHandler handler = new UsernamePasswordHandler("XXX", "XXX");
| LoginContext lc = new LoginContext("MyDomain", handler);
| lc.login();
|
| }catch(Exception e ) {
| e.printStackTrace();
| }
|
|
And the log that I get is:
| DEBUG (MyLoginModule.java.java:98) - login()
| INFO (MyLoginModule.java.java:151) - User XXX ok with role YYY
| TRACE (org.jboss.security.ClientLoginModule.ClientLoginModule.java:103) - Security domain: MyDomain
| TRACE (org.jboss.security.ClientLoginModule.ClientLoginModule.java:121) - Enabling restore-login-identity mode
| TRACE (org.jboss.security.ClientLoginModule.ClientLoginModule.java:130) - Enabling useFirstPass mode
| TRACE (org.jboss.security.ClientLoginModule.ClientLoginModule.java:139) - Begin login
| TRACE (org.jboss.security.ClientLoginModule.ClientLoginModule.java:223) - commit, subject=Asunto:
| Principal: XXX
| Principal: Roles(members:YYY)
|
| TRACE (org.jboss.security.SecurityAssociation.SecurityAssociation.java:460) - pushSubjectContext, subject=Asunto:
| Principal: XXX
| Principal: Roles(members:YYY)
|
|
This is the debug code I get just after lc.login() in my servlet.
The problem is that then when the servlet ends I had this stacktrace:
| ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 252
| ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
| ReplyHeaderFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 96
| ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 202
| ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
| StandardWrapperValve.invoke(Request, Response) line: 213
| StandardContextValve.invoke(Request, Response) line: 178
| SecurityAssociationValve.invoke(Request, Response) line: 175
| BasicAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 432
| JaccContextValve.invoke(Request, Response) line: 74
| StandardHostValve.invoke(Request, Response) line: 126
| ErrorReportValve.invoke(Request, Response) line: 105
| CachedConnectionValve.invoke(Request, Response) line: 156
| SingleSignOn.invoke(Request, Response) line: 392
| StandardEngineValve.invoke(Request, Response) line: 107
| CoyoteAdapter.service(Request, Response) line: 148
| Http11Processor.process(InputStream, OutputStream) line: 869
| Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection, Object[]) line: 664
| PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527
| MasterSlaveWorkerThread.run() line: 112
| ThreadWithAttributes(Thread).run() line: 595
|
And when the arrives at BasicAuthenticator I get:
| popRunAsIdentity, runAs=null
|
| and then:
|
| 2007-02-28 17:43:17,688 TRACE (org.jboss.security.SecurityAssociation.SecurityAssociation.java:555) - clear, server=true
It looks as if the credential are deleted, aren't they?
The login-config.xml has:
| <application-policy name="MyDomain">
| <authentication>
| <login-module code="MyModule"
| flag = "required">
| <module-option name="password-stacking">useFirstPass</module-option>
| </login-module>
|
| <login-module code="org.jboss.security.ClientLoginModule" flag="required">
| <module-option name="password-stacking">useFirstPass</module-option>
| <module-option name="restore-login-identity">false</module-option>
| </login-module>
|
| </authentication>
| </application-policy>
|
|
Please, please, please,...... someone can help in this nigthmare?¿
PD: All is to try to solve the problem I also explain in :
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023825#4023825
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023825
17Â years, 2Â months
[JBoss Seam] - JBPM Context variable lifecycle
by ngeadah
I use the Seam annotations to launch a JBPM process and outject to the BUSINESS_PROCESS context. Everything works great but I find that the outjected variable gets "removed" from JBPM at some indeterminate later time. For example, after the process has been launched (and is in a wait-state), the following code which retrieves the task instances for the current actor and tries to retrieve the variable initially outjected:
| List<TaskInstance> tasks = context.getTaskMgmtSession().findTaskInstances(actorId);
| for (TaskInstance task : tasks)
| {
| Object variable = task.getVariable("NAME USED TO OUTJECT");
|
returns "variable" correctly as long I this code runs shortly after the process is launched. After a little while, "variable" is null. Is there something about business process variable lifecycle I don't understand?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023823#4023823
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023823
17Â years, 2Â months
[JCA/JBoss] - Re: Shared Jar files in RAR and WAR
by weston.priceï¼ jboss.com
To do this you will need to change the default settings for Tomcat to use the JBossWebLoader by default and to use Parent2Child delegation. Since you didn not post what version of JBoss you are using I will assume JBoss 4.x. In your deploy directory you will see a directory
jbossweb-tomcat55.sar
Navigate to the META-INF directory and locate the jboss-service.xml file. In this file you will see two attributes
false
false
set both of these to true. This will force the WAR deployment to not use an isolated classloader.
Note, I don't really recommend doing this as it will effect every single WAR deployment in JBoss and pretty much violates the whole point of the WAR classloader to begin with. If you use Ant or some other automated build process the real solution would be to simply package your archives for your appropriate platform. Since this is simply a matter or excluding/including files, this would be the better approach.
Good luck.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023818#4023818
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023818
17Â years, 2Â months