2

IBM MobileFirst Platform Studio (v6.3 - 以前の IBM Worklight) を使用してハイブリッド アプリケーションを開発しています。

OUT パラメータを含む Oracle ストアド PL/SQL プロシージャを呼び出す必要があるため、ここで提供されるソリューションを使用しました。ストアド プロシージャを呼び出すときに OUT パラメータを取得する方法は? - Java でストアド プロシージャを呼び出し、アダプタ プロシージャから Java クラスを呼び出します。

StoredProcedure.java src ファイルをプロジェクト内の server/java フォルダーに追加しました。また、commons-dbutils-1.6.jar と ojdbc6.jar を server/lib フォルダーに追加しました。StoredProcedure クラスは保存時にビルドされ、MobileFirst Development サーバーにデプロイされます。また、server.xml で必要なデータソースを定義しましたが、実装したアダプター・プロシージャーをテストしようとすると (アダプターの Run as -> Deploy MobileFirstAdapter を右クリックし、アダプターの Run as -> Invoke MobileFirst Procedure を R-Click)、このエラーが発生します。メッセージ:

[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

バックエンド サービスが commons-dbutils-1.6.jar を見つけるには、他に何をすればよいですか?

Oracle Server 11gに接続して、64ビットJava v1.7.0.72を搭載したWindows 7 64ビットでEclipseバージョン:Luna Service Release 1(4.4.1)を実行しています。

4

1 に答える 1

1

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

<workspace>/WorklightServerConfig/shared/resources

which maps to the following variable in the server.xml

${shared.resource.dir}

then define the oracle lib, I have the ojdbc6.jar in a sub-directory named oracle

<library id="ORACLE_LIB">
    <fileset dir="${shared.resource.dir}/oracle" includes="*.jar"/>
</library>

<connectionManager id="OraclePool" maxPoolSize="40" minPoolSize="10"/>

<dataSource id="mobileDatasource" jndiName="jdbc/mobile__datasource">
    <jdbcDriver libraryRef="ORACLE_LIB"/>
    <properties.oracle URL="jdbc:oracle:thin:@..." password="..." user="..."/>
</dataSource>
于 2014-12-08T14:10:02.780 に答える