Al Hobbs wrote:is that the full error message without casting? It seems like something screwy is going on with the class types. The expected class and the given class don't match, so you need to make sure they match up.
Services consist of two main parts: a service interface and a service implementation.
The service interface is how the service will be represented throughout the rest of the registry. Since what gets passed around is normally a proxy, you can't expect to cast a service object down to the implementation class (you'll see a ClassCastException instead). In other words, you should be careful to ensure that your service interface is complete, since Tapestry IoC effectively walls you off from back doors such as casts.
Al Hobbs wrote:It seems like what the site says is to put those classes into a service class and then get that service class from the registry.
Al Hobbs wrote:Yeah, I was thinking you could put the annotation on the interface. That seems like a better design anyway. If you have an interface that acts as a server endpoint, you probably aren't going to use it in another situation where you don't need the annotation. maybe..
Al Hobbs wrote:So you get the interface implementation from the registry and then when you cast it to the underlying class it throws a cast exception? It seems like that should work.
This class level annotation signifies that the Java class it decorates must be deployed by the implementation as a websocket server endpoint and made available in the URI-space of the websocket implementation. The class must be public, CONCRETE, and have a public no-args constructor.
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Create Edit Print & Convert PDF Using Free API with Javahttps://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire