Re: weird error when passing select's model a list of hibernate entities

2009-07-14 Thread Ulrich Stärk
I'm sorry. I accidentally mapped the Documents inside Project as a Set, not a List. And since there 
is no coercion from Set to SelectModel I got this error.


There could however be a more informative error message.

Uli

On 14.07.2009 11:34 schrieb Ulrich Stärk:
I think I ran into some class loader problem. I've got a hibernate 
managed entity Project that has a list of Documents. In a select 
component I want to choose one of the Documents. Unfortunately when 
trying to view the corresponding page, I get below exception 
(IllegalArgumentException: object is not an instance of declaring 
class). Does anyone of you have an idea what's wrong here?


TIA,

Uli

relevant page class excerpt:

@Property
@PageActivationContext
private Project project;

@Property
@Persist
private Document mine;

page template:

html t:type=layout title=choose
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

  p
t:form
  t:select model=project.documents value=mine /
/t:form
  /p

/html

Exception and stack trace:

[ERROR] assertion.CollectAssertion Render queue error in 
BeforeRenderTemplate[assertion/Collect:select]: Error reading property 
'id' of [Document[name: object is not an instance of declaring class
org.apache.tapestry5.ioc.internal.util.TapestryException: Error reading 
property 'id' of [Document[name: object is not an instance of declaring 
class [at context:assertion/CollectAssertion.tml, line 17]
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:948) 

at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$400(ComponentPageElementImpl.java:49) 

at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$AbstractPhase.callback(ComponentPageElementImpl.java:159) 

at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$BeforeRenderTemplatePhase.render(ComponentPageElementImpl.java:258) 

at 
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) 

at 
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) 

at 
$PageRenderQueue_1227891e562.render($PageRenderQueue_1227891e562.java)
at 
$PageRenderQueue_1227891e558.render($PageRenderQueue_1227891e558.java)
at 
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37) 

at 
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1751) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1735) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1717) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1703) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1684) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1665) 

at 
$MarkupRenderer_1227891e564.renderMarkup($MarkupRenderer_1227891e564.java)
at 
$MarkupRenderer_1227891e561.renderMarkup($MarkupRenderer_1227891e561.java)
at 
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) 

at 
$PageMarkupRenderer_1227891e55e.renderPageMarkup($PageMarkupRenderer_1227891e55e.java) 

at 
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) 

at 
$PageResponseRenderer_1227891e502.renderPageResponse($PageResponseRenderer_1227891e502.java) 

at 
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) 

at 
org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1946) 

at 
$PageRenderRequestHandler_1227891e503.handle($PageRenderRequestHandler_1227891e503.java) 

at 
$PageRenderRequestHandler_1227891e4ee.handle($PageRenderRequestHandler_1227891e4ee.java) 

at 
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48) 

at 
$ComponentRequestHandler_1227891e4f3.handlePageRender($ComponentRequestHandler_1227891e4f3.java) 

at 
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45) 


at $Dispatcher_1227891e4f5.dispatch($Dispatcher_1227891e4f5.java)
at 

Re: Weird error

2009-01-22 Thread Sid Ferreira
Indeed... anyone should fix the docs...

On Thu, Jan 22, 2009 at 12:46 AM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 21 Jan 2009 22:36:45 -0300, Sid Ferreira sid@gmail.com
 escreveu:

  http://pastebin.com/m43c165fd
 didn't included database, components or pages, just what matters.

 If something else is needed, tell me :D


 As I said before,

 By the way, I think there's an error in this constructor:

 public AccessController(ApplicationStateManager asm, ComponentClassResolver
 resolver, ComponentSource componentSource, UserSessionImpl newUserSession)

 Instead of UserSessionImpl, I think it should be UserSession, the interface
 declared in that wiki page.

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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




-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations


Re: Weird error

2009-01-22 Thread Ulrich Stärk

It's a wiki - go ahead...

Sid Ferreira schrieb:

Indeed... anyone should fix the docs...

On Thu, Jan 22, 2009 at 12:46 AM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:


Em Wed, 21 Jan 2009 22:36:45 -0300, Sid Ferreira sid@gmail.com
escreveu:

 http://pastebin.com/m43c165fd

didn't included database, components or pages, just what matters.

If something else is needed, tell me :D


As I said before,

By the way, I think there's an error in this constructor:

public AccessController(ApplicationStateManager asm, ComponentClassResolver
resolver, ComponentSource componentSource, UserSessionImpl newUserSession)

Instead of UserSessionImpl, I think it should be UserSession, the interface
declared in that wiki page.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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








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



Re: Weird error

2009-01-22 Thread Sid Ferreira
Done :D

On Thu, Jan 22, 2009 at 8:56 AM, Ulrich Stärk u...@spielviel.de wrote:

 It's a wiki - go ahead...

 Sid Ferreira schrieb:

  Indeed... anyone should fix the docs...

 On Thu, Jan 22, 2009 at 12:46 AM, Thiago H. de Paula Figueiredo 
 thiag...@gmail.com wrote:

  Em Wed, 21 Jan 2009 22:36:45 -0300, Sid Ferreira sid@gmail.com
 escreveu:

  http://pastebin.com/m43c165fd

 didn't included database, components or pages, just what matters.

 If something else is needed, tell me :D

  As I said before,

 By the way, I think there's an error in this constructor:

 public AccessController(ApplicationStateManager asm,
 ComponentClassResolver
 resolver, ComponentSource componentSource, UserSessionImpl
 newUserSession)

 Instead of UserSessionImpl, I think it should be UserSession, the
 interface
 declared in that wiki page.

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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






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




-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations


Re: Weird error

2009-01-21 Thread Stephane Decleire
Hi

Could you show us the code of your class
tibox.allert.fastSupport.services.UserSessionImpl ?

Stephane

Sid Ferreira a écrit :
 Based on http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Im
 getting this error... Why?


 java.lang.RuntimeExceptionException constructing service 'MasterDispatcher':
 Error invoking service builder method
 org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) (at
 TapestryModule.java:1144) (for service 'MasterDispatcher'): Error invoking
 service contribution method
 tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration,
 Dispatcher): Error building service proxy for service 'AccessController' (at
 tibox.allert.fastSupport.services.AccessController(ApplicationStateManager,
 ComponentClassResolver, ComponentSource, UserSessionImpl) (at
 AccessController.java:26) via
 tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
 AppModule.java:27)): Error invoking constructor
 tibox.allert.fastSupport.services.AccessController(ApplicationStateManager,
 ComponentClassResolver, ComponentSource, UserSessionImpl) (at
 AccessController.java:26) via
 tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
 AppModule.java:27) (for service 'AccessController'): No service implements
 the interface tibox.allert.fastSupport.services.UserSessionImpl.
 org.apache.tapestry5.ioc.internal.OperationExceptionNo service implements
 the interface tibox.allert.fastSupport.services.UserSessionImpl.
 trace

- Realizing service MasterDispatcher
- Invoking
org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) 
 (at
TapestryModule.java:1144)
- Collecting ordered configuration for service MasterDispatcher
- Invoking method

 tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration,
Dispatcher) (at AppModule.java:39).
- Determining injection value for parameter #2
(org.apache.tapestry5.services.Dispatcher)
- Creating service 'AccessController'.
- Determining injection value for parameter #4
(tibox.allert.fastSupport.services.UserSessionImpl)

 java.lang.RuntimeExceptionNo service implements the interface
 tibox.allert.fastSupport.services.UserSessionImpl.



   


Re: Weird error

2009-01-21 Thread Chris Lewis
And also how exactly you bind your service implementation in your app 
module.


Stephane Decleire wrote:

Hi

Could you show us the code of your class
tibox.allert.fastSupport.services.UserSessionImpl ?

Stephane

Sid Ferreira a écrit :
  

Based on http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Im
getting this error... Why?


java.lang.RuntimeExceptionException constructing service 'MasterDispatcher':
Error invoking service builder method
org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) (at
TapestryModule.java:1144) (for service 'MasterDispatcher'): Error invoking
service contribution method
tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration,
Dispatcher): Error building service proxy for service 'AccessController' (at
tibox.allert.fastSupport.services.AccessController(ApplicationStateManager,
ComponentClassResolver, ComponentSource, UserSessionImpl) (at
AccessController.java:26) via
tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
AppModule.java:27)): Error invoking constructor
tibox.allert.fastSupport.services.AccessController(ApplicationStateManager,
ComponentClassResolver, ComponentSource, UserSessionImpl) (at
AccessController.java:26) via
tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
AppModule.java:27) (for service 'AccessController'): No service implements
the interface tibox.allert.fastSupport.services.UserSessionImpl.
org.apache.tapestry5.ioc.internal.OperationExceptionNo service implements
the interface tibox.allert.fastSupport.services.UserSessionImpl.
trace

   - Realizing service MasterDispatcher
   - Invoking
   org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) (at
   TapestryModule.java:1144)
   - Collecting ordered configuration for service MasterDispatcher
   - Invoking method
   
tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration,
   Dispatcher) (at AppModule.java:39).
   - Determining injection value for parameter #2
   (org.apache.tapestry5.services.Dispatcher)
   - Creating service 'AccessController'.
   - Determining injection value for parameter #4
   (tibox.allert.fastSupport.services.UserSessionImpl)

java.lang.RuntimeExceptionNo service implements the interface
tibox.allert.fastSupport.services.UserSessionImpl.



  



  


--
http://thegodcode.net



Re: Weird error

2009-01-21 Thread Carl Crowder

I'm guessing from this:

java.lang.RuntimeException No service implements the interface 
tibox.allert.fastSupport.services.UserSessionImpl.


That you're binding the implementing class instead of the interface class.

Carl

Chris Lewis wrote:
And also how exactly you bind your service implementation in your app 
module.


Stephane Decleire wrote:

Hi

Could you show us the code of your class
tibox.allert.fastSupport.services.UserSessionImpl ?

Stephane

Sid Ferreira a écrit :
 

Based on http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Im
getting this error... Why?


java.lang.RuntimeExceptionException constructing service 
'MasterDispatcher':

Error invoking service builder method
org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) 
(at
TapestryModule.java:1144) (for service 'MasterDispatcher'): Error 
invoking

service contribution method
tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration, 

Dispatcher): Error building service proxy for service 
'AccessController' (at
tibox.allert.fastSupport.services.AccessController(ApplicationStateManager, 


ComponentClassResolver, ComponentSource, UserSessionImpl) (at
AccessController.java:26) via
tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
AppModule.java:27)): Error invoking constructor
tibox.allert.fastSupport.services.AccessController(ApplicationStateManager, 


ComponentClassResolver, ComponentSource, UserSessionImpl) (at
AccessController.java:26) via
tibox.allert.fastSupport.services.AppModule.bind(ServiceBinder) (at
AppModule.java:27) (for service 'AccessController'): No service 
implements

the interface tibox.allert.fastSupport.services.UserSessionImpl.
org.apache.tapestry5.ioc.internal.OperationExceptionNo service 
implements

the interface tibox.allert.fastSupport.services.UserSessionImpl.
trace

   - Realizing service MasterDispatcher
   - Invoking
   
org.apache.tapestry5.services.TapestryModule.buildMasterDispatcher(List) 
(at

   TapestryModule.java:1144)
   - Collecting ordered configuration for service MasterDispatcher
   - Invoking method
   
tibox.allert.fastSupport.services.AppModule.contributeMasterDispatcher(OrderedConfiguration, 


   Dispatcher) (at AppModule.java:39).
   - Determining injection value for parameter #2
   (org.apache.tapestry5.services.Dispatcher)
   - Creating service 'AccessController'.
   - Determining injection value for parameter #4
   (tibox.allert.fastSupport.services.UserSessionImpl)

java.lang.RuntimeExceptionNo service implements the interface
tibox.allert.fastSupport.services.UserSessionImpl.



  


  




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



Re: Weird error

2009-01-21 Thread Thiago H. de Paula Figueiredo
Em Wed, 21 Jan 2009 16:23:45 -0300, Sid Ferreira sid@gmail.com  
escreveu:



Based on http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Im
getting this error... Why?


As any error in Java, the first thing to do is to look at the stack trace:

No service implements the interface  
tibox.allert.fastSupport.services.UserSessionImpl.


Read the Tapestry-IoC documentation because the problem lies in your T-IoC  
configuration. Don't forget to read this page:  
http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html.


(Sorry, second RTFM today, hehehe) :)

By the way, I think there's an error in this constructor:

public AccessController(ApplicationStateManager asm,  
ComponentClassResolver resolver, ComponentSource componentSource,  
UserSessionImpl newUserSession)


Instead of UserSessionImpl, I think it should be UserSession, the  
interface declared in that wiki page.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago

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



Re: Weird error

2009-01-21 Thread Sid Ferreira
Ive copy pasted most of code.UserSession (interface) and UserSessionImpl
(class) are almost empty, just the method in the link returning true always.

The binding I tried with the binder, before the binding of the application.

Thiago: I've readed it and there's no problem, but when a copy-paste fails
it's confusing.

I'll post the sources in a moment...

On Wed, Jan 21, 2009 at 9:45 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 21 Jan 2009 16:23:45 -0300, Sid Ferreira sid@gmail.com
 escreveu:

  Based on http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Im
 getting this error... Why?


 As any error in Java, the first thing to do is to look at the stack trace:

  No service implements the interface
 tibox.allert.fastSupport.services.UserSessionImpl.


 Read the Tapestry-IoC documentation because the problem lies in your T-IoC
 configuration. Don't forget to read this page:
 http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html.

 (Sorry, second RTFM today, hehehe) :)

 By the way, I think there's an error in this constructor:

 public AccessController(ApplicationStateManager asm, ComponentClassResolver
 resolver, ComponentSource componentSource, UserSessionImpl newUserSession)

 Instead of UserSessionImpl, I think it should be UserSession, the interface
 declared in that wiki page.

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 Consultor, desenvolvedor e instrutor em Java
 http://www.arsmachina.com.br/thiago


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




-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations


Re: Weird error

2009-01-21 Thread Thiago H. de Paula Figueiredo
Em Wed, 21 Jan 2009 22:36:45 -0300, Sid Ferreira sid@gmail.com  
escreveu:



http://pastebin.com/m43c165fd
didn't included database, components or pages, just what matters.

If something else is needed, tell me :D


As I said before,

By the way, I think there's an error in this constructor:

public AccessController(ApplicationStateManager asm,  
ComponentClassResolver resolver, ComponentSource componentSource,  
UserSessionImpl newUserSession)


Instead of UserSessionImpl, I think it should be UserSession, the  
interface declared in that wiki page.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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