File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes help needed in jco programming    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help needed in jco programming    " Watch "help needed in jco programming    " New topic
Author

help needed in jco programming

meeraa pillaii
Ranch Hand

Joined: Apr 19, 2008
Posts: 30
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

Joined: Jan 07, 2007
Posts: 180

seems to be JCO libraries are not in the classpath


Be Objectively Oriented.Explore the power of OOPs.
My Blog, Eclipse EMF Query committer.
Aneesh Vijendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 125
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


Cheers
Aneesh
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36508
    
  16
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
 
subject: help needed in jco programming
 
Similar Threads
Validation error
Insert after submit form
Not able to create Hibernate Session from JSP....Could any experts help me on this !!!!
error while calling a class file from jsp
[Hibernate] NoClassDefFoundError