-
typical problem, pls help
Hi all,
We have 3 systems pc25,pc24 and pc27........
pc25(the machine I am coding my pgms...)here I have IBM JDK
1.1.7 and also NetscapeLDAP client.....
AS I am using Netscpae LDAP I set the path to
path= C:\jdk1.1.7\bin\javac;C\netscape\server\bin;
classpath= C:\jdk1.1.7\lib\classes.zip;C\netscape\server\lib;
on pc27 we have the IBM websphere application server...to where I am deploying
all my files using IBMwebsphere studio on pc25...
here also I installed IBM jdk1.1.7 ans set the classpath...the same way as
for pc25.( here we dont have the LDAp server)
path= C:\jdk1.1.7\bin\javac.
classpath= C:\jdk1.1.7\lib\classes.zip.
on pc24 we have the LDAP server.
that is the environment.
Now I coded a simple PGM for LDAP authentication(on pc25)
and compiled that using the IBMwebsphere studio and deployed that on to pc27,,,,using
the tool.
In the PGM I am trying to access the valuesin LDAP server located on pc24..so
according to the syntax,,,I am using the IP address of PC24..in my PGM coded
on pc25 to link to the LDAP server. but I ma getting the error code below...Please
examine this carefully and if you know the answer please mail me asap....so
that I can proceed with the rest of my coding.
Kind Regards
Satish
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.*;
import netscape.ldap.*;
public class Authenticate extends HttpServlet
{
boolean authed = false ;
String authpw = " " ;
public void init(ServletConfig sc) throws ServletException
{
super.init(sc);
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println(" about to connect to the LDAPserver ");
out.println("<br> ");
LDAPConnection ld = new LDAPConnection() ;
try
{
ld.connect("13 . 200. 32. 55", 389 ) ;
out.println(" connected to the server ");
LDAPSearchConstraints cons = ld.getSearchConstraints()
;
cons.setBatchSize(0);
LDAPSearchResults results = ld.search("IMET", ld.SCOPE_SUB,
"uid = spakki ou=people o=IMET " , new String[ ] { ld.NO_ATTRS }, false,
cons );
if( ! results.hasMoreElements() )
{
out.println(" uid not found");
}
else if(results.getCount() > 1)
{
out.println(" more than one matching UID
");
}
else if( results.hasMoreElements() )
{
LDAPEntry entry = results.next();
String authDN = entry.getDN();
out.println(" UID maps to " + authDN
);
ld.authenticate(authDN, authpw) ;
authed = true ;
}
}
catch(LDAPException e) { out.println( e.toString()
) ; }
if(ld != null && ld.isConnected())
{
try
{
ld.disconnect();
}
catch(LDAPException e) { out.println( e.toString()
) ; }
}
int rc = 0 ;
if( authed)
{
out.println(" Authenticated");
}
else
{
out.println(" Not Authenticated "
);
rc = 1 ;
}
}
}
-----------------------------------------------------------------
Error 500
An error has occured while processing request:http://pc27/servlet/Authenticate
Message:Server caught unhandled exception from servlet [invoker]
Target Servlet: invoker
StackTrace:
--------------------------------------------------------------------------------
Root Error-1: Authenticate
java.lang.NoClassDefFoundError: Authenticate at java.lang.ClassLoader.resolveClass(ClassLoader.java:245)
at com.ibm.servlet.classloader.ClassLoaderTemplate.loadClass(ClassLoaderTemplate.java:59)
at java.lang.ClassLoader.loadClass(Compiled Code) at com.ibm.servlet.classloader.PowerClassLoader.loadNonSystemClass(PowerClassLoader.java:62)
at com.ibm.servlet.classloader.ClassLoaderTemplate.loadClass(ClassLoaderTemplate.java:57)
at java.lang.ClassLoader.loadClass(Compiled Code) at java.beans.Beans.instantiate(Beans.java:125)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(Compiled
Code) at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:296)
at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java: 42)
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
Code) at java.lang.Thread.run(Thread.java:472)
--------------------------------------------------------------------------------
Wrapped Error-2: Servlet [Authenticate]: Authenticate was found, but is missing
another required class. This error typically implies that the servlet was
originally compiled with a classes which cannot be located by the server.
Check your classpath to ensure that all classes required by the servlet are
present. This problem can be debugged by recompiling the servlet using only
the classes in the application's runtime classpath Application classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lo
tusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppServer/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall
.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/li
b/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11
~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
javax.servlet.ServletException: Servlet [Authenticate]: Authenticate was
found, but is missing another required class. This error typically implies
that the servlet was originally compiled with a classes which cannot be located
by the server. Check your classpath to ensure that all classes required by
the servlet are present. This problem can be debugged by recompiling the
servlet using only the classes in the application's runtime classpath Application
classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lotusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppSe
rver/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppSer
ver/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebS
phere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\We
bSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppServer\servlets; C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(Compiled
Code) at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:296)
at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java: 42)
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
Code) at java.lang.Thread.run(Thread.java:472)
--------------------------------------------------------------------------------
Wrapped Error-3: Servlet [Authenticate]: Authenticate was found, but is missing
another required class. This error typically implies that the servlet was
originally compiled with a classes which cannot be located by the server.
Check your classpath to ensure that all classes required by the servlet are
present. This problem can be debugged by recompiling the servlet using only
the classes in the application's runtime classpath Application classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lo
tusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppServer/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall
.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/li
b/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11
~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
javax.servlet.ServletException: Servlet [Authenticate]: Authenticate was
found, but is missing another required class. This error typically implies
that the servlet was originally compiled with a classes which cannot be located
by the server. Check your classpath to ensure that all classes required by
the servlet are present. This problem can be debugged by recompiling the
servlet using only the classes in the application's runtime classpath Application
classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lotusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppSe
rver/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppSer
ver/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebS
phere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\We
bSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppServer\servlets; C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:147)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
Code) at java.lang.Thread.run(Thread.java:472)
--------------------------------------------------------------------------------
Wrapped Error-4: Server caught unhandled exception from servlet [invoker]
com.ibm.servlet.engine.webapp.UncaughtServletException: Server caught unhandled
exception from servlet [invoker] at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:114 6)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
Code) at java.lang.Thread.run(Thread.java:472)
-
Re: typical problem, pls help
This is really due to problems in the setting of class paths. You should be
able to run your app in such a environment just by making sure the same classes
are available in the production server as well as in the development workstation.
Try do debug this code (even outside your production server) to make sure
that is not something you can solve by programming and not my configuring
the operating system, the VM, the paths, and all those things which are great
to take us a little bit away from our daily routine.
That is fun.
Fernando Ribeiro
fribeiro
> We have 3 systems pc25,pc24 and pc27........
>
> pc25(the machine I am coding my pgms...)here I have IBM JDK
> 1.1.7 and also NetscapeLDAP client.....
>
>AS I am using Netscpae LDAP I set the path to
>
>path= C:\jdk1.1.7\bin\javac;C\netscape\server\bin;
>classpath= C:\jdk1.1.7\lib\classes.zip;C\netscape\server\lib;
>
> on pc27 we have the IBM websphere application server...to where I am deploying
>all my files using IBMwebsphere studio on pc25...
>here also I installed IBM jdk1.1.7 ans set the classpath...the same way
as
>for pc25.( here we dont have the LDAp server)
>
>path= C:\jdk1.1.7\bin\javac.
>classpath= C:\jdk1.1.7\lib\classes.zip.
>
>
>on pc24 we have the LDAP server.
>that is the environment.
>
>
>Now I coded a simple PGM for LDAP authentication(on pc25)
>and compiled that using the IBMwebsphere studio and deployed that on to
pc27,,,,using
>the tool.
>
>In the PGM I am trying to access the valuesin LDAP server located on pc24..so
>according to the syntax,,,I am using the IP address of PC24..in my PGM coded
>on pc25 to link to the LDAP server. but I ma getting the error code below...Please
>examine this carefully and if you know the answer please mail me asap....so
>that I can proceed with the rest of my coding.
>
>Kind Regards
>Satish
>
>
>import javax.servlet.*;
>import javax.servlet.http.*;
>import java.util.*;
>import java.io.*;
>import netscape.ldap.*;
>
>
>
>public class Authenticate extends HttpServlet
>{
>
>
> boolean authed = false ;
>
> String authpw = " " ;
>
>
> public void init(ServletConfig sc) throws ServletException
> {
> super.init(sc);
> }
>
>
> public void doGet(HttpServletRequest req, HttpServletResponse res)
>throws ServletException, IOException
> {
>
> res.setContentType("text/html");
> PrintWriter out = res.getWriter();
>
>
> out.println(" about to connect to the LDAPserver ");
>
> out.println("<br> ");
>
>
> LDAPConnection ld = new LDAPConnection() ;
>
> try
> {
> ld.connect("13 . 200. 32. 55", 389 ) ;
>
>
> out.println(" connected to the server ");
>
>
> LDAPSearchConstraints cons = ld.getSearchConstraints()
>;
>
> cons.setBatchSize(0);
>
>
> LDAPSearchResults results = ld.search("IMET", ld.SCOPE_SUB,
>"uid = spakki ou=people o=IMET " , new String[ ] { ld.NO_ATTRS }, false,
>cons );
>
> if( ! results.hasMoreElements() )
> {
>
> out.println(" uid not found");
> }
>
> else if(results.getCount() > 1)
> {
>
> out.println(" more than one matching UID
>");
>
> }
>
> else if( results.hasMoreElements() )
> {
>
> LDAPEntry entry = results.next();
>
> String authDN = entry.getDN();
>
> out.println(" UID maps to " + authDN
>);
>
> ld.authenticate(authDN, authpw) ;
>
> authed = true ;
>
> }
> }
>
> catch(LDAPException e) { out.println( e.toString()
>) ; }
>
>
> if(ld != null && ld.isConnected())
> {
>
> try
> {
>
> ld.disconnect();
>
> }
>
> catch(LDAPException e) { out.println( e.toString()
>) ; }
>
>
> }
>
>
> int rc = 0 ;
>
> if( authed)
> {
> out.println(" Authenticated");
>
> }
> else
> {
> out.println(" Not Authenticated
"
>);
>
> rc = 1 ;
>
>
>
> }
>
>
> }
>
>}
>
>-----------------------------------------------------------------
>
>
>Error 500
>An error has occured while processing request:http://pc27/servlet/Authenticate
>Message:Server caught unhandled exception from servlet [invoker]
>Target Servlet: invoker
>StackTrace:
>--------------------------------------------------------------------------------
>Root Error-1: Authenticate
>java.lang.NoClassDefFoundError: Authenticate at java.lang.ClassLoader.resolveClass(ClassLoader.java:245)
>at com.ibm.servlet.classloader.ClassLoaderTemplate.loadClass(ClassLoaderTemplate.java:59)
>at java.lang.ClassLoader.loadClass(Compiled Code) at com.ibm.servlet.classloader.PowerClassLoader.loadNonSystemClass(PowerClassLoader.java:62)
>at com.ibm.servlet.classloader.ClassLoaderTemplate.loadClass(ClassLoaderTemplate.java:57)
>at java.lang.ClassLoader.loadClass(Compiled Code) at java.beans.Beans.instantiate(Beans.java:125)
>at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(Compiled
>Code) at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:296)
>at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java: 42)
>at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:138)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
>at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
>at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
>at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
>at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
>at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
>at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
>at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
>at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
>at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
>at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
>Code) at java.lang.Thread.run(Thread.java:472)
>
>--------------------------------------------------------------------------------
>Wrapped Error-2: Servlet [Authenticate]: Authenticate was found, but is
missing
>another required class. This error typically implies that the servlet was
>originally compiled with a classes which cannot be located by the server.
>Check your classpath to ensure that all classes required by the servlet
are
>present. This problem can be debugged by recompiling the servlet using only
>the classes in the application's runtime classpath Application classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/l
otusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppServer/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/
>lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere
/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/Ap
>pServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
>javax.servlet.ServletException: Servlet [Authenticate]: Authenticate was
>found, but is missing another required class. This error typically implies
>that the servlet was originally compiled with a classes which cannot be
located
>by the server. Check your classpath to ensure that all classes required
by
>the servlet are present. This problem can be debugged by recompiling the
>servlet using only the classes in the application's runtime classpath Application
>classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lotusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppS
erver/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebS
>phere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjr
t.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppSe
>rver/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
>at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(Compiled
>Code) at com.ibm.servlet.engine.webapp.WebApp.addServlet(WebApp.java:296)
>at com.ibm.servlet.engine.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java: 42)
>at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:138)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
>at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
>at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
>at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
>at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
>at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
>at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
>at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
>at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
>at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
>at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
>Code) at java.lang.Thread.run(Thread.java:472)
>
>--------------------------------------------------------------------------------
>Wrapped Error-3: Servlet [Authenticate]: Authenticate was found, but is
missing
>another required class. This error typically implies that the servlet was
>originally compiled with a classes which cannot be located by the server.
>Check your classpath to ensure that all classes required by the servlet
are
>present. This problem can be debugged by recompiling the servlet using only
>the classes in the application's runtime classpath Application classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/l
otusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppServer/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/
>lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebSphere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere
/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjrt.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/Ap
>pServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppServer/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
>javax.servlet.ServletException: Servlet [Authenticate]: Authenticate was
>found, but is missing another required class. This error typically implies
>that the servlet was originally compiled with a classes which cannot be
located
>by the server. Check your classpath to ensure that all classes required
by
>the servlet are present. This problem can be debugged by recompiling the
>servlet using only the classes in the application's runtime classpath Application
>classpath=[C:/WebSphere/AppServer/lib/ibmwebas.jar;C:/WebSphere/AppServer/properties;C:/WebSphere/AppServer/lib/servlet.jar;C:/WebSphere/AppServer/lib/webtlsrn.jar;C:/WebSphere/AppServer/lib/lotusxsl.jar;C:/WebSphere/AppServer/lib/ns.jar;C:/WebSphere/AppS
erver/lib/ejs.jar;C:/WebSphere/AppServer/lib/ujc.jar;C:/SQLLIB/java/db2java.zip;C:/WebSphere/AppServer/lib/repository.jar;C:/WebSphere/AppServer/lib/admin.jar;C:/WebSphere/AppServer/lib/swingall.jar;C:/WebSphere/AppServer/lib/console.jar;C:/WebS
>phere/AppServer/lib/tasks.jar;C:/WebSphere/AppServer/lib/xml4j.jar;C:/WebSphere/AppServer/lib/x509v1.jar;C:/WebSphere/AppServer/lib/vaprt.jar;C:/WebSphere/AppServer/lib/iioprt.jar;C:/WebSphere/AppServer/lib/iioptools.jar;C:/WebSphere/AppServer/lib/dertrjr
t.jar;C:/WebSphere/AppServer/lib/sslight.jar;C:/WebSphere/AppServer/lib/ibmjndi.jar;C:/WebSphere/AppServer/lib/deployTool.jar;C:/WebSphere/AppServer/lib/databeans.jar;C:/WebSphere/AppServer/classes;C:/JDK11~1.7/lib/classes.zip;C:/WebSphere/AppSe
>rver/lib/jsp10.jar;C:\WebSphere\AppServer\hosts\default_host\default_app\servlets;C:\WebSphere\AppS erver\servlets;C:\WebSphere\AppServer\servlets\DataAccessBean.jar]
>at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:147)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:639) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:557)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java: 160)
>at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
>at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:1 05)
>at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:349)
>at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:705)
>at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:631)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:112 9)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
>at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
>at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
>at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
>at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
>at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
>at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
>Code) at java.lang.Thread.run(Thread.java:472)
>
>--------------------------------------------------------------------------------
>Wrapped Error-4: Server caught unhandled exception from servlet [invoker]
>com.ibm.servlet.engine.webapp.UncaughtServletException: Server caught unhandled
>exception from servlet [invoker] at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebApp.java:114 6)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebApp.java:1001)
>at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebApp.java:960)
>at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebGroup.java:681)
>at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java: 67)
>at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationCon text.java:106)
>at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.j ava:144)
>at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerI mp.java:230)
>at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.jav a:104)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.jav a:202)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyS ervice(SQWrapperEventSource.java:347)
>at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQW rapperEventSource.java:216)
>at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled
>Code) at java.lang.Thread.run(Thread.java:472)
>
>
>
>
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks