Thanx Carl, I've placed jCO.jar at $CATALINA_HOME/common/lib/ it didn't work. I've tried to extract it and placed the classes at $CATALINA_HOME/common/classes/ and didn't work either. Also, I tried $JAVA_HOME/jre/lib/ext/jCO.jar and all other possible paths but tomcat seemed that could not find it. I worked with Apache Jserv before and the same servlets worked fine but I want to use Tomcat now.
Any idea someone ? > > So it executed the Servlet Login2 as evidence in the stacktrace.... > > > root cause > > > > java.lang.NoClassDefFoundError > > at Login2.doGet(Login2.java:51) > > at > > javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > > > ... and it got all the way to line 51. It looks like there are other > classes from this jar package that are being invoked. If they are being > invoked with no exception then the jar file is found. But the class at line > 51 is not found. My line counting isn't working so you need to point to the > source code line 51. Also assuming your classes are like this: > com.sap.mw.jco.JCO.Repository and the jco.jar file is in your WEB-INF/lib > directory. > > > > -----Original Message----- > > From: Korakaki Stella [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, March 28, 2002 4:39 AM > > To: Tomcat Users List > > Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error > > -HELP-ME-PLEASE > > > > > > > > When I'm trying to execute the following servlet from the > > web browser: > > --------------------------------------------------------------------- > > > > import com.sap.mw.jco.*; > > import java.io.*; > > import javax.servlet.*; > > import javax.servlet.http.*; > > > > public class Login2 extends HttpServlet > > { > > > > JCO.Client mConnection; > > JCO.Repository mRepository; > > > > public JCO.Function createFunction(String name) throws Exception { > > try { > > IFunctionTemplate ft = > > mRepository.getFunctionTemplate(name.toUpperCase()); > > if (ft == null) > > return null; > > return ft.getFunction(); > > } > > catch (Exception ex) { > > throw new Exception("Problem retrieving JCO.Function object."); > > } > > } > > > > public void doGet (HttpServletRequest req, > > HttpServletResponse res) > > throws ServletException, IOException > > { > > > > res.setContentType("text/html"); > > PrintWriter out = res.getWriter(); > > String tmp; > > > > out.println("<html><body>"); > > > > try { > > // Change the logon information to your own system/user > > mConnection = > > JCO.createClient("300", // SAP client > > "username", // userid > > "********", // password > > "EN", // language > > "127.0.0.1", // application server host name > > "00"); // system number > > mConnection.connect(); > > mRepository = new JCO.Repository("ARAsoft", mConnection); > > } > > catch (Exception ex) { > > ex.printStackTrace(); > > System.exit(1); > > } > > > > JCO.Function function = null; > > JCO.Table codes = null; > > try { > > function = this.createFunction("ZRFC_CUSTOMERS"); > > if (function == null) { > > System.out.println("ZRFC_CUSTOMERS" + > > " not found in SAP."); > > System.exit(1); > > } > > > > JCO.ParameterList input=function.getImportParameterList(); > > input.setValue("0001","BUKRS"); > > > > mConnection.execute(function); > > > > codes = > > function.getTableParameterList().getTable("CUSTOMER"); > > for (int i = 0; i < codes.getNumRows(); i++) { > > codes.setRow(i); > > > > tmp=codes.getString("NAME1"); > > if (tmp.length() < 12 ) { > > out.println("<li>");out.println(tmp);} > > else {out.println("<li>");out.println(tmp.substring(0,12));} > > } > > } > > catch (Exception ex) { > > ex.printStackTrace(); > > System.exit(1); > > } > > out.println("</body></html>"); > > > > mConnection.disconnect(); > > > > } > > } > > -------------------------------------- > > > > -------------------- > > Stella Korakaki > > Koutoudis Consulting > > > > > > -- > > To unsubscribe: <mailto:[EMAIL PROTECTED]> > > For additional commands: <mailto:[EMAIL PROTECTED]> > > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > > -------------------- Stella Korakaki Koutoudis Consulting -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
