No class definition found error in dfc program

Hi Experts,
I have deployed a hello world servlet in jboss and is working fine. now I deployed a dfc program in jboss and though it is deployed properly when i try to run it, i get the following error:

2009-05-21 17:24:48,333 WARN  org.jboss.jbossweb: WARNING: Error for /auth-servlet/authenticate?login=dmadmin2&password=docmgt15&domain=edms
java.lang.NoClassDefFoundError: com/documentum/fc/common/DfException
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
      at java.lang.Class.getConstructor0(Class.java:1762)
      at java.lang.Class.newInstance0(Class.java:276)
      at java.lang.Class.newInstance(Class.java:259)
      at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:176)
      at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:275)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:333)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      at org.jboss.jetty.Jetty.service(Jetty.java:460)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
 (PoolThread-8)

My classpath entries (solaris machine):
/appl/documentum/share/dctm.jar:/appl/documentum/share/dfc/dfc.jar:/appl/documen
tum/share/dfc/dfcbase.jar:/appl/documentum/share/dfc/log4j.jar

Please let me know where can i be wrong?
Thanks
sandhya01Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rsulliv1Commented:
What happens when you put the dfc.jar into the <webapp>/WEB-INF/lib directory and reload the webapp?

It appears that you have the dfc.jar in the default installation location, but it also must be available to the jvm running the webapp. That would typically be in the jboss classpath or the webapp's classpath.
0
omoralesmCommented:
Try adding the jars in the jboss-minimal.xml file.
0
sandhya01Author Commented:
Hi
I added the jars in auth-servlet.war/WEB-INF/lib directory. and I got the below error :
HTTP ERROR: 500 com/documentum/fc/connector/IDfCredential
Excertps from server.log file:
2009-05-23 14:01:12,100 WARN  org.jboss.jbossweb: WARNING: Error for /auth-servlet/authenticate?login=dmadmin2&password=docmgt15&domain=edms
java.lang.NoClassDefFoundError: com/documentum/fc/connector/IDfCredential
      at com.documentum.com.DfClientX.getLocalClient(DfClientX.java:41)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.authenticate(AuthenticationServlet.java:35)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.doPost(AuthenticationServlet.java:75)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.doGet(AuthenticationServlet.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      at org.jboss.jetty.Jetty.service(Jetty.java:460)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
 (PoolThread-8)

2009-05-23 14:01:47,461 INFO  STDOUT: Login servlet called (PoolThread-8)

2009-05-23 14:01:47,466 INFO  STDOUT: true (PoolThread-8)


If you see the log you will get that my login servlet is called, but instead of getting output as '1', I am getting the error message as described at the top of this comment.

Also, Please let me k now how to add jars in jboss-minimal.xml file.


Thanks
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

sandhya01Author Commented:
Hi Experts
when i added dfcbase.jar and log4.jar in auth-servlet.war/WEB-INF/lib folder, I am getting the below error:
HTTP ERROR: 500 Failed to load preferences: java.io.FileNotFoundException: Cannot locate file - dfc.properties

Please help
0
sandhya01Author Commented:
Hi experts,
Now I added dfc.properties in jboss directory default/conf, and i am getting the below error:
HTTP ERROR: 500 no dmcl40 in java.library.path
RequestURI=/auth-servlet/authenticate
0
Rsulliv1Commented:
put dfc.properties into auth-servlet.war/WEB-INF/classes/ and see if the error changes

if you still have issues with the dmcl40 error. go through the dfc install guide and make sure you have your dmcl40.dll or .so configured correctly with the os's env variables.

for instance, LD_LIBRARY_PATH needs to have the path to the shared dfc.

This should all be detailed in the dfc installation guide.

Let me know how it goes.
0
sandhya01Author Commented:
Hi
I put dfc.properties into auth-servlet.war/WEB-INF/classes/ and got the same error "HTTP ERROR: 500 no dmcl40 in java.library.path"

LD_LIBRARY_PATH is set to : /appl/documentum/fulltext/IndexServer/lib:/appl/documentum/share/dfc:/appl/docum
entum/share/IndexAgents/ftintegrity

So what do you think now?

Thanks
0
Rsulliv1Commented:
the dfc guide states that the following should be in LD_LIBRARY_PATH (via the set_dctm_env.sh file) :

$DOCUMENTUM_SHARED/dfc and $JAVA_HOME/jre/lib/i386/client:$JAVA_HOME/jre/lib/i386  

do those directories exist in your LD_LIBRARY_PATH? The dfc installation guide contains a table (table 1) that shows all of the environmental variables that need to be configured. make sure you follow this to correctly install the documentum foundation classes.

another thing to checkout is if your system is looking for a file named dmcl40.so when the installed file is named libdmcl40.so. If this is the case, you'll have to create a copy of the file with the new name.

Look into how your app server sets the jvm's local java.library.path variable. You might try to override this. Look to the run.sh file to see if there is a -Djava.library.path option being set that is overriding.

Browse powerlink for more information, but these appear to be the solutions to most people's issues.
0
sandhya01Author Commented:
Hi Experts,
Please check the output of my env command:
bash-3.00$ env
HZ=100
SHELL=/bin/csh
TERM=ansi
FASTSEARCH=/appl/documentum/fulltext/IndexServer
LC_ALL=C
USER=dmadmin2
LD_LIBRARY_PATH=/appl/documentum/fulltext/IndexServer/lib:/appl/documentum/share
/dfc:/appl/documentum/share/IndexAgents/ftintegrity
LIBPATH=/appl/documentum/fulltext/IndexServer/lib:/appl/documentum/share/dfc:/ap
pl/documentum/share/IndexAgents/ftintegrity
MAIL=/var/mail/dmadmin2
PATH=/usr/local/bin:./:/usr/local/bin:./:/usr/local/bin:./:/usr/bin:
PWD=/appl/documentum
JAVA_HOME=/appl/documentum/share/java/1.4.2_04
DOCUMENTUM_SHARED=/appl/documentum/share
TZ=GMT
SHLVL=1
HOME=/appl/documentum
LOGNAME=dmadmin2
CLASSPATH=/appl/documentum/share/dctm.jar:/appl/documentum/share/dfc/dfc.jar:/ap
pl/documentum/share/dfc/dfcbase.jar:/appl/documentum/share/dfc/log4j.jar:/appl/d
ocumentum/share/config:/appl/documentum/share/dfc
SHLIB_PATH=/appl/documentum/fulltext/IndexServer/lib:/appl/documentum/share/dfc:
/appl/documentum/share/IndexAgents/ftintegrity
DOCUMENTUM=/appl/documentum
_=/usr/bin/env

It's still not working.

Thanks
0
Rsulliv1Commented:
few things:

1. are you sure that your DOCUMENTUM_SHARED is /appl/documentum/share ? is there a dfc directory under /share? I've always seen it as shared and there is a shared/dfc directory. There is a /share, but that's not where all of the shared files live.

2. did you attempt to chance the filename from libdmcl40.so to dmcl40.so

3. did you verify that jboss isn't setting its own java.library.path var? in the run.sh there could be a property on the java command like -Djava.library.path= and that could be overriding your environmental settings. Try to manually put your paths in there.

Also, review the dfc installation guide because it still appears that your dfc (specifically your dmcl access) is installed incorrectly for your server.

**If none of these work, you should create a webapp that outputs the java.library.path from within your webapp context so you can see exactly what is being used. Then you can figure out where it's being set.
0
sandhya01Author Commented:
Hi
Find my servlet code,
After compiling the code on the linux machine, I am getting error " http 503 sevlet not initialized"

package com.wyeth.dctm.authenticate;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfLogger;
import com.documentum.fc.common.IDfLoginInfo;

public class AuthenticationServlet extends HttpServlet
{
     
    public AuthenticationServlet()
    {
    }
   

    protected boolean authenticate(String strUserName,String strPassword,String strDocbase) {
          boolean isAuthenticated=true;
          IDfClientX clientX=null;
          IDfClient client=null;
          IDfLoginInfo loginInfo=null;
          IDfSession session=null;
          clientX=new DfClientX();
          try {
                client=clientX.getLocalClient();
                loginInfo=clientX.getLoginInfo();
                loginInfo.setUser(strUserName);
                loginInfo.setPassword(strPassword);
                session=client.newSession(strDocbase,loginInfo);
                if (session==null) {
                      isAuthenticated=false;
                      return isAuthenticated;
                }
                else {
                      isAuthenticated=session.getUser(strUserName).isSuperUser();
                }
               
                System.out.println("User Authenticated");
          }
          catch (DfException dfEx) {
                DfLogger.debug(this,"Unable to Authenticate user:: {0} in docbase {1}",new String[]{strUserName,strDocbase}, dfEx);
                System.out.println("User Not Authenticated::" + dfEx.toString());
                isAuthenticated=false;
          }
          finally {
                System.out.println(isAuthenticated);
          }
         
          return isAuthenticated;
    }
    public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
          String strUserName=null;
          String strPassword=null;
          String strDocbase=null;
         
        System.out.println("Login servlet called");
         response.setContentType("text/html");
         response.setHeader("Cache-Control","no-store");
         strPassword = request.getParameter("password");
         strUserName = request.getParameter("login");
         strDocbase = request.getParameter("domain");
       
        if( authenticate(strUserName,strPassword,strDocbase))
        {
              PrintWriter out = response.getWriter();
            out.println("1");
        } else
        {
            PrintWriter out = response.getWriter();
            out.println("0");
        }
    }

    public boolean isUserInRole(String strRole,String strUserName) {
     
          return false;
    }
   
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException
    {
        doPost(req, resp);
    }
}


Thanks
0
sandhya01Author Commented:
Hi Experts,
My java.library.path is giving value as: /appl/documentum/fulltext/IndexServer/lib (PoolThread-9)

Is this correct? also, what should I modify and where, so that it takes the correct value.

Thanks
0
sandhya01Author Commented:
Hi
I think I am very near to closing this problem. I modified my run.sh file for java.libray.path to include the necessary path and now I am getting the following error:

2009-05-26 16:27:23,755 INFO  STDOUT: Login servlet called..... (PoolThread-8)

2009-05-26 16:27:23,755 INFO  STDOUT: /appl/documentum/fulltext/IndexServer/lib:/appl/documentum:/appl/documentum/share (PoolThread-8)

2009-05-26 16:27:23,755 INFO  STDOUT: got parameters from browser (PoolThread-8)

2009-05-26 16:27:23,755 INFO  STDOUT: calling getLocalClient... (PoolThread-8)

2009-05-26 16:27:23,756 INFO  STDOUT: calling getLoginInfo... (PoolThread-8)

2009-05-26 16:27:23,756 INFO  STDOUT: setting username... (PoolThread-8)

2009-05-26 16:27:23,756 INFO  STDOUT: setting password... (PoolThread-8)

2009-05-26 16:27:23,756 INFO  STDOUT: creating session... (PoolThread-8)

2009-05-26 16:27:23,756 INFO  STDOUT: true (PoolThread-8)

2009-05-26 16:27:23,757 WARN  org.jboss.jbossweb: WARNING: Error for /auth-servlet/authenticate?login=dmadmin2&password=docmgt15&domain=edms
java.lang.UnsatisfiedLinkError: no dmcl40 in java.library.path
      at com.documentum.fc.connector.DfConnection.<init>(DfConnection.java:92)
      at com.documentum.fc.connector.DfConnectionFactory.getConnection(DfConnectionFactory.java:25)
      at com.documentum.fc.client.DfClientSupport.getConnection(DfClientSupport.java:623)
      at com.documentum.fc.client.DfClientSupport.newSession(DfClientSupport.java:183)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.authenticate(AuthenticationServlet.java:44)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.doPost(AuthenticationServlet.java:82)
      at com.wyeth.dctm.authenticate.AuthenticationServlet.doGet(AuthenticationServlet.java:103)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      at org.jboss.jetty.Jetty.service(Jetty.java:460)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
 (PoolThread-8)

Can you please look into it and let me know what I did is wrong or not, I have checked the DFC installation is fine as I am able to run simple dfc program that establishes a session, only when I try to run this DFC program as a servlet that I get error.

Thanks
0
Rsulliv1Commented:
Did you look into my #1 and #2 suggestions? please verify those.

Also, the output of your servlet does not include the /dfc directory.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sandhya01Author Commented:
Hi
Yes, when I included the /dfc directory, I got it, it is working now.

Thanks
0
sandhya01Author Commented:
Hi
The problem was that my jboss was not taking the classpath which I have set in my linux machine.

So after modifying the run.sh file and including $DOCUMENTUM and $DOCUMENTUM_SHARED/dfc folders as an argument for java.library.path,  now my jboss application detects the folders.

Thanks
0
sandhya01Author Commented:
The comments, if could have been more easy to understand. ie. instead of saying overwrite the java.libary.path, if you could have expalined why I need to overwrite since I have already set my classpath to the required variable , and even overwrite is not a good word here, you could have used the word add or something like that, I could have got it easily. so basically this request was raised on 21st and could have been resolved in 1 day. But it took around 6 days to get to the solution, even though the solution was already hinted in the very first comment.
Bottomline: please be more easy and explaining in your comments that will save the time of both and give excellent results.

Anyways thank a lot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Content Management

From novice to tech pro — start learning today.