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.
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.
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.
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).
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.