This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes not able to access remote EJB on JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "not able to access remote EJB on JBOSS" Watch "not able to access remote EJB on JBOSS" New topic
Author

not able to access remote EJB on JBOSS

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Hello all,

I have got an SLSB EJBs (in a jar) packaged in an EAR deployed at a remote JBOSS server.

When I try to access it from my servlet deployed in my local JBOSS server using :




it gives the error :



What is wrong in this?

Am I using some wrong credentials so it's a security exception or am I doing something absolutely wrong??

I guess it is able to look up the EJB as we can see the 'JNDI looked up' output but while creating the Remote object, it is not able to???

Any insights would be appreciated...

Thanks.


Niraj Jha
Ranch Hand

Joined: Feb 20, 2013
Posts: 63

Could you please verify if the user have roles?
Because of this you are not able to instantiate remote object.
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Thanks for the quick response, Neeraj.


This is a custom product that keeps its users and roles in a database

I can see the roles defined as username itself.

but there's another table userHasBusinessRoles which is not showing any rows for the given username.

Is that causing the issue...

Also, if I can lookup the EJB, shouldn't I be able to create the Remote??? Is it possible to differentiate rights of a user at this level?? I mean, 'you can lookup the HomeObject but you cannot create the Remote'??



James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Could you post the code for the AccountSession class/interface please?
Niraj Jha
Ranch Hand

Joined: Feb 20, 2013
Posts: 63

Although It should work but what security implementation is there I am not sure about it.
If it is possible then check the security implementation.
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
don't have the code for the AccountSession class or any interface...
It's an out-of-box product which needs to be accessed... (apologies if I mislead you with 'custom product' in my first post)

Niraj Jha
Ranch Hand

Joined: Feb 20, 2013
Posts: 63

Aayush Singhal wrote:
but there's another table userHasBusinessRoles which is not showing any rows for the given username.

Is that causing the issue...


This might be the issue check the same table where user have the access and use same credentials.
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Thanks Neeraj... Yes . that might be one issue... There is no user with the 'username' in that row. I'll try to insert something in this table...

Also there are 2 tables like : ROLE and ROLE_MEMBER.

The table ROLE has my specific username.

but the table ROLE_MEMBER has nothing for my userName.

Do we need to have ROLE_MEMBER for any specific ROLE or can we directly use the ROLE itself???


Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
I have inserted a value in userHasBusinessRoles table for my username. (copied the same value as for some admin-looking username )

But I am still getting the same error. I guess this ROLE and ROLE_MEMBER has to do something with this...

EDIT1 : See this line from the error : Principal: CallerPrincipal(members:com.convergys.security.authentication.realm.jboss30.CAAFJBoss30User@8314748c)
Principal: Roles(members)
Niraj Jha
Ranch Hand

Joined: Feb 20, 2013
Posts: 63

Why don't you go for other credential ?
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
The password is encrypted for them all. I only have the password for this username...

Anyways, I am leaving for the day now... Will look it up again on Monday.

Thanks a ton for your help

good night.

have a good weekend.
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Aayush Singhal wrote:I guess it is able to look up the EJB as we can see the 'JNDI looked up' output but while creating the Remote object, it is not able to???

I don't think this is correct. The invocation of create:

is not creating the remote object. Rather, create is a method you can call on the remote object i.e. the method is defined on the AccountSessionHome interface.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to access remote EJB on JBOSS
 
Similar Threads
JBoss 4.2.2 Server Starting Issue
invoking EJB via Http call using Jboss
Problem with JAAS(WebApp) and EJB3.0 and Jboss 5.1.0.GA
Simple & Basic EJB application -- Help is needed
NameNotFoundException: MSAccessDS not bound