[JBossWS] - Re: Cannot obtain java type mapping for {http://business/jaw
by JoPe
What's this type mapping about after all? I'm trying to write my first own webservice and did two tutorials, leading to this client code:
package test.de.laliluna.library;
|
| import java.net.URL;
|
| import javax.xml.namespace.QName;
| import javax.xml.rpc.Service;
| import javax.xml.rpc.ServiceFactory;
|
| import de.laliluna.library.BookTestBean;
|
| public class WebServiceTestClient
| {
|
| /**
| * @param args
| */
| public static …
[View More]void main(String[] args) throws Exception
| {
| URL url = new URL("http://localhost:8080/FirstEjb3Tutorial/BookTestBean?wsdl");
| QName qname = new QName("http://library.laliluna.de/", "BookTestBeanService");
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
|
| BookTestBean serviceEndpoint = (BookTestBean)service.getPort(BookTestBean.class);
|
| serviceEndpoint.test();
| }
| }
|
leading to this exception:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://library.laliluna.de/}test
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.processDocElement(JAXRPCMetaDataBuilder.java:627)
| ...
| at test.de.laliluna.library.WebServiceTestClient.main(WebServiceTestClient.java:22)
The last line refers to the statement "Service service = factory.createService(url, qname);"
I expected not to have to care about XML internals of the web service when using Java Annotations - like this:
@WebMethod
| @Oneway
| public void test()
| {...
So, if you could answer these questions:
1. Where/how can I manually specify a type mapping? Or do I need to extend my Annotations?
2. My web method has neither parameters nor a return value, how can there be any types to map??
I'd really appreciate it.
Also, does anybody know a good webservices tutorial for complete webservice rookies using JBoss?
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129818#4129818
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129818
[View Less]
16 years, 11 months
[JBossWS] - Re: avoid lazy-initialization exceptions
by euvitudo
Even if you create another layer of DTOs, you'll still have to handle this case. I actually created such a layer and transformers to convert the Entities to DTOs (and vice-versa). The code has a relatively ugly solution, but it works.
The solution was to create a handler that catches all RuntimeExceptions when the transformation code iterates through to the collections. The handler looks for LazyInitializationException; if found, it logs the exception (but does not re-throw), if not found, …
[View More]it rethrows the (non-LIE) RuntimeException.
Yeah, ugly, but it works. The layer essentially removes external dependence on Hibernate. I suppose an alternative is to submit a bug report (or feature request?) to Hibernate. Alas, my hack gives me a (false?) sense of security until a Hibernate change causes the hack to break! YMMV and all. :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129469#4129469
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129469
[View Less]
16 years, 11 months