File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help needed in jco programming

 
meeraa pillaii
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends

when i try to connect with SAP server using jco i have some probem.

Connection with jco program is working fine. I make it ajava file and run separately).

Now i want do that with jsp.
I am getting error of
Exception report

message

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

exception

javax.servlet.ServletException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.barcodeMainP_jsp._jspService(org.apache.jsp.barcodeMainP_jsp:124)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NoClassDefFoundError
mySAP.JcoTest.createConnection(JcoTest.java:78)
mySAP.JcoTest.<init>(JcoTest.java:8)
org.apache.jsp.barcodeMainP_jsp._jspService(org.apache.jsp.barcodeMainP_jsp:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.


My Programs



My SAP calling program
<%@page language="java"
import="java.sql.*,java.io.*,mySAP.*,java.net.URL;"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<body>
<%!StringBuffer stringbuffer = new StringBuffer();
int testemp;%>
<%
String dofrom;
String doto;
String s;
String s1;
dofrom = request.getParameter("DOFrom");
doto = request.getParameter("DOTo");
ResultSet resultset;

String flag = request.getParameter("dall");
mySAP.JcoTest obj = new mySAP.JcoTest();
StringBuffer sb = obj.fetchData("one", "two");
out.println(sb);
try {

StringBuffer stringbuffer = new StringBuffer();
String separator = System.getProperty("file.separator");

String path = System.getProperty("user.dir") + separator;

} catch (Exception e) {
out.println("error%%%%%%%%%" + e);
}
%>
</body>
</html>
Regards
 
saurav sarkar
Ranch Hand
Posts: 180
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems to be JCO libraries are not in the classpath
 
Aneesh Vijendran
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When dealing with JCO, you have to make sure the mysap dll's or so files are are there in the system path.

Cheers
Aneesh
 
Campbell Ritchie
Sheriff
Pie
Posts: 47263
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have been offered classpath and path. Not sure myself, but classpath sounds more likely to be correct. Remember to set the classpath for your application with the -cp flag, not by setting up a system classpath.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic