File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception" Watch "Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception" New topic
Author

Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception

Praison Selvaraj
Ranch Hand

Joined: Jun 05, 2010
Posts: 49
package com.sapadapter.poc;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.resource.ResourceException;
import javax.resource.cci.ConnectionFactory;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.sap.mw.jco.JCO.Exception;
import javax.resource.cci.Connection;
import javax.resource.cci.Interaction;
import javax.resource.cci.IndexedRecord;
import javax.resource.cci.MappedRecord;
import javax.resource.cci.Record;
import javax.resource.cci.RecordFactory;


public class TestServlet extends HttpServlet {

public void doGet(HttpServletRequest request, HttpServletResponse respone) {
try {
InitialContext initialContext = new InitialContext();
ConnectionFactory connFactory;

System.out.println("Beginning...");
Object objRef = initialContext.lookup("ibmsapadapter");
System.out.println("lookup done...");
connFactory = (ConnectionFactory) objRef;
System.out.println("connFactory: " + connFactory.toString());
Connection con = connFactory.getConnection();
System.out.println("Connection: " + con);
Interaction action = con.createInteraction();
System.out.println(" action: " + action);
javax.resource.cci.Record inRec = null;
javax.resource.cci.Record outRec = null;


/*
* IndexedRecord inRec = connFactory.getRecordFactory()
* .createIndexedRecord("input");


SAPInteractionSpec is = new SAPInteractionSpec();
is.setFunctionName("GET");*/


RecordFactory rf = connFactory.getRecordFactory();
MappedRecord input = rf.createMappedRecord("ZCSSI_BR_COMP_VALIDATION");
input.put("IM_BRANCH", "03");
input.put("IM_COMPANY", "M65");

// inRec = new Record();

String requestStr = "<ZCSSI_BR_COMP_VALIDATION ><IM_BRANCH>03</IM_BRANCH><IM_COMPANY>M65</IM_COMPANY></ZCSSI_BR_COMP_VALIDATION>";

Record rec=null;

action.execute(null,input);

//IndexedRecord response = (IndexedRecord) action.execute(is, rec);

//System.out.println(response.getRecordName());
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NamingException e) {
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}


throws this exception

[6/3/11 10:14:43:028 PDT] 00000016 SystemOut O Beginning...
[6/3/11 10:14:43:108 PDT] 00000016 SystemOut O lookup done...
[6/3/11 10:14:43:109 PDT] 00000016 SystemOut O connFactory: com.ibm.j2ca.sap.SAPConnectionFactory@7df87df8
[6/3/11 10:14:43:140 PDT] 00000016 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet ibmsap1 in application ibmsapEAR. Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at com.ibm.j2ca.sap.SAPManagedConnectionFactory.createManagedConnection(SAPManagedConnectionFactory.java:72)
at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2032)
at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1709)
at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2465)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1057)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:696)
at com.ibm.j2ca.base.WBIConnectionFactory.getConnection(WBIConnectionFactory.java:74)
at com.adp.sapadapter.poc.TestServlet.doGet(TestServlet.java:33)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1589)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:870)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3799)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:182)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.ClassNotFoundException: com.sap.mw.jco.JCO$Exception
at java.net.URLClassLoader.findClass(URLClassLoader.java:421)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:90)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
... 35 more


Please help me resolve [6/3/11 10:14:43:028 PDT] 00000016 SystemOut O Beginning...
[6/3/11 10:14:43:108 PDT] 00000016 SystemOut O lookup done...
[6/3/11 10:14:43:109 PDT] 00000016 SystemOut O connFactory: com.ibm.j2ca.sap.SAPConnectionFactory@7df87df8
[6/3/11 10:14:43:140 PDT] 00000016 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet ibmsap1 in application ibmsapEAR. Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
at com.ibm.j2ca.sap.SAPManagedConnectionFactory.createManagedConnection(SAPManagedConnectionFactory.java:72)
at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2032)
at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1709)
at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2465)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1057)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:696)
at com.ibm.j2ca.base.WBIConnectionFactory.getConnection(WBIConnectionFactory.java:74)
at com.adp.sapadapter.poc.TestServlet.doGet(TestServlet.java:33)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1589)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:870)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3799)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:930)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:182)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: java.lang.ClassNotFoundException: com.sap.mw.jco.JCO$Exception
at java.net.URLClassLoader.findClass(URLClassLoader.java:421)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:90)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
... 35 more


I have no clue as to why this is happening...Please advice


SCJP, SCWCD, SCEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception created : java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO$Exception
 
Similar Threads
Application throwing exception
Installing axis2 (1.5.1) in Websphere 7
Business Objects XIR2 in Websphere 7 error
Hibernate in RAD 7 on WAS 6.1 server. getting asm.jar related error
Help - Problems with redirect in servlet filter in my JSF web app