Hi guys, i'm trying to call a cobol program from java using the mfcobol.jar, but i'm geting this error below.
Let me explain my situation, my cobol is under Linux server, my Eclipse is on Windows, so I copy the mfcobol.jar from my Linux
and i'm trying to execute jsp project.
My setup: Windows XP, Eclipe Kepler, JDK 1.6
Linux Red hat, Server for Cobol 5.1
I linked my project updating the buidpath like Microfocus's documment, but does not help.
My code, error on RuntimeSystem.cobload
| import com.microfocus.cobol.RuntimeSystem; import com.microfocus.cobol.lang.ParameterList; import com.microfocus.cobol.lang.Pointer; public class showbytes { public void inicializa() throws Exception { String myString = new String("Hello to COBOL"); RuntimeSystem.cobload("C:/temp/passarray.dll"); System.out.println("myString=" myString); } } |
C:/temp/passarray.dll is just a test cause the real program it's in Linux
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: com/microfocus/cobol/RuntimeSystem org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
javax.servlet.ServletException: com/microfocus/cobol/RuntimeSystem org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) org.apache.jsp.exec2_jsp._jspService(exec2_jsp.java:55) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NoClassDefFoundError: com/microfocus/cobol/RuntimeSystem teste.showbytes.inicializa(showbytes.java:21) org.apache.jsp.exec2_jsp._jspService(exec2_jsp.java:48) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.36 logs.
#cobload
#RuntimeSystem
#COBOL
#Java
#mfcobol.jar