Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servicelocator for EJB (with security constraints)  RSS feed

 
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

We have a EJB (ear) for which we have defined the security constriants in the DD. We use weblogic 10.x.

We have a servicelocator class which caches the EJBHome object to avoid JNDI lookups.

It works great if we dont have any security constraints in the DD.However, the moment we add the security constraint, it stops work with servicelocator.

Has anyone observed similar problems? Any pointers would be of great help.

~Rajesh.B
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So presumably your client is trying to call methods with method permissions the calling principal does not have? What is the error message you see?
 
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works fine for methods. Permissions are given.

Following scenario works

1. Do JDNI lookup
2. Get EJBHome
3. Get EJBObject
4. Invoke methods.

Problem with following.
1. Do JNDI lookup and cache EJBHome.
2. Get EJBObject from cached EJBHome (i.e, EJBHome.create())
3. Step 2 itself fails saying authentication failed or so.

Looks like its loosing the security principal details. But this problem does not arise when we do not have security constraints.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What container are you using? What is the text of the exception message you see? I've seen similar behaviour with JBoss 4.2.2 whereby the principal is not propagated to the client.
 
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using weblogic 10.x. I will capture the stacktrace and paste it as soon as possible.

~Rajesh.B
 
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Were you able to solve that issue?. It would be great if you could throw some light on that.

~Rajesh.B
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rajesh bala:
Were you able to solve that issue?. It would be great if you could throw some light on that.

~Rajesh.B


No - it looks like a bug in that build of JBoss (we are just waiting for their support staff to confirm). But if you are using weblogic its not that.
 
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the quick replies.

Is it a publicly available bug in JBoss?. If so, could you please point to the url?

~Rajesh.B
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!