You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by netdawg <ne...@yahoo.com> on 2012/04/24 11:00:13 UTC

ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

For some reason, HTTP request to edit/create page of the entity results in
attempted coercion of the word "css" into the Id parameter (type Long) of
the entity -- application workflow seems normal though.  Just plenty of
vomit in jetty console log...shown below. 



S T A C K T R A C E
----------------------------------------------------------------------------------------

127.0.0.1 -  -  [24/Apr/2012:08:40:32 +0000] "GET /piko/person/edit/6 HTTP/1
.1" 200 4314 "http://localhost:8080/piko/persons" "Mozilla/5.0 (compatible;
MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
[ERROR] ioc.Registry Exception in method null, parameter #1: Exception
converting 'css' to instance of java.lang.Long (id type for entity
org.pacificcis.piko.entities.person): Coercion of css to type java.lang.Long
(via String --> Long) failed: For input string: "css"
[ERROR] ioc.Registry Operations trace:
[ERROR] ioc.Registry [ 1] Triggering event 'activate' on person/Edit
[ERROR] ioc.Registry [ 2] PageActivationContextWorker activate event handler
[ERROR] TapestryModule.RequestExceptionHandler Processing of request failed
with uncaught exception: Exception in method null, parameter #1: Exception
converting 'css' to instance of java.lang.Long (id type for entity
org.pacificcis.piko.entities.person): Coercion of css to type java.lang.Long
(via String --> Long) failed: For input string: "css"
org.apache.tapestry5.runtime.ComponentEventException: Exception in method
null,parameter #1: Exception converting 'css' to instance of java.lang.Long
(id type
for entity org.pacificcis.piko.entities.person): Coercion of css to type
java.lang.Long (via String --> Long) failed: For input string: "css"
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1130)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3200(ComponentPageElementImpl.java:61)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1051)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1048)
        at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
        at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
        at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1047)
        at
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:302)
        at
org.apache.tapestry5.internal.services.PageActivatorImpl.activatePage(PageActivatorImpl.java:34)
        at $PageActivator_38a723db6011.activatePage(Unknown Source)
        at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:57)
        at
org.apache.tapestry5.services.TapestryModule$37.handle(TapestryModule.java:2207)
        at $PageRenderRequestHandler_38a723db6012.handle(Unknown Source)
        at $PageRenderRequestHandler_38a723db600c.handle(Unknown Source)
        at
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handlePageRender(ComponentRequestHandlerTerminator.java:48)
        at
org.apache.tapestry5.services.InitializeActivePageName.handlePageRender(InitializeActivePageName.java:47)
        at $ComponentRequestHandler_38a723db600d.handlePageRender(Unknown
Source)
        at $ComponentRequestHandler_38a723db5fd2.handlePageRender(Unknown
Source)
        at
org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:45)
        at $Dispatcher_38a723db5fd5.dispatch(Unknown Source)
        at $Dispatcher_38a723db5fcf.dispatch(Unknown Source)
        at
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)
        at
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at
org.pacificcis.piko.services.AppModule$1.service(AppModule.java:98)
        at $RequestFilter_38a723db5fca.service(Unknown Source)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:105)
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:95)
        at
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
        at
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:119)
        at $RequestHandler_38a723db5fd0.service(Unknown Source)
        at $RequestHandler_38a723db5fc3.service(Unknown Source)
        at
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
        at
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
        at $HttpServletRequestHandler_38a723db5fc5.service(Unknown Source)
        at
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
        at $HttpServletRequestFilter_38a723db5fc1.service(Unknown Source)
        at $HttpServletRequestHandler_38a723db5fc5.service(Unknown Source)
        at
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
        at $HttpServletRequestHandler_38a723db5fc5.service(Unknown Source)
        at $HttpServletRequestHandler_38a723db5fc0.service(Unknown Source)
        at
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)



Caused by: org.apache.tapestry5.ioc.internal.OperationException: Exception
in method null, parameter #1: Exception converting 'css' to instance of
java.lang.Long (id type for entity org.pacificcis.piko.entities.person):
Coercion of css to
 type java.lang.Long (via String --> Long) failed: For input string: "css"
        at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
        at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
        at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
        at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1121)
        at
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$TransformationSupportImpl$1.advise(ComponentInstantiatorSourceImpl.java:439)
        at
org.apache.tapestry5.internal.plastic.AbstractMethodInvocation.proceed(AbstractMethodInvocation.java:86)
        at
org.pacificcis.piko.pages.person.Editperson.dispatchComponentEvent(Editperson.java)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:923)
        at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1106)
        ... 67 more


Caused by: java.lang.IllegalArgumentException: Exception in method null,
parameter #1: Exception converting 'css' to instance of java.lang.Long (id
type for ent
ity org.pacificcis.piko.entities.person): Coercion of css to type
java.lang.Long (via String --> Long) failed: For input string: "css"
        at
org.apache.tapestry5.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:87)
        at
org.apache.tapestry5.internal.transform.PageActivationContextWorker$1.handleEvent(PageActivationContextWorker.java:88)
        at
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$TransformationSupportImpl$1$1.invoke(ComponentInstantiatorSourceImpl.java:443)
        at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
        ... 74 more


Caused by: java.lang.RuntimeException: Exception converting 'css' to
instance of java.lang.Long (id type for entity
org.pacificcis.piko.entities.person): Coer
cion of css to type java.lang.Long (via String --> Long) failed: For input
string: "css"
        at
org.apache.tapestry5.internal.hibernate.HibernateEntityValueEncoder.toValue(HibernateEntityValueEncoder.java:83)
        at
org.apache.tapestry5.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
        at $ContextValueEncoder_38a723db600a.toValue(Unknown Source)
        at
org.apache.tapestry5.internal.URLEventContext.get(URLEventContext.java:43)
        at
org.apache.tapestry5.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:83)
        ... 77 more


Caused by: java.lang.RuntimeException: Coercion of css to type
java.lang.Long (via String --> Long) failed: For input string: "css"
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:79)
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:147)
        at $TypeCoercer_38a723db5fa1.coerce(Unknown Source)
        at
org.apache.tapestry5.internal.hibernate.HibernateEntityValueEncoder.toValue(HibernateEntityValueEncoder.java:80)
        ... 81 more


Caused by: java.lang.NumberFormatException: For input string: "css"
        at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Long.parseLong(Long.java:410)
        at java.lang.Long.<init>(Long.java:678)
        at
org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:241)
        at
org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:238)
        at
org.apache.tapestry5.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:52)
        at
org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:75)
        ... 84 more


[INFO] AppModule.TimingFilter Request time: 246 ms
127.0.0.1 -  -  [24/Apr/2012:08:40:34 +0000] "GET /piko/person/edit/css/iepn
gfix.htc HTTP/1.1" 500 4075 "-" "Mozilla/5.0 (compatible; MSIE 9.0; Windows
NT 6
.1; WOW64; Trident/5.0)"


--
View this message in context: http://tapestry.1045711.n5.nabble.com/ioc-Registry-Exception-Failed-Coercion-of-css-to-Entity-Id-type-java-lang-Long-tp5661389p5661389.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

Posted by netdawg <ne...@yahoo.com>.
Still no trace of this error and cannot seem to reproduce it.  

I am pretty sure this was caused by using jQuery though - before replacing
the $ sign with the word jQuery.  

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

and, while I was messing around trying to fix the apparent yuicompressor
issue (with rhino-bugfix etc):

http://tapestry.1045711.n5.nabble.com/AssetsModule-ResourceMinimizer-Exception-yui-compressor-td5658826.html



--
View this message in context: http://tapestry.1045711.n5.nabble.com/ioc-Registry-Exception-Failed-Coercion-of-css-to-Entity-Id-type-java-lang-Long-tp5661389p5668894.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

Posted by netdawg <ne...@yahoo.com>.
Aha.  Thanks, Howard.  Makes sense.  That is probably what was going on.  

I am, however, using the "context:"  in all my templates and corresponding
java classes, as intended. 

And, for the life of me, I am unable to trap the issue any longer.  The logs
seem to be free of it last time I checked and, of course, it never seemed to
interrupt the workflow. 

If I find it happens again, I will try to isolate it and post again.  

--
View this message in context: http://tapestry.1045711.n5.nabble.com/ioc-Registry-Exception-Failed-Coercion-of-css-to-Entity-Id-type-java-lang-Long-tp5661389p5663911.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

Posted by Howard Lewis Ship <hl...@gmail.com>.
Most likely, your template has a relative path to it ... you've done:
  <link rel="stylesheet" src="css/site.css"/>

That works great inside a static page, where you know exactly what the
browser URL is going to be.

In Tapestry, once you add page activation contexts, various folders,
and other mappings configured inside Tapestry, the browser URL is
going to be variable ... sometimes even for the same page in different
contexts, and certainly for any reusable component used across
multiple pages.

The end result is Tapestry tries to shoehorn the extra part of the
path ("/mypage/css/site.css") into the page's activation context
(looks like a long) and is unable to convert "css" to a number.

The solution is to let Tapestry do the work:

  <link rel="stylesheet" src="${context:css/site.css}"/>

The "context:" binding prefix instructs Tapestry to locate the file as
an Asset, and generate the absolute URL. It also adds a bunch of other
useful features, such as client-side caching and optional GZip
compression.

Also, rather than do this in a template, try:

  @Import(stylesheet="context:css/site.css")

in you page or component class, as a class annotation.

On Tue, Apr 24, 2012 at 4:16 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Tue, 24 Apr 2012 06:45:03 -0300, Lance Java <la...@googlemail.com>
> wrote:
>
>> I think you might be having a name clash with a page name and a CSS file
>> name in the same folder and tapestry is thinking it's an event URL to the
>> page instead of a CSS path.
>>
>> Solution: name the CSS file differently or move it to a different folder
>
>
> Or use just absolute paths to CSS, JavaScript and image files.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 24 Apr 2012 06:45:03 -0300, Lance Java <la...@googlemail.com>  
wrote:

> I think you might be having a name clash with a page name and a CSS file
> name in the same folder and tapestry is thinking it's an event URL to the
> page instead of a CSS path.
>
> Solution: name the CSS file differently or move it to a different folder

Or use just absolute paths to CSS, JavaScript and image files.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: ioc.Registry Exception Failed Coercion of "css" to Entity Id type java.lang.Long

Posted by Lance Java <la...@googlemail.com>.
I think you might be having a name clash with a page name and a CSS file
name in the same folder and tapestry is thinking it's an event URL to the
page instead of a CSS path.

Solution: name the CSS file differently or move it to a different folder