WSO2Carbon3.0.0からCarbon4.0.3にアップグレードしようとしています。Carbon 3.0.0を使用すると、必要な機能をインストールした後、外部Javaライブラリを呼び出すことができるJavaScriptマッシュアップサービスを作成できます。WSO2carbonはRhinoを使用するため、importPackageを使用できます。Carbon4.0.3で同じ機能を動作させることができませんでした。
私が従った手順は次のとおりです。
- WSO2Carbon4.0.3をダウンロードして解凍します
- カーボンを開始
- [機能管理]ページに移動します
- 4.0.3 Carbon p2リポジトリを追加します(http://dist.wso2.org/p2/carbon/releases/4.0.3/)
- 「アプリケーションサーバー」機能を検索してインストールします
- Carbonを再起動します
- テストMashupサービスをデプロイします
- 「tryit」ツールを使用して、テストMashupサービスのエコー操作を実行します。
私のテストマッシュアップサービス(TestMashup.js):
this.serviceName = "TestMashup";
echo.inputTypes = "#raw";
echo.outputType = "#raw";
function echo(parameter) {
var javaDate = new Packages.java.util.Date();
var response = "<echo><value>" + parameter.toXMLString() + "</value><timestamp>" + javaDate.getTime() + "</timestamp></echo>";
return new XML(response);
}
このマッシュアップサービスをCARBON_HOME/repository / deployment / server / jsservices /admin/にインストールしました
Carbon 3.0.0でこの操作を実行すると、次の応答が返されます。
<echo>
<value>
<r>test</r>
</value>
<timestamp>1360699125311</timestamp>
</echo>
Carbon 4.0.3でこの操作を実行しようとすると、次のスタックトレースが表示されます。
[2013-02-12 14:46:32,511] ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} - org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined.(//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
[2013-02-12 14:46:32,512] ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} - org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined. (//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
[2013-02-12 14:46:32,512] ERROR {org.apache.axis2.receivers.AbstractMessageReceiver} - org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined. (//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
org.apache.axis2.AxisFault: org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined.(//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.wso2.carbon.mashup.javascript.messagereceiver.JavaScriptEngine.call(JavaScriptEngine.java:176)
at org.wso2.carbon.mashup.javascript.messagereceiver.JavaScriptEngine.call(JavaScriptEngine.java:208)
at org.wso2.carbon.mashup.javascript.messagereceiver.JavaScriptReceiver.invokeBusinessLogic(JavaScriptReceiver.java:185)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:231)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.equinox.http.helper.FilterServletAdaptor$FilterChainImpl.doFilter(FilterServletAdaptor.java:56)
at org.wso2.carbon.mashup.jsservices.custom.ui.CustomUIServletFilter.doFilter(CustomUIServletFilter.java:233)
at org.eclipse.equinox.http.helper.FilterServletAdaptor.service(FilterServletAdaptor.java:37)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:172)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.jaggeryjs.scriptengine.exceptions.ScriptException: org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined. (//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execFunc(RhinoEngine.java:383)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.call(RhinoEngine.java:251)
at org.wso2.carbon.mashup.javascript.messagereceiver.JavaScriptEngine.call(JavaScriptEngine.java:169)
... 40 more
Caused by: org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined. (//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execFunc(RhinoEngine.java:401)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execFunc(RhinoEngine.java:380)
... 42 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "Packages" is not defined. (//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js#6)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3557)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3535)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3620)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1652)
at org.jaggeryjs.rhino.c0._c1(//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js:6)
at org.jaggeryjs.rhino.c0.call(//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003)
at org.jaggeryjs.rhino.c0.call(//C:\WSO2CA~1\WSO2CA~1.3\bin\..\repository\deployment\server\jsservices\admin\TestMashup.js)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execFunc(RhinoEngine.java:398)
... 43 more
JavaScriptマッシュアップサービスからJavaライブラリを引き続き使用できるように、これを修正するにはどうすればよいですか?