Why jar files work only in WEB-INF/classes extracted ?

2002-03-29 Thread Korakaki Stella

Hi ,

   The only way to make my servlets find my jar files is to extract then
ans put them at WEB-INF/classes/. WEB-INF/lib/ did not work. Why?

Stella


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




java.lang.NoClassDefFoundError

2002-03-28 Thread Korakaki Stella


  I've placed my servlet in the directory : 

$CATALINA_HOME/webapps/ROOT/WEB-INF/classes/Login.class 

and I've written the following at the 
$CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml :

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;

web-app
servlet
servlet-name
 login
/servlet-name
servlet-class
 Login
/servlet-class
/servlet
/web-app .

Also, I've placed my .jar file at the directory :

$CATALINA_HOME/webapps/ROOT/WEB-INF/lib/jCo.jar .

When I try to reach the address http://localhost/servlet/login it seems
that tomcat can't find my .jar file. I've tried a simple servlet with no
specific dependencies and worked fine.

Please someone tell me what to do in order to have my servlet working...

Stella Korakaki
Koutoudis Consulting


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error -HELP-ME-PLEASE

2002-03-28 Thread Korakaki Stella


 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(htmlbody);

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();

}
}
--
The following message is displayed :
--
Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Invoker service() exception
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:504)
at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at

RE: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error -HELP-ME-PLEASE

2002-03-28 Thread Korakaki Stella

Thanx Randy but I've placed my jar file with the classes needed at
$CATALINA_HOME/common/classes/jCO.jar . This is not enough ?

Stella

 
 
  -Original Message-
  From: Korakaki Stella [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, March 28, 2002 7:39 AM
  To: Tomcat Users List
  Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
  -HELP-ME-PLEASE
  
  
  
  java.lang.NoClassDefFoundError
  at Login2.doGet(Login2.java:51)
  at 
  -
  Could someone tell me what is wrong ?
  Please help me !!
  
  
 
   Whatever class you are trying to load on line 51 of Login2.java is
 not available to Tomcat.
 
   Randy
 
 --
 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]




RE: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error -HELP-ME-PLEASE

2002-03-28 Thread Korakaki Stella

Thanx Randy but I've placed my jar file with the classes needed at
$CATALINA_HOME/common/lib/jCO.jar . This is not enough ?

Stella

 
 
  -Original Message-
  From: Korakaki Stella [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, March 28, 2002 7:39 AM
  To: Tomcat Users List
  Subject: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
  -HELP-ME-PLEASE
  
  
  
  java.lang.NoClassDefFoundError
  at Login2.doGet(Login2.java:51)
  at 
  -
  Could someone tell me what is wrong ?
  Please help me !!
  
  
 
   Whatever class you are trying to load on line 51 of Login2.java is
 not available to Tomcat.
 
   Randy
 
 --
 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]




RE: Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error -HELP-ME-PLEASE

2002-03-28 Thread Korakaki Stella

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(htmlbody);
 
  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]




New to Tomcat - Need Help!

2002-03-27 Thread Korakaki Stella


 Hi! I was looking for a way to have a web server running serlvets so I
tried Tomcat4. I know few about xml and the configurations are written
in xml. I have a lot of questions:
- How can I add a directory /icons just like in apache ?
- What shall I write at the web.xml of each WEB-INF directory in order
to make my classes executable and available?
- How can I make my own .jar files available not globaly but on certain
servlets?
- How can I change my directory index file from index.html to index.wml ?
- How can I prevent certain paths to be available through the browser ?
- How secure is Tomcat or how can I make it secure?

Please help me to get started with Tomcat :-)

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]