Hi all,
on the client side, the following exception is thrown:
Exception in thread "main" java.lang.NullPointerException
at herbieclient.test.holeBenutzer(test.java:73)
at herbieclient.test.main(test.java:28)
Line 73: System.out.println(buddies1.getName());
On the server side no exception is thrown.
Now, in order to understand the problem I have added the following code in
the server class right after the server code described in my first mail:
//Setting the OMElement in the UserDesktopBean
bean.setBuddies(omElementBUD);
new:
HerbieObjectDesktopBean[] budtest = (HerbieObjectDesktopBean[])
BeanUtil.deserialize(omElementBUD, new
Object[]{HerbieObjectDesktopBean.class},new
AxisService().getObjectSupplier());
System.out.println(budtest.length);
Now, the following exception is thrown on the server side:
java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMDocumentImpl
at
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:423)
at herbie.core.desktop.handler.UserHandler.get(UserHandler.java:255)
at
herbie.core.desktop.handler.HerbieWSSkeleton.UserGet(HerbieWSSkeleton.java:8
6)
at
herbie.core.desktop.handler.HerbieWSMessageReceiverInOut.invokeBusinessLogic
(HerbieWSMessageReceiverInOut.java:74)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstract
InOutSyncMessageReceiver.java:39)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:319)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:247)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
herbie.core.gui.filter.CharsetFilter.doFilter(CharsetFilter.java:27)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
Regards,
Sven
_____
Von: Yadav, Yogendra (IT) [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 9. Januar 2007 18:16
An: [email protected]
Betreff: RE: [Axis2] Converting an OMElement into an Array of Objects
what is the exception ?
_____
From: Sven Schroebler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 09, 2007 12:04 PM
To: [email protected]
Subject: [Axis2] Converting an OMElement into an Array of Objects
Hi All,
I am quite new to Axis2 and I am trying to develop a webservice for an
existing webapplication.
So far I managed to set up a basic webservice that transfers JavaBeans (e.g.
"UserDesktopBean") and it possible to access all of the simple data types
from the client application. Unfortunately, even after reading multiple
AXIOM tutorials, I don't know how to correctly work with the JavaBeans
nested inside the "UserDesktopBeans" that need to be transferred as via
AXIOM OMElement-wrapping.
At this time I use the following code to return an array of Objects as an
OMElement:
SERVER:
###########
//Converting an ArrayList to Array
Object[] budlist = buddies.toArray();
QName budQName = new QName("http://desktop.core.herbie.buddies","buddies");
OMElement omElementBUD = BeanUtil.getOMElement(budQName, budlist, null,
false, null);
//Setting the OMElement in the UserDesktopBean
bean.setBuddies(omElementBUD);
CLIENT:
############
//here I am trying to transform the array back
OMElement _buddies = benutzer.getBuddies();
ObjectSupplier os = new AxisService().getObjectSupplier();
Object[] budlist=new Object[]{HerbieWSStub.HerbieObjectDesktopBean.class};
Object[] buddies = BeanUtil.deserialize(_buddies,budlist,os);
//here I am trying to access the first array element
HerbieWSStub.HerbieObjectDesktopBean buddies1 =
(HerbieWSStub.HerbieObjectDesktopBean) buddies[0];
System.out.println(buddies1.getName());
Trying to access the array leads to an Exception at this time.
I would really appreciate, if you could help me with this problem.
For a better understanding of the underlying webservice, I've attached the
UserDesktopBean, the WSDL-File and the services.xml
Best Regards,
Sven
_____
NOTICE: If received in error, please destroy and notify sender. Sender does
not intend to waive confidentiality or privilege. Use of this email is
prohibited when received in error.