You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Pasha Shabalin <ls...@gmail.com> on 2005/03/21 18:36:48 UTC
array of complex types as return value
Hello,
I am having a problem here which keeps me busy for three days already, will
be grateful for any help.
A working example which the same (implements MyClass [] MySoapFunction(.))
would be cool.
Thanks, details below:
I have created a class:
public class AxisItemService extends ServletEndpointSupport implements
IItemService {
.
public SmallItem[] getSmallItem(long parentCategory) {
return itemService.getSmallItem(parentCategory);
}
public ItemCategory [] getSubCategories(long parentCategory) {
return itemService.getSubCategories(parentCategory);
}
public Item [] getItems(long parentCategory) {
return itemService.getItems(parentCategory);
}
}
And use it to create WSDL (resulted file attached):
<axis-java2wsdl
classname="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"
output="ItemService.wsdl"
location="http://localhost:8080/otf/services/ItemService"
namespace="urn:OpenTradingFramework">
<classpath>
<pathelement path="${build.dir}"/>
</classpath>
</axis-java2wsdl>
Further I start axis in own servlet:
WEB.XML:
<web-app>
.
<servlet>
<servlet-name>axis</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
.
</web-app>
With the server config file server-config.wsdd:
<deployment>
..
<service name="ItemService" provider="java:RPC">
<parameter name="className"
value="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"/>
<parameter name="allowedMethods" value="*"/>
<beanMapping qname="myNs:Item"
xmlns:myNs="urn:OpenTradingFramework"
languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.Item"/>
<beanMapping qname="myNs:ItemCategory"
xmlns:myNs="urn:OpenTradingFramework"
languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.ItemCateg
ory"/>
<beanMapping qname="myNs:SmallItem"
xmlns:myNs="urn:OpenTradingFramework"
languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.SmallItem
"/>
</service>
...
</deployment>
Then I generate client files:
<axis-wsdl2java url="${wsdl.dir}/ItemService.wsdl"
output="${src.java}"
serverSide="false"
noimports="false"
verbose="false"
testcase="false">
<mapping namespace="http://soapinterop.org/"
package="de.tum.in.ibis.otf.backend.axis_generated"/>
<mapping namespace="http://soapinterop.org/xsd"
package="de.tum.in.ibis.otf.backend.axis_generated"/>
<mapping namespace="urn:OpenTradingFramework"
package="de.tum.in.ibis.otf.backend.axis_generated"/>
</axis-wsdl2java>
And use them to call the server.
In the client process, I am getting an exception:
Precisely, it happens in the org.apache.axis.utils.JavaUtils.convert, here:
array[idx++] = convert(i.next(),
destClass.getComponentType());
stack trace:
Thread [main] (Suspended)
JavaUtils.convert(Object, Class) line: 412
Call.invoke(RPCElement) line: 2507
Call.invoke(String, String, Object[]) line: 2336
Call.invoke(Object[]) line: 1793
ItemServiceSoapBindingStub.getSmallItem(long) line: 249
TreeObjectCategory.fillChildren() line: 54
ContentProvider.initialize() line: 60
ContentProvider.getElements(Object) line: 24
TreeViewer(StructuredViewer).getRawChildren(Object) line: 766
TreeViewer(AbstractTreeViewer).getRawChildren(Object) line: 747
TreeViewer(StructuredViewer).getFilteredChildren(Object) line:
708
TreeViewer(StructuredViewer).getSortedChildren(Object) line: 823
AbstractTreeViewer$1.run() line: 381
BusyIndicator.showWhile(Display, Runnable) line: 69
TreeViewer(AbstractTreeViewer).createChildren(Widget) line: 363
AbstractTreeViewer$5.run() line: 834
TreeViewer(StructuredViewer).preservingSelection(Runnable) line:
1109
TreeViewer(AbstractTreeViewer).inputChanged(Object, Object)
line: 824
TreeViewer(ContentViewer).setInput(Object) line: 248
TreeViewer(StructuredViewer).setInput(Object) line: 1323
ItemsTreeView.createPartControl(Composite) line: 33
PartPane$2.run() line: 148
InternalPlatform.run(ISafeRunnable) line: 1015
Platform.run(ISafeRunnable) line: 757
ViewPane(PartPane).doCreateChildControl() line: 144
ViewPane.doCreateChildControl() line: 135
ViewPane(PartPane).createChildControl() line: 349
ViewPane(PartPane).createControl(Composite) line: 218
ViewPane.createControl(Composite) line: 124
ViewFactory$1.run() line: 403
InternalPlatform.run(ISafeRunnable) line: 1015
Platform.run(ISafeRunnable) line: 757
ViewFactory.busyRestoreView(IViewReference) line: 289
ViewFactory$2.run() line: 589
BusyIndicator.showWhile(Display, Runnable) line: 69
ViewFactory.restoreView(IViewReference) line: 586
ViewFactory$ViewReference.getPart(boolean) line: 108
ViewFactory$ViewReference.getView(boolean) line: 178
WorkbenchPage.restoreState(IMemento, IPerspectiveDescriptor)
line: 2627
WorkbenchWindow.restoreState(IMemento, IPerspectiveDescriptor)
line: 1711
Workbench.restoreState(IMemento) line: 1453
Workbench.access$9(Workbench, IMemento) line: 1409
Workbench$14.run() line: 1312
InternalPlatform.run(ISafeRunnable) line: 1015
Platform.run(ISafeRunnable) line: 757
Workbench.restoreState() line: 1246
WorkbenchConfigurer.restoreState() line: 171
IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 711
Workbench.init(Display) line: 918
Workbench.runUI() line: 1554
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
293
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
line: 144
IDEApplication.run(Object) line: 102
PlatformActivator$1.run(Object) line: 228
EclipseStarter.run(Object) line: 333
EclipseStarter.run(String[], Runnable) line: 150
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object............) line: 585
Main.invokeFramework(String[], URL[]) line: 268
Main.basicRun(String[]) line: 260
Main.run(String[]) line: 887
Main.main(String[]) line: 871
Waiting for any hints.
RE: array of complex types as return value
Posted by Pasha Shabalin <ls...@gmail.com>.
Sorry...:
java.lang.ArrayStoreException:
org.apache.axis.encoding.ser.ArrayDeserializer$ArrayListExtension
(Assignment:
SmallItem array[0] = ArrayDeserializer$ArrayListExtension)
On the attached JPEG one can see what happens just before crash. After
returning ( return destValue; ) we come to the line
array[idx++] = convert(i.next(),
destClass.getComponentType());
where exception is triggered (both locations are from JavaUtils.java).
I am using axis1_2RC3
thanks
> What is the exception?
On Mon, 21 Mar 2005 18:36:48 +0100, Pasha Shabalin <ls...@gmail.com>
wrote:
>
>
>
> Hello,
>
>
>
> I am having a problem here which keeps me busy for three days already,
will
> be grateful for any help.
>
> A working example which the same (implements MyClass [] MySoapFunction(.))
> would be cool.
>
>
>
> Thanks, details below:
>
>
>
>
>
> I have created a class:
>
>
>
> public class AxisItemService extends ServletEndpointSupport implements
> IItemService {
>
> .
>
> public SmallItem[] getSmallItem(long parentCategory) {
>
> return itemService.getSmallItem(parentCategory);
>
> }
>
> public ItemCategory [] getSubCategories(long parentCategory) {
>
> return
itemService.getSubCategories(parentCategory);
>
> }
>
> public Item [] getItems(long parentCategory) {
>
> return itemService.getItems(parentCategory);
>
> }
>
> }
>
>
>
> And use it to create WSDL (resulted file attached):
>
> <axis-java2wsdl
>
>
> classname="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"
>
> output="ItemService.wsdl"
>
>
> location="http://localhost:8080/otf/services/ItemService"
>
> namespace="urn:OpenTradingFramework">
>
> <classpath>
>
> <pathelement path="${build.dir}"/>
>
> </classpath>
>
> </axis-java2wsdl>
>
>
>
> Further I start axis in own servlet:
>
>
>
> WEB.XML:
>
> <web-app>
>
> .
>
> <servlet>
>
> <servlet-name>axis</servlet-name>
>
>
> <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
>
> <load-on-startup>5</load-on-startup>
>
> </servlet>
>
> .
>
> </web-app>
>
>
>
>
>
> With the server config file server-config.wsdd:
>
>
>
> <deployment>
>
> ..
>
> <service name="ItemService" provider="java:RPC">
>
> <parameter name="className"
> value="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"/>
>
> <parameter name="allowedMethods" value="*"/>
>
>
>
> <beanMapping qname="myNs:Item"
> xmlns:myNs="urn:OpenTradingFramework"
> languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.Item"/>
>
> <beanMapping qname="myNs:ItemCategory"
> xmlns:myNs="urn:OpenTradingFramework"
>
languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.ItemCateg
ory"/>
>
> <beanMapping qname="myNs:SmallItem"
> xmlns:myNs="urn:OpenTradingFramework"
>
languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.SmallItem
"/>
>
> </service>
>
> ...
>
> </deployment>
>
>
>
>
>
> Then I generate client files:
>
> <axis-wsdl2java url="${wsdl.dir}/ItemService.wsdl"
>
> output="${src.java}"
>
> serverSide="false"
>
> noimports="false"
>
> verbose="false"
>
> testcase="false">
>
> <mapping namespace="http://soapinterop.org/"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> <mapping namespace="http://soapinterop.org/xsd"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> <mapping namespace="urn:OpenTradingFramework"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> </axis-wsdl2java>
>
>
>
> And use them to call the server.
>
>
>
>
>
> In the client process, I am getting an exception:
>
>
>
>
>
>
>
> Precisely, it happens in the org.apache.axis.utils.JavaUtils.convert,
here:
>
> array[idx++] = convert(i.next(),
>
> destClass.getComponentType());
>
>
>
> stack trace:
>
>
>
> Thread [main] (Suspended)
>
> JavaUtils.convert(Object, Class) line: 412
>
> Call.invoke(RPCElement) line: 2507
>
> Call.invoke(String, String, Object[]) line: 2336
>
> Call.invoke(Object[]) line: 1793
>
> ItemServiceSoapBindingStub.getSmallItem(long) line: 249
>
> TreeObjectCategory.fillChildren() line: 54
>
> ContentProvider.initialize() line: 60
>
> ContentProvider.getElements(Object) line: 24
>
> TreeViewer(StructuredViewer).getRawChildren(Object) line: 766
>
> TreeViewer(AbstractTreeViewer).getRawChildren(Object) line:
747
>
> TreeViewer(StructuredViewer).getFilteredChildren(Object) line:
> 708
>
> TreeViewer(StructuredViewer).getSortedChildren(Object) line:
823
>
> AbstractTreeViewer$1.run() line: 381
>
> BusyIndicator.showWhile(Display, Runnable) line: 69
>
> TreeViewer(AbstractTreeViewer).createChildren(Widget) line:
363
>
> AbstractTreeViewer$5.run() line: 834
>
> TreeViewer(StructuredViewer).preservingSelection(Runnable)
line:
> 1109
>
> TreeViewer(AbstractTreeViewer).inputChanged(Object, Object)
> line: 824
>
> TreeViewer(ContentViewer).setInput(Object) line: 248
>
> TreeViewer(StructuredViewer).setInput(Object) line: 1323
>
> ItemsTreeView.createPartControl(Composite) line: 33
>
> PartPane$2.run() line: 148
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> ViewPane(PartPane).doCreateChildControl() line: 144
>
> ViewPane.doCreateChildControl() line: 135
>
> ViewPane(PartPane).createChildControl() line: 349
>
> ViewPane(PartPane).createControl(Composite) line: 218
>
> ViewPane.createControl(Composite) line: 124
>
> ViewFactory$1.run() line: 403
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> ViewFactory.busyRestoreView(IViewReference) line: 289
>
> ViewFactory$2.run() line: 589
>
> BusyIndicator.showWhile(Display, Runnable) line: 69
>
> ViewFactory.restoreView(IViewReference) line: 586
>
> ViewFactory$ViewReference.getPart(boolean) line: 108
>
> ViewFactory$ViewReference.getView(boolean) line: 178
>
> WorkbenchPage.restoreState(IMemento, IPerspectiveDescriptor)
> line: 2627
>
> WorkbenchWindow.restoreState(IMemento, IPerspectiveDescriptor)
> line: 1711
>
> Workbench.restoreState(IMemento) line: 1453
>
> Workbench.access$9(Workbench, IMemento) line: 1409
>
> Workbench$14.run() line: 1312
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> Workbench.restoreState() line: 1246
>
> WorkbenchConfigurer.restoreState() line: 171
>
> IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 711
>
> Workbench.init(Display) line: 918
>
> Workbench.runUI() line: 1554
>
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
line:
> 293
>
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 144
>
> IDEApplication.run(Object) line: 102
>
> PlatformActivator$1.run(Object) line: 228
>
> EclipseStarter.run(Object) line: 333
>
> EclipseStarter.run(String[], Runnable) line: 150
>
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
line:
> not available [native method]
>
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
>
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
>
> Method.invoke(Object, Object............) line: 585
>
> Main.invokeFramework(String[], URL[]) line: 268
>
> Main.basicRun(String[]) line: 260
>
> Main.run(String[]) line: 887
>
> Main.main(String[]) line: 871
>
>
>
>
>
> Waiting for any hints.
>
Re: array of complex types as return value
Posted by Anne Thomas Manes <at...@gmail.com>.
What is the exception?
On Mon, 21 Mar 2005 18:36:48 +0100, Pasha Shabalin <ls...@gmail.com> wrote:
>
>
>
> Hello,
>
>
>
> I am having a problem here which keeps me busy for three days already, will
> be grateful for any help.
>
> A working example which the same (implements MyClass [] MySoapFunction(…))
> would be cool…
>
>
>
> Thanks, details below:
>
>
>
>
>
> I have created a class:
>
>
>
> public class AxisItemService extends ServletEndpointSupport implements
> IItemService {
>
> …
>
> public SmallItem[] getSmallItem(long parentCategory) {
>
> return itemService.getSmallItem(parentCategory);
>
> }
>
> public ItemCategory [] getSubCategories(long parentCategory) {
>
> return itemService.getSubCategories(parentCategory);
>
> }
>
> public Item [] getItems(long parentCategory) {
>
> return itemService.getItems(parentCategory);
>
> }
>
> }
>
>
>
> And use it to create WSDL (resulted file attached):
>
> <axis-java2wsdl
>
>
> classname="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"
>
> output="ItemService.wsdl"
>
>
> location="http://localhost:8080/otf/services/ItemService"
>
> namespace="urn:OpenTradingFramework">
>
> <classpath>
>
> <pathelement path="${build.dir}"/>
>
> </classpath>
>
> </axis-java2wsdl>
>
>
>
> Further I start axis in own servlet:
>
>
>
> WEB.XML:
>
> <web-app>
>
> …
>
> <servlet>
>
> <servlet-name>axis</servlet-name>
>
>
> <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
>
> <load-on-startup>5</load-on-startup>
>
> </servlet>
>
> …
>
> </web-app>
>
>
>
>
>
> With the server config file server-config.wsdd:
>
>
>
> <deployment>
>
> ….
>
> <service name="ItemService" provider="java:RPC">
>
> <parameter name="className"
> value="de.tum.in.ibis.otf.backend.remoting.axis.AxisItemService"/>
>
> <parameter name="allowedMethods" value="*"/>
>
>
>
> <beanMapping qname="myNs:Item"
> xmlns:myNs="urn:OpenTradingFramework"
> languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.Item"/>
>
> <beanMapping qname="myNs:ItemCategory"
> xmlns:myNs="urn:OpenTradingFramework"
> languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.ItemCategory"/>
>
> <beanMapping qname="myNs:SmallItem"
> xmlns:myNs="urn:OpenTradingFramework"
> languageSpecificType="java:de.tum.in.ibis.otf.backend.database.dao.SmallItem"/>
>
> </service>
>
> …..
>
> </deployment>
>
>
>
>
>
> Then I generate client files:
>
> <axis-wsdl2java url="${wsdl.dir}/ItemService.wsdl"
>
> output="${src.java}"
>
> serverSide="false"
>
> noimports="false"
>
> verbose="false"
>
> testcase="false">
>
> <mapping namespace="http://soapinterop.org/"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> <mapping namespace="http://soapinterop.org/xsd"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> <mapping namespace="urn:OpenTradingFramework"
> package="de.tum.in.ibis.otf.backend.axis_generated"/>
>
> </axis-wsdl2java>
>
>
>
> And use them to call the server…
>
>
>
>
>
> In the client process, I am getting an exception:
>
>
>
>
>
>
>
> Precisely, it happens in the org.apache.axis.utils.JavaUtils.convert, here:
>
> array[idx++] = convert(i.next(),
>
> destClass.getComponentType());
>
>
>
> stack trace:
>
>
>
> Thread [main] (Suspended)
>
> JavaUtils.convert(Object, Class) line: 412
>
> Call.invoke(RPCElement) line: 2507
>
> Call.invoke(String, String, Object[]) line: 2336
>
> Call.invoke(Object[]) line: 1793
>
> ItemServiceSoapBindingStub.getSmallItem(long) line: 249
>
> TreeObjectCategory.fillChildren() line: 54
>
> ContentProvider.initialize() line: 60
>
> ContentProvider.getElements(Object) line: 24
>
> TreeViewer(StructuredViewer).getRawChildren(Object) line: 766
>
> TreeViewer(AbstractTreeViewer).getRawChildren(Object) line: 747
>
> TreeViewer(StructuredViewer).getFilteredChildren(Object) line:
> 708
>
> TreeViewer(StructuredViewer).getSortedChildren(Object) line: 823
>
> AbstractTreeViewer$1.run() line: 381
>
> BusyIndicator.showWhile(Display, Runnable) line: 69
>
> TreeViewer(AbstractTreeViewer).createChildren(Widget) line: 363
>
> AbstractTreeViewer$5.run() line: 834
>
> TreeViewer(StructuredViewer).preservingSelection(Runnable) line:
> 1109
>
> TreeViewer(AbstractTreeViewer).inputChanged(Object, Object)
> line: 824
>
> TreeViewer(ContentViewer).setInput(Object) line: 248
>
> TreeViewer(StructuredViewer).setInput(Object) line: 1323
>
> ItemsTreeView.createPartControl(Composite) line: 33
>
> PartPane$2.run() line: 148
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> ViewPane(PartPane).doCreateChildControl() line: 144
>
> ViewPane.doCreateChildControl() line: 135
>
> ViewPane(PartPane).createChildControl() line: 349
>
> ViewPane(PartPane).createControl(Composite) line: 218
>
> ViewPane.createControl(Composite) line: 124
>
> ViewFactory$1.run() line: 403
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> ViewFactory.busyRestoreView(IViewReference) line: 289
>
> ViewFactory$2.run() line: 589
>
> BusyIndicator.showWhile(Display, Runnable) line: 69
>
> ViewFactory.restoreView(IViewReference) line: 586
>
> ViewFactory$ViewReference.getPart(boolean) line: 108
>
> ViewFactory$ViewReference.getView(boolean) line: 178
>
> WorkbenchPage.restoreState(IMemento, IPerspectiveDescriptor)
> line: 2627
>
> WorkbenchWindow.restoreState(IMemento, IPerspectiveDescriptor)
> line: 1711
>
> Workbench.restoreState(IMemento) line: 1453
>
> Workbench.access$9(Workbench, IMemento) line: 1409
>
> Workbench$14.run() line: 1312
>
> InternalPlatform.run(ISafeRunnable) line: 1015
>
> Platform.run(ISafeRunnable) line: 757
>
> Workbench.restoreState() line: 1246
>
> WorkbenchConfigurer.restoreState() line: 171
>
> IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 711
>
> Workbench.init(Display) line: 918
>
> Workbench.runUI() line: 1554
>
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
> 293
>
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor)
> line: 144
>
> IDEApplication.run(Object) line: 102
>
> PlatformActivator$1.run(Object) line: 228
>
> EclipseStarter.run(Object) line: 333
>
> EclipseStarter.run(String[], Runnable) line: 150
>
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
> not available [native method]
>
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
>
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
>
> Method.invoke(Object, Object............) line: 585
>
> Main.invokeFramework(String[], URL[]) line: 268
>
> Main.basicRun(String[]) line: 260
>
> Main.run(String[]) line: 887
>
> Main.main(String[]) line: 871
>
>
>
>
>
> Waiting for any hints…
>