Johannes Koch

Greenhorn
+ Follow
since Dec 25, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Johannes Koch

I need to write an EntityBean that holds a collection of EntityBeans of another type plus two single references to EntityBeans of that type. A simple example would be a customer who has a work address and a home address, and a collection of previously used addresses that also need to be stored.

The classes could look like this:

However, I could not find any combination of annotations that would persist this setup in a sensible way. All the Addresses always get stored in one table, and I can't find a way to distinguish which address plays which "role" in the customer class when trying to write an SQL query to read them. I would especially like to avoid having to declare a Customer attribute in the Address class, since this would be redundant on the object level and would produce a lot of implementation overhead in my application.
Does anybody know how this can be done? I'm sure I am not the first person running into this need, but unfortunately, all the books, docs and tutorials I found don't cover it.
I am trying to execute two JPQL queries in an EJB3 application deployed on a JBoss 4.2.2.GA. The code looks as follows:

While the first query works fine, the second one results in the following error:

Even more strange: When I try to switch to a numbered parameter, like this

the error message stays the same and still complains about a named parameter:

This is also not affected by whether I pass the parameter value as int (2), String ("2") or Integer (new Integer(2)).
The only difference I can notice between the two queries is that in the second one I'm using a fully qualified name for the persisted Entity because the class is defined in a different package. Maybe Hibernate gets confused by that?

Can anybody give me a hint? I'm totally out of ideas.
[ June 03, 2008: Message edited by: Johannes Koch ]
I solved my exception by using JAX-WS instead of JAX-RPC.
16 years ago
Reddy,
did you ever find a solution for this?
Thanks, Johannes
16 years ago
James,
which JAR mismatches did you have exactly? I keep getting the same exception, and so do many other people. All kinds of forums are crowded with people asking because of "org.jboss.ws.WSException: Cannot obtain java type mapping for..." errors, but I can't find a final solution for this issue anywhere.
Please, let us know how you resolved this!
Thanks, Johannes
16 years ago
I'm trying to write my first own webservice using EJBs (V3) in a JBoss as server. Building and deploying the webservice bean works fine, but when I try to access a web method with no parameters and no return type like this:

it throws this exception:

where the last line refers to "Service service = factory.createService(url, qname);"

My questions are:
1. I thought using JAX-WS and Annotations would take care of all the webservice-configuration-XML-SOAP stuff for me. Do I still need to manually specify a type mapping? How? Where?
2. The web method I try to access has neither parameters nor a return value. How can there be any types to map??

If you could make me friends with webservices again, they and I would really appreciate it.


From here: Server code.


[ February 20, 2008: Message edited by: Johannes Koch ]
[ February 20, 2008: Message edited by: Johannes Koch ]
17 years ago
...where

refers to
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:


leading to this exception:


I expected not to have to care about XML internals of the web service when using Java Annotations - like this:


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!