Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » OHF » POJO error from initiating user not set
POJO error from initiating user not set [message #35954] Thu, 25 October 2007 20:18 Go to next message
Jesse Pangburn is currently offline Jesse Pangburn
Messages: 166
Registered: July 2009
Senior Member
Hi,
I am playing with the POJO usage from classes that I compiled from CVS a
week or so ago and having a problem. I'm trying to create an XDS.a
consumer, but the API is different now than shown in the XDS Document
Consumer PDF. In there, and in the javadoc from earlier, it shows that
when the Consumer class sends a query that you pass in the username you
want to query with.

If I recall a comment from you folks earlier, this user is necessary for
the audit logging. This matches with the exception I'm getting:
org.eclipse.ohf.ihe.atna.audit.client.ATNAAuditClientExcepti on: The
initiating user is not set.

So I assume there is some other way to set the initiating user. But I
don't see any method that looks right in the Consumer class for XDS, or in
the FindDocumentsQuery class that I'm passing to the Consumer's query
method. These are really the only two classes that seem to be directly
involved in the query. I was thinking that maybe it had been moved to
some static member in some other class, but that doesn't really make sense
because with lots of transactions going on at any given time from lots of
users, it would be just pure luck if threads didn't step on each other and
send the wrong user constantly.

So... any one know how I set this user, and if so, is it done in a way
that's thread safe?

thanks,
Jesse
Re: POJO error from initiating user not set [message #36024 is a reply to message #35954] Thu, 25 October 2007 21:25 Go to previous messageGo to next message
Jesse Pangburn is currently offline Jesse Pangburn
Messages: 166
Registered: July 2009
Senior Member
Hi All,
I forgot to mention in the previous email, the problem is the current API
doesn't have username in the parameter like the previous API did.

It occurred to me after I posted this, that I could read the bridge source
code and figure out how the bridge uses the POJO. I've done this, the
following are my observations about how to perform this query (for anyone
else who hits this problem):

- There is a class called AtnaAgentFactory with a method "getAtnaAgent()".
This class uses a ThreadLocal scheme to provide an AtnaAgent to each
thread. This is how you can set a "global" variable and still not have
concurrency issues- it's only global to your thread.
- The class AtnaAgent has some relevant methods:
- setDoAudit which lets you turn on/off auditing
- setAuditRepository which lets you provide the URI to your audit
service (syslog daemon probably)
- setInitiatingUser which lets you set the user who's initiating the
transaction so that user can be logged etc.
- This AtnaAgent stuff needs to be done before trying to send the query
from the Consumer object.

I haven't tried this yet, but I'm sure it'll work. I just wanted to post
this ASAP so no one would spend their valuable time trying to answer this
question. Of course, if anyone has anything to add (corrections, flat out
denial, etc) :-) that'd be great!

thanks,
Jesse


Jesse Pangburn wrote:

> Hi,
> I am playing with the POJO usage from classes that I compiled from CVS a
> week or so ago and having a problem. I'm trying to create an XDS.a
> consumer, but the API is different now than shown in the XDS Document
> Consumer PDF. In there, and in the javadoc from earlier, it shows that
> when the Consumer class sends a query that you pass in the username you
> want to query with.

> If I recall a comment from you folks earlier, this user is necessary for
> the audit logging. This matches with the exception I'm getting:
> org.eclipse.ohf.ihe.atna.audit.client.ATNAAuditClientExcepti on: The
> initiating user is not set.

> So I assume there is some other way to set the initiating user. But I
> don't see any method that looks right in the Consumer class for XDS, or in
> the FindDocumentsQuery class that I'm passing to the Consumer's query
> method. These are really the only two classes that seem to be directly
> involved in the query. I was thinking that maybe it had been moved to
> some static member in some other class, but that doesn't really make sense
> because with lots of transactions going on at any given time from lots of
> users, it would be just pure luck if threads didn't step on each other and
> send the wrong user constantly.

> So... any one know how I set this user, and if so, is it done in a way
> that's thread safe?

> thanks,
> Jesse
Re: POJO error from initiating user not set [message #36058 is a reply to message #36024] Thu, 25 October 2007 22:07 Go to previous message
No real name is currently offline No real name
Messages: 292
Registered: July 2009
Senior Member
Hi Jesse,

This is correct. Nice catch for yourself:-) Matt included this detail in
the summary (binaries announcement) he sent out yesterday to the
newsgroup. There he presents the "API delta". Review if you missed this.
The .pdf documentation will try to catch up to where the code is as soon
as we can.

Another source of information are the JUNITS. We have one for each MESA
test we know about (XDS.b yet to become available). The JUNITS can be
found in src_tests/<plugnin>.test.mesa (in general) for the POJO
components. I have aligned my tests in this package with the way Sondra
does them in PIX/PDQ. We have a TestConfiguration.java file that
contains the JUNIT test parameters. I additionally have a base test
class (SourceMesaTest.java and ConsumerMesaTest.java, respectively) ..
that document this same audit set up you have outlined below.

When XDS.b tests become available ... I'll crank out something simmilar
for these tests. Meanwhile ... Matt has put together the following page:
http://wiki.eclipse.org/OHF_Using_XDS.b

Hope this helps ... and keep it up with the excellent questions!
- Sarah

Jesse Pangburn wrote:
> Hi All,
> I forgot to mention in the previous email, the problem is the current
> API doesn't have username in the parameter like the previous API did.
>
> It occurred to me after I posted this, that I could read the bridge
> source code and figure out how the bridge uses the POJO. I've done
> this, the following are my observations about how to perform this query
> (for anyone else who hits this problem):
>
> - There is a class called AtnaAgentFactory with a method
> "getAtnaAgent()". This class uses a ThreadLocal scheme to provide an
> AtnaAgent to each thread. This is how you can set a "global" variable
> and still not have concurrency issues- it's only global to your thread.
> - The class AtnaAgent has some relevant methods:
> - setDoAudit which lets you turn on/off auditing
> - setAuditRepository which lets you provide the URI to your audit
> service (syslog daemon probably)
> - setInitiatingUser which lets you set the user who's initiating the
> transaction so that user can be logged etc.
> - This AtnaAgent stuff needs to be done before trying to send the query
> from the Consumer object.
>
> I haven't tried this yet, but I'm sure it'll work. I just wanted to
> post this ASAP so no one would spend their valuable time trying to
> answer this question. Of course, if anyone has anything to add
> (corrections, flat out denial, etc) :-) that'd be great!
>
> thanks,
> Jesse
>
>
> Jesse Pangburn wrote:
>
>> Hi,
>> I am playing with the POJO usage from classes that I compiled from CVS
>> a week or so ago and having a problem. I'm trying to create an XDS.a
>> consumer, but the API is different now than shown in the XDS Document
>> Consumer PDF. In there, and in the javadoc from earlier, it shows
>> that when the Consumer class sends a query that you pass in the
>> username you want to query with.
>
>
>> If I recall a comment from you folks earlier, this user is necessary
>> for the audit logging. This matches with the exception I'm getting:
>> org.eclipse.ohf.ihe.atna.audit.client.ATNAAuditClientExcepti on: The
>> initiating user is not set.
>
>
>> So I assume there is some other way to set the initiating user. But I
>> don't see any method that looks right in the Consumer class for XDS,
>> or in the FindDocumentsQuery class that I'm passing to the Consumer's
>> query method. These are really the only two classes that seem to be
>> directly involved in the query. I was thinking that maybe it had been
>> moved to some static member in some other class, but that doesn't
>> really make sense because with lots of transactions going on at any
>> given time from lots of users, it would be just pure luck if threads
>> didn't step on each other and send the wrong user constantly.
>
>
>> So... any one know how I set this user, and if so, is it done in a way
>> that's thread safe?
>
>
>> thanks,
>> Jesse
>
>
>
>
Re: POJO error from initiating user not set [message #582677 is a reply to message #35954] Thu, 25 October 2007 21:25 Go to previous message
Jesse Pangburn is currently offline Jesse Pangburn
Messages: 166
Registered: July 2009
Senior Member
Hi All,
I forgot to mention in the previous email, the problem is the current API
doesn't have username in the parameter like the previous API did.

It occurred to me after I posted this, that I could read the bridge source
code and figure out how the bridge uses the POJO. I've done this, the
following are my observations about how to perform this query (for anyone
else who hits this problem):

- There is a class called AtnaAgentFactory with a method "getAtnaAgent()".
This class uses a ThreadLocal scheme to provide an AtnaAgent to each
thread. This is how you can set a "global" variable and still not have
concurrency issues- it's only global to your thread.
- The class AtnaAgent has some relevant methods:
- setDoAudit which lets you turn on/off auditing
- setAuditRepository which lets you provide the URI to your audit
service (syslog daemon probably)
- setInitiatingUser which lets you set the user who's initiating the
transaction so that user can be logged etc.
- This AtnaAgent stuff needs to be done before trying to send the query
from the Consumer object.

I haven't tried this yet, but I'm sure it'll work. I just wanted to post
this ASAP so no one would spend their valuable time trying to answer this
question. Of course, if anyone has anything to add (corrections, flat out
denial, etc) :-) that'd be great!

thanks,
Jesse


Jesse Pangburn wrote:

> Hi,
> I am playing with the POJO usage from classes that I compiled from CVS a
> week or so ago and having a problem. I'm trying to create an XDS.a
> consumer, but the API is different now than shown in the XDS Document
> Consumer PDF. In there, and in the javadoc from earlier, it shows that
> when the Consumer class sends a query that you pass in the username you
> want to query with.

> If I recall a comment from you folks earlier, this user is necessary for
> the audit logging. This matches with the exception I'm getting:
> org.eclipse.ohf.ihe.atna.audit.client.ATNAAuditClientExcepti on: The
> initiating user is not set.

> So I assume there is some other way to set the initiating user. But I
> don't see any method that looks right in the Consumer class for XDS, or in
> the FindDocumentsQuery class that I'm passing to the Consumer's query
> method. These are really the only two classes that seem to be directly
> involved in the query. I was thinking that maybe it had been moved to
> some static member in some other class, but that doesn't really make sense
> because with lots of transactions going on at any given time from lots of
> users, it would be just pure luck if threads didn't step on each other and
> send the wrong user constantly.

> So... any one know how I set this user, and if so, is it done in a way
> that's thread safe?

> thanks,
> Jesse
Re: POJO error from initiating user not set [message #582681 is a reply to message #36024] Thu, 25 October 2007 22:07 Go to previous message
No real name is currently offline No real name
Messages: 292
Registered: July 2009
Senior Member
Hi Jesse,

This is correct. Nice catch for yourself:-) Matt included this detail in
the summary (binaries announcement) he sent out yesterday to the
newsgroup. There he presents the "API delta". Review if you missed this.
The .pdf documentation will try to catch up to where the code is as soon
as we can.

Another source of information are the JUNITS. We have one for each MESA
test we know about (XDS.b yet to become available). The JUNITS can be
found in src_tests/<plugnin>.test.mesa (in general) for the POJO
components. I have aligned my tests in this package with the way Sondra
does them in PIX/PDQ. We have a TestConfiguration.java file that
contains the JUNIT test parameters. I additionally have a base test
class (SourceMesaTest.java and ConsumerMesaTest.java, respectively) ..
that document this same audit set up you have outlined below.

When XDS.b tests become available ... I'll crank out something simmilar
for these tests. Meanwhile ... Matt has put together the following page:
http://wiki.eclipse.org/OHF_Using_XDS.b

Hope this helps ... and keep it up with the excellent questions!
- Sarah

Jesse Pangburn wrote:
> Hi All,
> I forgot to mention in the previous email, the problem is the current
> API doesn't have username in the parameter like the previous API did.
>
> It occurred to me after I posted this, that I could read the bridge
> source code and figure out how the bridge uses the POJO. I've done
> this, the following are my observations about how to perform this query
> (for anyone else who hits this problem):
>
> - There is a class called AtnaAgentFactory with a method
> "getAtnaAgent()". This class uses a ThreadLocal scheme to provide an
> AtnaAgent to each thread. This is how you can set a "global" variable
> and still not have concurrency issues- it's only global to your thread.
> - The class AtnaAgent has some relevant methods:
> - setDoAudit which lets you turn on/off auditing
> - setAuditRepository which lets you provide the URI to your audit
> service (syslog daemon probably)
> - setInitiatingUser which lets you set the user who's initiating the
> transaction so that user can be logged etc.
> - This AtnaAgent stuff needs to be done before trying to send the query
> from the Consumer object.
>
> I haven't tried this yet, but I'm sure it'll work. I just wanted to
> post this ASAP so no one would spend their valuable time trying to
> answer this question. Of course, if anyone has anything to add
> (corrections, flat out denial, etc) :-) that'd be great!
>
> thanks,
> Jesse
>
>
> Jesse Pangburn wrote:
>
>> Hi,
>> I am playing with the POJO usage from classes that I compiled from CVS
>> a week or so ago and having a problem. I'm trying to create an XDS.a
>> consumer, but the API is different now than shown in the XDS Document
>> Consumer PDF. In there, and in the javadoc from earlier, it shows
>> that when the Consumer class sends a query that you pass in the
>> username you want to query with.
>
>
>> If I recall a comment from you folks earlier, this user is necessary
>> for the audit logging. This matches with the exception I'm getting:
>> org.eclipse.ohf.ihe.atna.audit.client.ATNAAuditClientExcepti on: The
>> initiating user is not set.
>
>
>> So I assume there is some other way to set the initiating user. But I
>> don't see any method that looks right in the Consumer class for XDS,
>> or in the FindDocumentsQuery class that I'm passing to the Consumer's
>> query method. These are really the only two classes that seem to be
>> directly involved in the query. I was thinking that maybe it had been
>> moved to some static member in some other class, but that doesn't
>> really make sense because with lots of transactions going on at any
>> given time from lots of users, it would be just pure luck if threads
>> didn't step on each other and send the wrong user constantly.
>
>
>> So... any one know how I set this user, and if so, is it done in a way
>> that's thread safe?
>
>
>> thanks,
>> Jesse
>
>
>
>
Previous Topic:All PIX consumer tests are failing
Next Topic:Flyspray PDQ bug report 158 closed - fixed in MESA version 11.7.0
Goto Forum:
  


Current Time: Tue Sep 23 06:19:46 GMT 2014

Powered by FUDForum. Page generated in 0.01802 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software