aspose file tools*
The moose likes JBoss/WildFly and the fly likes Jboss with LDAP problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss with LDAP problem" Watch "Jboss with LDAP problem" New topic
Author

Jboss with LDAP problem

sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
We have a web application back-end with LDAP directory for authentication and attribute changes. This application is working earlier with Jboss, but now the same app is not working with the same server where as in java standalone application is working LDAP. What will be the problem working in java standalone not in web application? Please, your advice is very important to me. Since I'm getting confusion over this, I can't able to move step up. Is there any problem with Jboss server setup?



Note: I didn't use any specific jboss authentication module setup to authenticate, we just use normal authentication in our coding.
sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
Any hope on this.. at least a reply expected..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

If I understand you correctly, you have some code that queries LDAP and this code works just fine in a standalone app, but doesn't work in a deployed app.

My guess is that this is a problem with classloading - in the standalone app you are getting a different set of classes to handle the LDAP interface than when using JBoss AS. You can verify this by adding -verbose"class to the java command for both your standalone app and for JBoss AS. This option causes the JVM to print out each class loaded and the JAR it came from. Compare the ldap-related classes as to where they were being loaded in both cases; that might give a clue as to the issue.

If that does not work, you will have to start debugging your code that accesses ldap. I would figure out exactly what methods are being called, and in which classes, in the standalone app first, and then compare that to what you get within JBoss AS. And I don't mean the classes and methods in your code, I mean the ones on the libraries you are calling.


JBoss In Action
sumanth kumar
Greenhorn

Joined: Jul 29, 2005
Posts: 22
Thank you Peter for replying..

Unfortunately I can't do your first approach since our working environment is in Solaris and also I've no access to stop or start or debug the jboss server and code. but I can do debug as Java application (stand alone code) from eclipse.

I can tell you the API what we are using to authenticate. here is the API

this same API we are calling from stand alone and as well in web app deployed in jboss.
When I run the code we get context with object, and getting process with stand alone. We used "java.naming" package for LDAP.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

I thought for sure that the JVM on Solaris supports -verbose:class, but i can see that having access to the server is problematic. I recommend that you try your code on a Windows or Linux - you don't need the whole app, just a simple app that tries to gain access to LDAP. And I think you will need this once you read the next paragraph.

JBoss AS implements it's own naming service. So the name lookup you are doing is going through that service, and somewhere something is going wrong. So you will have to debug through the JBoss AS naming service to figure out where things go wrong. You will probably have better luck doing that on a system that you have control of and can modify (hence the suggestion to try this on Windows or Linux).

sumit murarka
Greenhorn

Joined: Oct 06, 2004
Posts: 3
Hi Sumanth,

Did you ever get it working? I have a similar problem. We are upgrading to java 6 from java 5 which gives me exactly the same error. The standalone client with the same code works. I did switch to verbose and could find any difference wrt class loading.

Thanks,

Sumit
anandraj tadkal
Ranch Hand

Joined: Feb 22, 2011
Posts: 98

You can refer the below post for a sample example of LDAP configuration with Jboss Server.

http://weblogic-wonders.com/weblogic/2010/04/07/ldap-authentication-on-jboss/

Cheers,
Anandraj
http://weblogic-wonders.com


Regards,
Anandraj
http://weblogic-wonders.com
Follow us on facebook:
https://www.facebook.com/weblogicwonders
 
 
subject: Jboss with LDAP problem
 
Similar Threads
Using LDAP authentiocation across APp-servers without carrying dependencies
Form Based Authentication using SSL/TLS in JBOSS
Urgent...not able to get data source
running web application on jboss5.1.0
How to create datasource for standalone application using JPA