You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Mylonas <ch...@opencsta.org> on 2012/04/25 17:54:58 UTC

tynamo-resteasy - different errors along the way

Hi,

I've gone from zero to consuming (GET) RS and some JAXB in the last 24 hours and am trying tynamo-resteasy for the first time.

I've hit an error on start up of my resteasy integration test and I'm wondering where I stuffed up critically (the app started the first time), and has since gone through two sets of errors.
Fundamentally, does tynamo's PropertyDescriptor link an entity to a rest-resource?

Here's the steps I followed.

1.  Created standard tapestry archetype with 5.3.2
2.  Changed from tapestry-core to tapestry-hibernate & hsqldb
3.  Added tynamo-resteasy & resteasy-jackson-provider
4.  Coded my singleton resource in the "rest" directory
5.  Coded my entity in the "entities" director

The app stared at this point, when I went to save my entity (beaneditform), the error was that it had detached.

Stopped app to try and work out what went wrong realised I had a few more things to do.

6.  Contributed REST resources as per documentation
	/**
	 * Contributions to the RESTeasy main Application, insert all your RESTeasy
	 * singletons services here.
	 */
	@Contribute(javax.ws.rs.core.Application.class)
	public static void configureRestResources(Configuration<Object> singletons,
			DomainResource domainResource) {
		singletons.add(domainResource);
	}


New error - Exception constructing service 'ResteasyRequestFilter': Error building service proxy for service 'Application' (at org.tynamo.resteasy.Application(Collection) (at Application.java:14) via org.tynamo.resteasy.ResteasyModule.bind(ServiceBinder) (at ResteasyModule.java:31)): Error invoking service contribution method org.opencsta.reststuff.services.AppModule.configureRestResources(Configuration, DomainResource): No service implements the interface org.opencsta.reststuff.rest.DomainResource.


Tried to look for a connection between the entity and the resource singleton.

7.  Realised I hadn't put the @PropertyDescriptor(index = 0)
which comes from org.tynamo.descriptor.annotation.PropertyDescriptor;
onto my getId() method on the entity.


There is no import for my project in eclipse.  Is this because I started the project as a tapestry maven project rather than a tynamo project?

Thanks for guidance.



Re: tynamo-resteasy - different errors along the way

Posted by Kalle Korhonen <ka...@gmail.com>.
On Wed, Apr 25, 2012 at 8:54 AM, Chris Mylonas <ch...@opencsta.org> wrote:
> Stopped app to try and work out what went wrong realised I had a few more things to do.
> 6.  Contributed REST resources as per documentation
>        /**
>         * Contributions to the RESTeasy main Application, insert all your RESTeasy
>         * singletons services here.
>         */
>        @Contribute(javax.ws.rs.core.Application.class)
>        public static void configureRestResources(Configuration<Object> singletons,
>                        DomainResource domainResource) {
>                singletons.add(domainResource);
>        }
> New error - Exception constructing service 'ResteasyRequestFilter': Error building service proxy for service 'Application' (at org.tynamo.resteasy.Application(Collection) (at Application.java:14) via org.tynamo.resteasy.ResteasyModule.bind(ServiceBinder) (at ResteasyModule.java:31)): Error invoking service contribution method org.opencsta.reststuff.services.AppModule.configureRestResources(Configuration, DomainResource): No service implements the interface org.opencsta.reststuff.rest.DomainResource.
>

Slow down, read the error message and understand what it is saying.
You are trying to inject your DomainResource but you haven't declared
it as a service. Either build(), bind() or @Autobuild the
domainResource, e.g. public static void
configureRestResources(Configuration<Object> singletons, @Autobuild
DomainResource domainResource) to make it work.

Kalle

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org