I'm developing hybrid application using IBM MobileFirst Platform Studio (v6.3 - former IBM Worklight).
Since there is a requirement to call Oracle stored PL/SQL procedures which contain OUT params I used a solution offered here How to get OUT parameter when invoking a stored procedure? - calling stored procedure in java and calling java class from adapter procedure.
I added StoredProcedure.java src file to server/java folder inside my project. I also added commons-dbutils-1.6.jar and ojdbc6.jar to server/lib folder. StoredProcedure class got built on save and deployed on MobileFirst Development server. I also defined needed datasource in server.xml but when I try to test the adapter procedure I implemented (R-click on adapter Run as -> Deploy MobileFirstAdapter, R-Click on adapter Run as -> Invoke MobileFirst Procedure) I get this error message:
[ERROR ] FWLSE0099E: An error occurred while invoking procedure [project MxP]StoredProcedure/pretragaVozilaFWLSE0100E: parameters: [project MxP]
invocation of javascript function 'pretragaVozila' has failed: ResultSetHandler
FWLSE0101E: Caused by: [project MxP]java.lang.NoClassDefFoundError: ResultSetHandlerjava.lang.RuntimeException:
invocation of javascript function 'pretragaVozila' has failed: ResultSetHandler
at com.worklight.integration.js.JavaScriptProcedureInvoker.invoke(JavaScriptProcedureInvoker.java:52)
at com.worklight.integration.model.ProcedureInvoker.invokeProcedure(ProcedureInvoker.java:54)
at com.worklight.integration.model.Procedure.invoke(Procedure.java:166)
at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedureInternal(DataAccessServiceImpl.java:593)
at com.worklight.integration.services.impl.DataAccessServiceImpl.callProcedure(DataAccessServiceImpl.java:539)
at com.worklight.integration.services.impl.DataAccessServiceImpl.access$100(DataAccessServiceImpl.java:58)
at com.worklight.integration.services.impl.DataAccessServiceImpl$3.execute(DataAccessServiceImpl.java:433)
at com.worklight.core.auth.impl.AuthenticationServiceBean.accessResource(AuthenticationServiceBean.java:76)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedureInternal(DataAccessServiceImpl.java:430)
at com.worklight.integration.services.impl.DataAccessServiceImpl.invokeProcedure(DataAccessServiceImpl.java:139)
at com.worklight.server.dev.InvokeProcedureHandler.handle(InvokeProcedureHandler.java:85)
at com.worklight.server.dev.DevRootServlet.service(DevRootServlet.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1274)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:767)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:469)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:127)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:88)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:151)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:85)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:968)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1056)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4553)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:301)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:954)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:266)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:776)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: ResultSetHandler
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getDeclaredMethods(Class.java:1860)
at org.mozilla.javascript.JavaMembers.discoverAccessibleMethods(JavaMembers.java:315)
at org.mozilla.javascript.JavaMembers.discoverAccessibleMethods(JavaMembers.java:302)
at org.mozilla.javascript.JavaMembers.reflect(JavaMembers.java:419)
at org.mozilla.javascript.JavaMembers.<init>(JavaMembers.java:43)
at org.mozilla.javascript.JavaMembers.lookupClass(JavaMembers.java:807)
at org.mozilla.javascript.NativeJavaClass.initMembers(NativeJavaClass.java:49)
at org.mozilla.javascript.NativeJavaObject.<init>(NativeJavaObject.java:44)
at org.mozilla.javascript.NativeJavaClass.<init>(NativeJavaClass.java:43)
at org.mozilla.javascript.NativeJavaClass.<init>(NativeJavaClass.java:39)
at org.mozilla.javascript.WrapFactory.wrapJavaClass(WrapFactory.java:134)
at org.mozilla.javascript.NativeJavaPackage.getPkgProperty(NativeJavaPackage.java:133)
at org.mozilla.javascript.NativeJavaPackage.get(NativeJavaPackage.java:82)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2184)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1492)
at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1485)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1239)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at com.worklight.integration.js.JavaScriptManager.callFunction(JavaScriptManager.java:267)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:241)
at com.worklight.integration.js.JavaScriptManager.invokeFunction(JavaScriptManager.java:211)
at com.worklight.integration.services.impl.AdapterManagerImpl.invokeFunction(AdapterManagerImpl.java:124)
at com.worklight.integration.js.JavaScriptProcedureInvoker.invoke(JavaScriptProcedureInvoker.java:42)
... 30 more
Caused by: java.lang.ClassNotFoundException: ResultSetHandler
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:436)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:411)
... 59 more
com.worklight.common.log.filters.ErrorFilter
What else should I do so that backend service finds commons-dbutils-1.6.jar ?
I'm running Eclipse Version: Luna Service Release 1 (4.4.1) on Windows 7 64bit with 64bit Java v1.7.0.72, connecting to Oracle Server 11g.
Dropping the necessary jars in the server/lib dir hasn't worked for me. I have to copy the required jars (dbutils) and the custom jar created for calling the stored proc in the following dir in the Eclipse workspace relative to the WorklightServerConfig
which maps to the following variable in the server.xml
then define the oracle lib, I have the ojdbc6.jar in a sub-directory named oracle