Technical Blog Post
Abstract
Classnotfound exception during webservice build
Body
The application threw an error - ClassNotFoundException when trying to build 9.3 smcfs.ear which included some EJB web services.
[exec] Current OS is Linux
[exec] Executing '/opt/ibm/WebSphere/AppServer85/bin/Java2WSDL.sh'
with arguments:
[exec] '-output'
[exec] '/app/yantra/SMCFS/tmp/webservice/META-
INF/wsdl/YIFWebService.wsdl'
[exec] '-implClass'
[exec] 'com.yantra.interop.services.webservices.rpc.ejb.
YIFWebServiceAdapter'
[exec] '-style'
[exec] 'document'
[exec] '-use'
[exec] 'literal'
[exec] '-location'
[exec] 'http://localhost:
9081/smcfswebservices/services/YIFWebService'
[exec] '-classpath'
[exec] '/app/yantra/SMCFS/tmp/smcfs/smcfswsbe.jar:
/app/yantra/SMCFS/dbjar/jdbc/Oracle/ojdbc6.jar:
/app/yantra/SMCFS/jar/icu4j/49_1/icu4j-
.
. (truncated)
.
.
[exec] 'com.yantra.interop.services.webservices.rpc.ejb.
YIFWebService'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
[exec] WSWS3752I: (C) COPYRIGHT International Business Machines
Corp. 1997, 2010.
[exec] WSWS3753I: IBM WebSphere Application Server Release 8.0
[exec] WSWS3754I: Web services Java2WSDL emitter.
[exec] java.io.IOException: java.lang.ClassNotFoundException: com.
yantra.interop.services.webservices.rpc.ejb.YIFWebService
[exec] at com.ibm.ws.webservices.wsdl.fromJava.Emitter.init
(Emitter.java:816)
[exec] at com.ibm.ws.webservices.wsdl.fromJava.Emitter.getWSDL
(Emitter.java:681)
[exec] at com.ibm.ws.webservices.wsdl.fromJava.Emitter.emit
(Emitter.java:611)
Cause of the issue:
The ear was built with IBM SDK 1.7, But WAS JAVA_HOME points to java 1.6 in Java2WSDL.sh.
Solution:
Set JAVA_HOME to 1.7 in Java2WSDL.sh.
UID
ibm11124685