Thanks a lot Bob. I will try this for the List problem.
about my problem when sending back OkUser which contains other POJO
classes as OkService,
I found where it comes from.
Those object come from DB through Hibernate which proxy them.
Apparently the problem comes from the hibernate proxy and is then not
relative to axis2.
In order to find this, I did :
OkUser user1 = hibernatedao.getokuser();
OkUser user2 = new OkUser();
user2.setname(user1.getname());
....
OkService service2 = new OkService();
service2.setName(user1.getService().getName());
...
user2.setService(service2);
return user2;
With this, there is no problem retrieving those object trough axis2.
If anyone know how to 'unproxy' Hibernate object, I will be happy to know.
I was willing to clone() all hibernate class but as user is in a service
which
contains a collection of user, I will get in trouble.
This is not relative to axis2 but I will post if I find a solution as I
guess people
might have a similar situation.
Bob Rhodes wrote:
I had the exact same problem when returning a List of my HistoryItem
objects. I changed the code to return an HistoryItem[] instead of the
List and now it works fine. You might want to try that.
Bob
-----Original Message-----
From: Damien Sauvageot [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 15, 2007 4:19 AM
To: [email protected]
Subject: Re: [Axis2] Mapping qname not fond for the package
I made another test by removing all other services from okauth and
sending back a simple okuser.
It works fine.
If I try to send back a List of OkUser, I get the mapping problem again.
So I guess my problem is linked to the bug 2148.
Does that mean it is impossible to send back complex type or even a List
of sinple POJO?
The problem might come from the WSDL generation as when I send back a
List, I do not have any more reference to OkUser.
Damien
Damien Sauvageot wrote:
Hi Martin and thanks for your help,
I tried changing the endpoint and the result is the same.
I am surprised as the result is always the same using different
endpointreference as :
http://192.168.6.202:8182/josso/services/okauth/
http://192.168.6.202:8182/josso/services/okauth/getUserById
http://192.168.6.202:8182/josso/services/okauth/xxxx
The web services is always called as I can see the logs of the
getUserById function on the server side.
The problem is apparently in axis2 after calling the service when
generating the SOAP answer.
I suppose this means the problem is on the server side and not on the
client side.
The only relevant information I found on google is this one :
https://issues.apache.org/jira/browse/AXIS2-2148?page=com.atlassian.ji
ra.plugin.system.issuetabpanels:all-tabpanel
In order to be sure that my case is different, I modified OkUser in
order to be a simple pojo. see code below.
I also looked at org.apache.ws.java2wsdl.utils.TypeTable which does
not return any Qname when called through getQNamefortheType I guess
OkUser should be on the complex schema type.
I did not find where it should be added and how.
Thanks,
Damien
package com.ok.products.okauth.pojo;
public class OkBaseUser {
private Long id;
private String username;
private String password;
private String firstName;
private String lastName;
private String phoneNumber;
private String email;
public OkBaseUser() {
super();
}
public OkBaseUser(Long id, String username, String password,
String firstName, String lastName, String phoneNumber,
String email) {
super();
this.id = id;
this.username = username;
this.password = password;
this.firstName = firstName;
this.lastName = lastName;
this.phoneNumber = phoneNumber;
this.email = email;
}
public boolean equals(Object value) {
return super.equals(value);
}
public int hashCode() {
return super.hashCode();
}
public String toString() { return super.toString();
}
public Long getId() {
return this.id;
}
public void setId(Long value) {
this.id = value;
}
public String getUsername() {
return this.username;
}
public void setUsername(String value) {
this.username = value;
}
public String getPassword() {
return this.password;
}
public void setPassword(String value) {
this.password = value;
}
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String value) {
this.firstName = value;
}
public String getLastName() {
return this.lastName;
}
public void setLastName(String value) {
this.lastName = value;
}
public String getPhoneNumber() {
return this.phoneNumber;
}
public void setPhoneNumber(String value) {
this.phoneNumber = value;
}
public String getEmail() {
return this.email;
}
public void setEmail(String value) {
this.email = value;
}
}
Martin Gainty wrote:
Good Morning Damien--
Assuming you have OkUser class defined/compiled and on CLASSPATH and
okauth has getUserByID method which will return "toto" is
defined/compiled and is on CLASSPATH
The only item I see which may cause null return result is your
endpointReference declaration which is the name of the service e.g.
EndpointReference targetEPR = new EndpointReference(
"http://127.0.0.1:8080/axis2/services/AddressBookService");
AddressBookService is the name of the WS you are referencing
so in your situation
EndpointReference targetEPR = new
EndpointReference("http://192.168.6.202:8182/josso/services/okauth/ge
tUserById");
change to the actual name of the deployed service (assuming that
okauth is the name of the deployed service) EndpointReference
targetEPR = new
EndpointReference(http://192.168.6.202:8182/josso/services/okauth);
Martin--
This email message and any files transmitted with it contain
confidential information intended only for the person(s) to whom this
email message is addressed. If you have received this email message
in error, please notify the sender immediately by telephone or email
and destroy the original message without making a copy. Thank you.
----- Original Message ----- From: "Damien Sauvageot"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, May 14, 2007 11:07 AM
Subject: [Axis2] Mapping qname not fond for the package
Hi,
Could someone explain me the meaning of this error message.
It happens on the server side. I catched this error with tcpmon.
I firstly thought it was not able to load the return class type but
this class is in the classpath.
here is the client code which does not crash but result is null.
EndpointReference targetEPR = new
EndpointReference("http://192.168.6.202:8182/josso/services/okauth/g
etUserById");
Object[] Args = new Object[] { new String("toto") };
Class[] returnTypes = new Class[] { OkUser.class };
QName qname = new
QName("http://impl.service.okauth.products.ok.com/xsd",
"getUserById");
RPCServiceClient serviceClient =
this.getRPCServiceClient(targetEPR);
Object[] response2 = serviceClient.invokeBlocking(qname,
Args, returnTypes);
OkUser result = (OkUser) response2[0];
if (result == null) {
System.err.println("getUserById didn't initialize!");
}
System.err.println("result : " + result.getEmail());
OkUser class is a pojo class linked to others classes like OkUnit.
All classes are available in the classpath.
Thanks for helping me understanding what this mapping not found
means.
Damien Sauvageot
HTTP/1.1 500 Internal Server Error
Date: Mon, 14 May 2007 12:03:12 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_jk2/2.0.4 PHP/4.3.10-16
mod_ssl/2.0.54 OpenSSL/0.9.7e
Content-Type:
application/xml;action="http://www.w3.org/2005/08/addressing/soap/fa
ult";;charset=UTF-8
Connection: close
Transfer-Encoding: chunked
ec3
<Exception>org.apache.axis2.AxisFault: Exception occurred while
trying to invoke service method getUserById
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogi
c(RPCMessageReceiver.java:157)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(
AbstractInOutSyncMessageReceiver.java:39)
at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRe
quest(HTTPTransportUtils.java:279)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:
116)
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(App
licationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:105)
at
org.josso.tc55.agent.SSOAgentValve.invoke(SSOAgentValve.java:356)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:148)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.j
ava:678)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Thread
Pool.java:684)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.apache.axiom.om.OMException:
java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping
qname not fond for the package: com.ok.products.okauth.pojo
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.ja
va:211)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:315)
at
org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java
:608)
at
org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.jav
a:577)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:114)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.j
ava:236)
at
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.j
ava:192)
at
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:
105)
at
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:
251)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogi
c(RPCMessageReceiver.java:134)
... 22 more
Caused by: java.lang.RuntimeException: org.apache.axis2.AxisFault:
Mapping qname not fond for the package: com.ok.products.okauth.pojo
at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.j
ava:288)
at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.pro
cessProperties(ADBXMLStreamReaderImpl.java:926)
at
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.nex
t(ADBXMLStreamReaderImpl.java:799)
at
org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.ja
va:125)
... 31 more
Caused by: org.apache.axis2.AxisFault: Mapping qname not fond for
the package: com.ok.products.okauth.pojo
at
org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.j
ava:102)
... 35 more
</Exception>
0
--------------------------------------------------------------------
- To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-----------------------------------------
The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]