Re: T5.2.0-SNAPHOT: newbie exceptions submitting form with BeanEditor

2010-03-19 Thread buckofive

Hi Joe/Howard,

I have ran into this same problem a while back and oddly enough (just the
other day) I finally got around to filing a JIRA
(https://issues.apache.org/jira/browse/TAP5-1051).  The only help/clue I can
give to the T5 team is that the BeanEditor was working at one time in
T5.2.0-SNAPSHOT and I'm not sure when the problem began but it was several
weeks ago (Howard, I'm pretty sure it started before the new
ComponentClassTransformWorker code(which is a great improvement BTW) ).   
My resolution unfortunately, was to switch the version of T5 I was using to
T5.1.x.  I Hope this helps.

Cheers,
B



Howard Lewis Ship wrote:
> 
> It looks like what you have should work. This may represent a
> regression, based on the retooling of the
> ComponentClassTransformWorker code; it looks like the BeanEditForm (or
> BeanEditor) is possibly holding onto its instance of BeanModel from
> one request to the next, rather than starting from scratch on each
> request.  I haven't seen this myself, and it seems like something that
> would be tested by the Tapestry integration test suite ... but still,
> this seems odd.
> 
> On Thu, Mar 18, 2010 at 9:23 AM, Joe Klecko 
> wrote:
>>
>> Hi,
>>
>> I'm trying to use the BeanEditor in a t:form which seems to work fine
>> until
>> I use the "add" parameter.  I've read through the documentation and I'm
>> just
>> not sure what i'm doing wrong.  The form renders fine but no matter what
>> I
>> do when I submit the form it always throws this exception: "Bean editor
>> model for User already contains a property model for property
>> 'confirmPassword'."
>>
>> Thank you for any help or suggestions in advance!
>>
>>
>> Here is my simple test case:
>>
>> Test.tml:
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>> 
>>        
>>                
>>                        
>>                                
>>                                
>>                        
>>                
>>                
>>        
>> 
>> 
>>
>> Test.java:
>> public class Test {
>>       �...@property private User user;
>>       �...@property private String confirmPassword;
>> }
>>
>> User.java:
>> public class User {
>>
>>        private String email;
>>        private String password;
>>
>>        public User() {}
>>
>>        public String getEmail() {return email;}
>>        public void setEmail(String email) {this.email = email;}
>>
>>        public String getPassword() {return password;}
>>        public void setPassword(String password) {this.password =
>> password;}
>> }
>>
>> --
>> View this message in context:
>> http://old.nabble.com/T5.2.0-SNAPHOT%3A-newbie-exceptions-submitting-form-with-BeanEditor-tp27947909p27947909.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@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-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/T5.2.0-SNAPHOT%3A-newbie-exceptions-submitting-form-with-BeanEditor-tp27947909p27950914.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



t5.2.0-SNAPSHOT: Possible bug: form.onsubmit is being replaced by a tapestry onsubmit handler

2009-12-10 Thread buckofive

Hi All,

It seems tapestry is adding its own onsubmit handler directly to a form
element and overwriting mine.  Is this on purpose or a bug? (I want to use
my own direct handler so I can cancel the event before it gets fired to any
listeners).  I feel if tapestry is going to write any event handlers
directly to an element then it should 1st check to see if the handler has
already been defined and wrap it in a new function which calls the users
function after executint any tapestry functions (or maybe there is a better
way?).

Thanks in advance,
B

Here whats I have defined:

...
submit 
...


what tapestry renders is:


...
submit 
...



-- 
View this message in context: 
http://old.nabble.com/t5.2.0-SNAPSHOT%3A-Possible-bug%3A-form.onsubmit-is-being-replaced-by-a-tapestry-onsubmit-handler-tp26738147p26738147.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Linksubmit gets javascipt error T5.2.0-SNAPSHOT?

2009-12-03 Thread buckofive

Hi,

The latest snapshot when using FF, generates a javascript error (and does
not submit).

specified in .tml as:
--- Save

The javascript error:

--- this.form.select is not a function
--- [Break on this error] if (this.form.select("input#" + ...is.element.id +
"-hidden").length == 
--- 0)\n 
--- linksubmit.js (line 32)

Can anyone else confirm this issue?  is there a workaround?


-- 
View this message in context: 
http://old.nabble.com/Linksubmit-gets-javascipt-error-T5.2.0-SNAPSHOT--tp26635754p26635754.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T 5.1 vs 5.0 JSON encoding - breaks IE8

2009-11-18 Thread buckofive

> Since we recently also fixed a major bug concerning application security,
I'd say we should do a 5.1.0.6 release. 

+1

There should also be a new version of the 5.0 branch with any new security
fixes

+1

-- 
View this message in context: 
http://old.nabble.com/T-5.1-vs-5.0-JSON-encoding---breaks-IE8-tp26384537p26414154.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: HibernateEntityValueEncoder nullpointerException after Tapestry update

2009-11-04 Thread buckofive

Hi,

Was this issue ever resolved or is there a JIRA open for it (I couldn't find
one)?  We are experiencing this exact same scenario ie, Moving from 5.0 to
5.1 and using a composite-id entity in a loop.

thanks,
B 

-- 
View this message in context: 
http://old.nabble.com/T5%3A-HibernateEntityValueEncoder-nullpointerException-after-Tapestry-update-tp25041718p26208119.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: HibernateEntityValueEncoder nullpointerException after Tapestry update

2009-11-04 Thread buckofive

Hi,

Was this issue ever resolved or is there a JIRA open for it (I couldn't find
one)?  We are experiencing this exact same scenario ie, Moving from 5.0 to
5.1 and using a composite-id entity in a loop.

thanks,
B
-- 
View this message in context: 
http://old.nabble.com/T5%3A-HibernateEntityValueEncoder-nullpointerException-after-Tapestry-update-tp25041718p26208100.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5.1.0.5] Problem with report-plugin on windows

2009-11-04 Thread buckofive

Just as a reference for this thread the JIRA for this issue is here:
https://issues.apache.org/jira/browse/TAP5-871
-- 
View this message in context: 
http://old.nabble.com/-T5.1.0.5--Problem-with-report-plugin-on-windows-tp25362108p26207956.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




Re: T5: HibernateEntityValueEncoder nullpointerException after Tapestry update

2009-11-04 Thread buckofive

Hi,

Was this issue ever resolved or is there a JIRA open for it (I couldn't find
one)?  We are experiencing this exact same scenario ie, Moving from 5.0 to
5.1 and using a composite-id entity in a loop.

thanks,
B
-- 
View this message in context: 
http://old.nabble.com/T5%3A-HibernateEntityValueEncoder-nullpointerException-after-Tapestry-update-tp25041718p26207480.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5.0.18: Component Event Handler is not called in a nested page for SWFUpload component

2009-01-22 Thread buckofive

Hi all,

I'm working on a SWFUpload component (based on http://www.swfupload.org/ for
multiple file uploads at once) which works great if the component is used
inside the root Index page but if the component is used in a nested page it
no longer works.  

During the rendering of the component I create an event handler to process
the uploaded files.  This handler is used as the "upload_url" which the
SWFUpload API requires. This URL (event handler) should be that of the
component in its containing page which I am generating like so:

.tml:
  


SWFUpload.java:
  public void beginRender(){
  String uploadUrl =
resources.createEventLink("SWFUpload",this.context).toAbsoluteURI();
  uploadUrl += ";jsessionid="+getSessionId();

  ... The rest of the rendering code ...

  }

  public Object onSWFUpload(Object [] context)
  {
UploadedFile file = decoder.getFileUpload("Filedata");
ComponentResultProcessorWrapper callback = new  
ComponentResultProcessorWrapper(componentEventResultProcessor);
Object []finalContext = ArrayUtils.add(context, file); 
resources.triggerEvent("fileUploaded", finalContext, callback); 
  }


The component url when inside the start page equates to:
 "/index.uploadvideos:SWFUpload;jsessionid=1sm95xnojfehs"

The component url when inside a nested page:

"/school/skilledit.uploadvideos:SWFUpload;jsessionid=1sm95xnojfehs?t:ac=25"

What I have noticed is that when the component is in the index page the
event handler is called and the default tapestry installed TimingFilter is
not but when the component is in a nested page the event handler is NOT
called and the TimingFilter is.  The timing filters shows a request for a
page called:
  "/school/skilledit.uploadvideos:SWFUpload"

I have also tried using the full url with the same results.
"http://localhost:8080/mycontext/school/skilledit.uploadvideos:SWFUpload;jsessionid=1sm95xnojfehs?t:ac=25";

Does anyone have any idea why this is or what I maybe missing?  I don't
quite understand why my event handler isn't being called in nested pages.

thanks,
B





-- 
View this message in context: 
http://www.nabble.com/T5.0.18%3A-Component-Event-Handler-is-not-called-in-a-nested-page-for-SWFUpload-component-tp21617939p21617939.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Exception creating a pageLink in Tomcat but not in Jetty

2008-12-30 Thread buckofive

Thanks for the response and reference link!  I'll start looking at this.



Peter Stavrinides wrote:
> 
> The exception relates to Java 6 in conjunction with javassist, the library
> used for runtime class transformation. You can get it to work with a few
> workarounds, see this old thread:
> http://markmail.org/message/dyvvplkjkbedzopw
> 
> Cheers,
> Peter 
> 
> -- 
> If you are not an intended recipient of this e-mail, please notify the
> sender, delete it and do not read, act upon, print, disclose, copy, retain
> or redistribute it. Please visit http://www.albourne.com/email.html for
> important additional terms relating to this e-mail.
> 
> - Original Message -
> From: "buckofive" 
> To: users@tapestry.apache.org
> Sent: Tuesday, 30 December, 2008 8:43:41 AM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: T5: Exception creating a pageLink in Tomcat but not in Jetty
> 
> 
> Hi All,
> 
> I've been racking my brain all day on this one so I probally have tunnel
> vision but I am getting a weird exception when trying to create a pageLink
> on tomcat 5.5, jdk 1.6.06.  Maybe someone has come across this already.
> I'm
> really not sure if this is a tomcat issue, a tapestry issue or my issue. 
> I've tried stepping through the tapestry code but didn't find anything
> obvious.  This code works fine using Jetty and jdk 1.6.06.  Thanks in
> advance for any help or guidance.
> 
> So sorry to spam this huge exception but heres what I know:
> 
> This is the call:  
>Link link = resources.createPageLink(AttachMenuItemMedia.class, true,
> menuItem.getId());
> 
> which results in tapestry reporting this as the top level exception:
> 
> org.apache.tapestry5.ioc.internal.util.TapestryException
> Could not convert 'blockRender' into a component parameter binding:
> java.lang.NoClassDefFoundError:
> com/roialte/presentation/components/AttachFiles
> 
> java.lang.ClassNotFoundException
> caught an exception while obtaining a class file for
> com.roialte.presentation.components.AttachFiles
> 
> exception
> org.apache.tapestry5.internal.services.TransformationException: 3
> 
> # org.apache.tapestry5.internal.services.TransformationException
> 3
> 
> 
> 
> 
> I suspect the above is not really the cause since the classes are there
> and
> the lowest exception on the stack shows this:
> 
> 
> 
> 
> 
> # java.lang.ArrayIndexOutOfBoundsException
> 3
> 
> Stack trace
> 
> * javassist.bytecode.ByteArray.write16bit(ByteArray.java:40)
> *
> javassist.bytecode.StackMapTable$Shifter.update(StackMapTable.java:744)
> *
> javassist.bytecode.StackMapTable$Shifter.sameFrame(StackMapTable.java:720)
> *
> javassist.bytecode.StackMapTable$Walker.stackMapFrames(StackMapTable.java:194)
> *
> javassist.bytecode.StackMapTable$Walker.parse(StackMapTable.java:179)
> *
> javassist.bytecode.StackMapTable$Shifter.doit(StackMapTable.java:714)
> * javassist.bytecode.StackMapTable.shiftPc(StackMapTable.java:693)
> *
> javassist.bytecode.CodeIterator.insertGap0(CodeIterator.java:676)
> * javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:636)
> *
> javassist.bytecode.CodeIterator.insertGapCore(CodeIterator.java:467)
> * javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:413)
> * javassist.expr.Expr.replace0(Expr.java:298)
> * javassist.expr.FieldAccess.replace(FieldAccess.java:213)
> *
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl$2.edit(InternalClassTransformationImpl.java:1739)
> * javassist.expr.ExprEditor.loopBody(ExprEditor.java:197)
> * javassist.expr.ExprEditor.doit(ExprEditor.java:90)
> * javassist.CtClassType.instrument(CtClassType.java:1289)
> *
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.replaceFieldAccess(InternalClassTransformationImpl.java:1745)
> *
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.performFieldTransformations(InternalClassTransformationImpl.java:1673)
> *
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.finish(InternalClassTransformationImpl.java:1336)
> *
> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:172)
> *
> org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201)
> * javassist.Loader.findClass(Loader.java:340)
> *
> org.apache.tapestry5

T5: Exception creating a pageLink in Tomcat but not in Jetty

2008-12-29 Thread buckofive

Hi All,

I've been racking my brain all day on this one so I probally have tunnel
vision but I am getting a weird exception when trying to create a pageLink
on tomcat 5.5, jdk 1.6.06.  Maybe someone has come across this already. I'm
really not sure if this is a tomcat issue, a tapestry issue or my issue. 
I've tried stepping through the tapestry code but didn't find anything
obvious.  This code works fine using Jetty and jdk 1.6.06.  Thanks in
advance for any help or guidance.

So sorry to spam this huge exception but heres what I know:

This is the call:  
   Link link = resources.createPageLink(AttachMenuItemMedia.class, true,
menuItem.getId());

which results in tapestry reporting this as the top level exception:

org.apache.tapestry5.ioc.internal.util.TapestryException
Could not convert 'blockRender' into a component parameter binding:
java.lang.NoClassDefFoundError:
com/roialte/presentation/components/AttachFiles

java.lang.ClassNotFoundException
caught an exception while obtaining a class file for
com.roialte.presentation.components.AttachFiles

exception
org.apache.tapestry5.internal.services.TransformationException: 3

# org.apache.tapestry5.internal.services.TransformationException
3




I suspect the above is not really the cause since the classes are there and
the lowest exception on the stack shows this:





# java.lang.ArrayIndexOutOfBoundsException
3

Stack trace

* javassist.bytecode.ByteArray.write16bit(ByteArray.java:40)
*
javassist.bytecode.StackMapTable$Shifter.update(StackMapTable.java:744)
*
javassist.bytecode.StackMapTable$Shifter.sameFrame(StackMapTable.java:720)
*
javassist.bytecode.StackMapTable$Walker.stackMapFrames(StackMapTable.java:194)
*
javassist.bytecode.StackMapTable$Walker.parse(StackMapTable.java:179)
*
javassist.bytecode.StackMapTable$Shifter.doit(StackMapTable.java:714)
* javassist.bytecode.StackMapTable.shiftPc(StackMapTable.java:693)
* javassist.bytecode.CodeIterator.insertGap0(CodeIterator.java:676)
* javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:636)
*
javassist.bytecode.CodeIterator.insertGapCore(CodeIterator.java:467)
* javassist.bytecode.CodeIterator.insertGap(CodeIterator.java:413)
* javassist.expr.Expr.replace0(Expr.java:298)
* javassist.expr.FieldAccess.replace(FieldAccess.java:213)
*
org.apache.tapestry5.internal.services.InternalClassTransformationImpl$2.edit(InternalClassTransformationImpl.java:1739)
* javassist.expr.ExprEditor.loopBody(ExprEditor.java:197)
* javassist.expr.ExprEditor.doit(ExprEditor.java:90)
* javassist.CtClassType.instrument(CtClassType.java:1289)
*
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.replaceFieldAccess(InternalClassTransformationImpl.java:1745)
*
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.performFieldTransformations(InternalClassTransformationImpl.java:1673)
*
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.finish(InternalClassTransformationImpl.java:1336)
*
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:172)
*
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:201)
* javassist.Loader.findClass(Loader.java:340)
*
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:92)
* javassist.Loader.loadClass(Loader.java:311)
* java.lang.ClassLoader.loadClass(ClassLoader.java:251)
* java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
* java.lang.Class.getDeclaredMethods0(Native Method)
* java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
* java.lang.Class.getDeclaredMethods(Class.java:1791)
* java.beans.Introspector$1.run(Introspector.java:1272)
* java.security.AccessController.doPrivileged(Native Method)
*
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
*
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
* java.beans.Introspector.getBeanInfo(Introspector.java:387)
* java.beans.Introspector.getBeanInfo(Introspector.java:159)
*
org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:84)
*
org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.getAdapter(PropertyAccessImpl.java:65)
*
org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.infoForTerm(PropertyConduitSourceImpl.java:401)
*
org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:160)
*
org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSou

T5: Function Tapestry.Validator.email() does not exist for field 'email'.

2008-10-02 Thread buckofive

Hi all,

I just updated to the latest snapshot 5.0.16-SNAPSHOT and I'm getting a
client side error during the initial page load:

Function Tapestry.Validator.email() does not exist for field 'email'.

My Entity method is defined as:
@Validate("required,maxlength=70,email")
public String getEmail() {
return this.email;
}


This previously worked in 5.0.15-SNAPSHOT, so I thought I'd ask and see if
anyone else has run into this issue or if maybe the syntax has changed? 
Thanks in advance.

Cheers,
B

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Function-Tapestry.Validator.email%28%29-does-not-exist-for-field-%27email%27.-tp19792973p19792973.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: tapestry-spring-security still processes form submissions after logout

2008-09-10 Thread buckofive

Hi all,

I am using tapestry-spring-security version 2.0.0-SNAPSHOT (awesome plugin
btw) and everything seems to work perfectly except when the combined steps
are executed below:

- go to a secured page with a form on it. i.e. @Secured("ROLE_ADMIN") public
class ...
- logout using the LogoutService (which then redirects to the login page)
- click the back button on the browser (so I'm on the previous page with the
secured form on it)
- click the submit button

The form submission is processed as normal without checking the users
permissions or if the user is even logged in.  I have even tried adding
@Secured to the form processing method but I still get the same results.   I
have also verified by going to another page that the user is truly logged
out.   Has anyone else run into this issue or suggest a workaround?

thanks,
B

-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-spring-security-still-processes-form-submissions-after-logout-tp19428417p19428417.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] tapestry-hibernate and transactions

2008-09-03 Thread buckofive

Hi guys,

I have run into a related issue.  I am using a thrid party library which
creates transactions, commits and also performs rollbacks internally.   When
ever a transaction is rolledback in the third party library I later see a
hibernate exception in the log file:

org.hibernate.TransactionException: Transaction not successfully started
at
org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
at
org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl.threadDidCleanup(HibernateSessionManagerImpl.java:65)


ThreadDidCleanup looks like this in tapestry-hibernate:

public void threadDidCleanup()
{
transaction.rollback();

session.close();
}


The problem is because threadDidCleanup() is not checking to see if it's
internal reference has already been rolled back (somewhere else) before
calling rollback (via Transaction.wasRolledback()).  

I'm not sure if I should file a new JIRA or re-open
https://issues.apache.org/jira/browse/TAPESTRY-2454. Please advise.

thanks,
B




-- 
View this message in context: 
http://www.nabble.com/-T5--tapestry-hibernate-and-transactions-tp17767677p19300096.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: tapestry-hibernate problem when setting @Persist("entity") to a transient object

2008-08-15 Thread buckofive

Hi all,

I am having some problems creating a simple crud with tapestry-hibernate
5.0.14.   I followed the documentation and I have it mostly working.  I can
edit and save an existing entity with the @Persist("entity") annotation but
if I try to create a new entity by setting the value to a newly instantiated
entity I get this error:

# org.apache.tapestry5.runtime.ComponentEventException
Error persisting field PersistEntity:button: Failed persisting an entity in
the session. Only entities attached to a Hibernate Session can be persisted.
entity: [EMAIL PROTECTED]

context
eventType
setToTransient

# org.hibernate.TransientObjectException
object references an unsaved transient instance - save the transient
instance before flushing: com.roialte.entities.Button

I figured I was doing something wrong so I copied the PersistEntity.tml and
PersistEntity.java into my project from the tapestry-hibernate project. 
loaded the page and clicked the "set to transient" link and I got the same
error.  

I am at a loss here as i cannot figure out what I'm doing wrong.   How do u
create a new entity for use within an edit page when using the
@Persist('entity') annotation?  I am using tapestry versions 5.0.14 and
mysql 5.0 for my db.  Any help is greatly appreciated. 

Thanks!


here is a quick peek at my converted version of code from the
tapesty-hibernate project:

java:
public class PersistEntity
{
@Persist("entity")
@Property
private Button button;

@Inject
private ButtonDAO ButtonDAO;

@Inject
private Session session;

@Inject
private HibernateSessionManager manager;

void onCreateEntity()
{
Button button = new Button();
button.setName("name");

ButtonDAO.save(button);

this.button = button;
}

void onChangeName()
{
button.setName("name2");

// No commit, so no real change.
}

void onSetToTransient()
{
button = new Button();
}

void onSetToNull()
{
button = null;
}

void onDelete()
{
List buttons = ButtonDAO.findAll();

ButtonDAO.delete(buttons.toArray(new Button[0]));
}
}


@Entity
@Table(name = "button", catalog = "test", uniqueConstraints = {})
public class Button {

private Integer id;
private String name;


@Id 
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id", unique = true, nullable = false, insertable = true,
updatable = true)
public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}


@Column(name = "name", unique = false, nullable = false, insertable = 
true,
updatable = true, length=128)
@Validate("required,maxlength=128")
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}

tml:
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

entity name: ${button.name}
create entity
change the name
set to null
delete
set to 
transient






-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-hibernate-problem-when-setting-%40Persist%28%22entity%22%29-to-a-transient-object-tp18996169p18996169.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 5.0.13 has drop TapestryConstants package ?

2008-06-18 Thread buckofive

LITERAL_BINDING_PREFIX and PROP_BINDING_PREFIX 
are now in org.apache.tapestry5.BindingConstants
as LITERAL and PROP

Cheers


CG-6 wrote:
> 
> Hi Weisu,
>   I did come across this SymbolConstants but it does not contain
> LITERAL_BINDING_PREFIX  and PROP_BINDING_PREFIX ..
> 
> CG
> 
> 
> 
> 
> On Thu, Jun 19, 2008 at 8:55 AM, Weisu <[EMAIL PROTECTED]> wrote:
>>
>> Hi CG, in T5.0.13, this has changed to 'SymbolConstants' and is under
>> org.apache.tapestry5.*
>> Weisu.
>>
>> CG-6 wrote:
>>>
>>> I am a newbie , my question may a bit weird because I do not have deep
>>> knowledge in Tapestry.
>>>
>>> I am following this article in wiki to create own binding prefix to
>>> support array/list values
>>> http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix
>>>
>>> my program work fine in 5.0.11 but it does not compile in 5.0.13
>>> because TapestryConstants has been drop
>>>
>>> The following constants are involved
>>> TapestryConstants.LITERAL_BINDING_PREFIX
>>> TapestryConstants.PROP_BINDING_PREFIX
>>>
>>> I have read in the 5.0.11 source and get the value of those Constants
>>> and manage to get my program build in 5.0.13
>>>
>>> However, I would like to know , whether in T 5.0.13,  are those
>>> constants kept in other package , or the prefix binding in the
>>> Tapestry internal has changed and no longer use the old way.
>>>
>>>
>>> CG
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5-5.0.13-has-drop-TapestryConstants-package---tp17994992p17995209.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-5.0.13-has-drop-TapestryConstants-package---tp17994992p17997631.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: ajax component ids with namespaces

2008-04-25 Thread buckofive


After fiddling with protoype the $$ coupled with the !^ selector seems to
work.  I'm including some custom helper code to accomplish getting an
element by id without regard to the tapestry id namespace.  If this is/was
obvious or there is better solution, I apologize but hopefully this will be
helpful to others.

// gets the first element where the id begins with the 'id_starts_with'
argument.
function $G(id_starts_with)
{
return( $G_(id_starts_with)[0] );
}

// gets all elements where their id's begin with the 'id_starts_with'
argument.
function $G_(id_starts_with)
{
return( $$("[id^='"+id_starts_with+"']") );
}


to get access to this T5 namespaced node : 
   
call
$G('foo')


cheers,
B
-- 
View this message in context: 
http://www.nabble.com/T5%3A-ajax-component-ids-with-namespaces-tp16826268p16908236.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: ajax component ids with namespaces

2008-04-22 Thread buckofive

Hi All,

I recently updated to Tapestry 5.0.11 from 5.0.10 and unfortunately my
custom javascript calls are broken because component id's returned from ajax
calls now have a ":#" next to them.  For example when I try to get a
reference to an object say $('foo') it doesn't exist because it is now
$('foo:12234') and this id changes on every ajax refresh.I read the post
from Howard about this being a namespace for ajax requests
(http://thread.gmane.org/gmane.comp.java.tapestry.user/59677/focus=59697)
but I'm a little confused as to how I get access to these nodes with scripts
now? Can the AJAX namespacing be turned off (globally or at the component
level)?  Does anyone have a workaround for this?  

Much thanks in adavanced,
B

-- 
View this message in context: 
http://www.nabble.com/T5%3A-ajax-component-ids-with-namespaces-tp16826268p16826268.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] Help getting generics to work

2008-03-07 Thread buckofive

Howard,

Thank you for the quick response!  Are there intentions to get Tapestry to
support generics for cases like this when its released?  It would really be
great to have this kind of support (I've already come across a few cases
where it would come in very handy).

Thanks again,
B



Howard Lewis Ship wrote:
> 
> Tapestry only understands simple generics applied directly to your
> page or component class.
> 
> On Thu, Mar 6, 2008 at 4:59 PM, buckofive <[EMAIL PROTECTED]> wrote:
>>
>>
>>  Hi all,
>>
>>  I'm wondering if this is even possible.   I read that java 1.5 generics
>>  support was as added as of tapestry 5.0.10 but I am unable to get it to
>>  work.  I always end up with this exception:
>>  "Class java.lang.Object does not contain a property named 'id' (within
>>  property expression 'genericsTest.instance.id').  Available properties:
>>  class."
>>
>>  I have tried this with 5.0.10 and 5.0.11-SNAPSHOT.  I would greatly
>>  appreciate any help, I'm sure its something silly that I'm missing.
>>
>>  Thank you in advance!
>>
>>
>>  Here is the code I am using:
>>
>>  public class Start
>>  {
>> private Generic genericsTest = new Generic(new
>> Test(555));
>> public Generic getGenericsTest() {return genericsTest;}
>> public void setGenericsTest(Generic test)
>> {this.genericsTest=test;}
>>  }
>>
>>
>>  public class Generic {
>> T instance;
>>
>> public Generic(T instance)
>> {
>> this.instance=instance;
>> }
>>
>> public T getInstance() {return instance;}
>> public void setInstance(T instance) {this.instance = instance;}
>>  }
>>
>>
>>  public class Test
>>  {
>> int id;
>> public Test(int id)
>> {
>> this.id = id;
>> }
>> public int getId() {return id;}
>> public void setId(int id) {this.id = id;}
>>  }
>>
>>  Start.tml:
>>
>>  Java 1.5 Generics Test: ${genericsTest.instance.id}
>>
>>
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/-T5--Help-getting-generics-to-work-tp15885528p15885528.html
>>
>>
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>>  -
>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Help-getting-generics-to-work-tp15885528p15909013.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Help getting generics to work

2008-03-06 Thread buckofive

Hi all,

I'm wondering if this is even possible.   I read that java 1.5 generics
support was as added as of tapestry 5.0.10 but I am unable to get it to
work.  I always end up with this exception:
"Class java.lang.Object does not contain a property named 'id' (within
property expression 'genericsTest.instance.id').  Available properties:
class."

I have tried this with 5.0.10 and 5.0.11-SNAPSHOT.  I would greatly
appreciate any help, I'm sure its something silly that I'm missing.  

Thank you in advance!


Here is the code I am using:

public class Start
{
private Generic genericsTest = new Generic(new Test(555));
public Generic getGenericsTest() {return genericsTest;}
public void setGenericsTest(Generic test) 
{this.genericsTest=test;}
}


public class Generic {
T instance;

public Generic(T instance)
{
this.instance=instance;
}

public T getInstance() {return instance;}
public void setInstance(T instance) {this.instance = instance;} 
}


public class Test
{
int id;
public Test(int id)
{
this.id = id;
}
public int getId() {return id;}
public void setId(int id) {this.id = id;}
}

Start.tml:

 Java 1.5 Generics Test: ${genericsTest.instance.id}



-- 
View this message in context: 
http://www.nabble.com/Help-getting-generics-to-work-tp15885528p15885528.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get HttpServletResponse Object in Tapestry.

2008-01-08 Thread buckofive

I belive this is covered here:

http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest

and then take a look at api docs:

http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/services/RequestGlobals.html

cheers,
B



swapnilpatil wrote:
> 
> How to get HttpServletResponse Object in Tapestry?
> 
> Can anyone show me the actual code which is creating an
> HttpServletResponse & HttpServletRequest Objects in Tapestry.
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-HttpServletResponse-Object-in-Tapestry.-tp14705483p14706094.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread buckofive

Hi all,
Thank you for the responses.

I'm a little better but still not there.  As you can see my log starts off
good but once tapestry is initialized there are no more logs generated from
hibernate or spring.   At the very end you can see where my DAO
(SubjectDAO.java) fetches some records from the db, and then only logs from
my DAO are generated.  Any ideas?

Here is my start up log:

launching Jetty webapp: /jpa on address: 0.0.0.0:8080 using dir:
[S:\Java\workspaces_eclipse6\companies\jpa-test\src\main\webapp] 
22:15:32.312 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>16> added [EMAIL PROTECTED]
22:15:32.265 INFO   [main] org.mortbay.log.LogImpl.reset(LogImpl.java:228)
>11> reset
22:15:32.312 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>11> added [EMAIL PROTECTED]
22:15:32.968 INFO   [main]
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:178)
>09> Root WebApplicationContext: initialization started
22:15:33.046 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:378)
>12> Refreshing
[EMAIL PROTECTED]:
display name [Root WebApplicationContext]; startup date [Tue Jan 08 22:15:33
PST 2008]; root of context hierarchy
22:15:33.234 INFO   [main]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
>19> Loading XML bean definitions from class path resource
[applicationContext.xml]
22:15:34.109 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:393)
>12> Bean factory for application context
[EMAIL PROTECTED]:
[EMAIL PROTECTED]
22:15:34.359 INFO   [main]
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker.postProcessAfterInitialization(AbstractApplicationContext.java:1006)
>21> Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
22:15:34.390 INFO   [main]
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:276)
>12> Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[entityManagerFactory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,SubjectDAO,StudentDAO];
root of factory hierarchy
22:15:34.437 INFO   [main]
org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:76)
>21> Building JPA EntityManagerFactory for persistence unit 'jpaTestPU'
22:15:34.562 INFO   [main]
org.hibernate.cfg.annotations.Version.(Version.java:15) >26>
Hibernate Annotations 3.3.0.GA
22:15:34.625 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:514) >30> Hibernate
3.2.5
22:15:34.656 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:547) >30>
hibernate.properties not found
22:15:34.656 INFO   [main]
org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:681)
>31> Bytecode provider name : cglib
22:15:34.671 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:598) >30> using JDK
1.4 java.sql.Timestamp handling
22:15:34.906 INFO   [main]
org.hibernate.ejb.Version.(Version.java:15) >25> Hibernate
EntityManager 3.3.1.GA
22:15:35.515 INFO   [main]
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:398) >32>
Binding entity from annotated class: com.jpa.db.Subject
22:15:35.656 INFO   [main]
org.hibernate.cfg.annotations.EntityBinder.bindTable(EntityBinder.java:420)
>33> Bind entity com.jpa.db.Subject on table subject
22:15:35.937 INFO   [main]
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:398) >32>
Binding entity from annotated class: com.jpa.db.Student
22:15:35.937 INFO   [main]
org.hibernate.cfg.annotations.EntityBinder.bindTable(EntityBinder.java:420)
>33> Bind entity com.jpa.db.Student on table student
22:15:36.203 INFO   [main]
org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:627)
>35> Mapping collection: com.jpa.db.Subject.students -> student
22:15:36.234 INFO   [main]
org.hibernate.validator.Version.(Version.java:17) >36> Hibernate
Validator 3.0.0.GA
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:41)
>31> Using Hibernate built-in connection pool (not for production use!)
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:42)
>31> Hibernate connection pool size: 20
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:45)
>31> autocommit mode: true
22:15:36.421 INFO   [main]
org.

Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-07 Thread buckofive

Is no one else having issues logging 3rd party libraries?  I am unable to get
any hibernate or spring logs.  I have tried creating several different
tapestry test projects using the 5.0.7 archetype but with I still get
nothing.  They all seem to only log tapestry framework and "my pages" logs. 
Could someone who has success logging hibernate post their log4j.properties
file? Please. Pretty Please ... with sugar on top.

thanks,
B



buckofive wrote:
> 
> Hi all,
> 
> I'm stuck at the moment trying to get log4j to log any 3rd party
> libraries.  It seems to work fine for classes within my web project(ie
> page classes etc.) and if I set the root level to debug I get what looks
> like mostly  web container statements.  Any help would be much
> appreciated.  
> 
> Here is a very basic version of my log4j.properties file:
> 
> [code]
> log4j.rootCategory=WARN, A1
> 
> # A1 is set to be a ConsoleAppender. 
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> 
> # A1 uses PatternLayout.
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
> 
> log4j.category.org.apache.tapestry.TapestryFilter=info
> log4j.category.org.apache.tapestry=error
> log4j.category.tapestry=error
> 
> log4j.category.com.jpa=error
> 
> # Service category names are the name of the defining module class
> # and then the service id.
> log4j.category.com.jpa.services.AppModule.TimingFilter=info
> 
> log4j.category.org.hibernate=debug
> 
> [/code]
> 
> 
> Whats weird is these settings works fine in a non-tapestry application.  I
> created my project with the tapestry 5.0.7 archetype and my file is
> located in \src\main\resources\log4j.properties.  Am I missing
> something or doing something wrong?
> 
> thanks in advance,
> B
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--5.0.7---Help-with-log4j.properties-file-tp14611599p14678257.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] 5.0.7 - Help with log4j.properties file

2008-01-03 Thread buckofive

Hi all,

I'm stuck at the moment trying to get log4j to log any 3rd party libraries. 
It seems to work fine for classes within my web project(ie page classes
etc.) and if I set the root level to debug I get what looks like mostly  web
container statements.  Any help would be much appreciated.  

Here is a very basic version of my log4j.properties file:

[code]
log4j.rootCategory=WARN, A1

# A1 is set to be a ConsoleAppender. 
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n

log4j.category.org.apache.tapestry.TapestryFilter=info
log4j.category.org.apache.tapestry=error
log4j.category.tapestry=error

log4j.category.com.jpa=error

# Service category names are the name of the defining module class
# and then the service id.
log4j.category.com.jpa.services.AppModule.TimingFilter=info

log4j.category.org.hibernate=debug

[/code]


Whats weird is these settings works fine in a non-tapestry application.  I
created my project with the tapestry 5.0.7 archetype and my file is located
in \src\main\resources\log4j.properties.  Am I missing something or
doing something wrong?

thanks in advance,
B

-- 
View this message in context: 
http://www.nabble.com/-T5--5.0.7---Help-with-log4j.properties-file-tp14611599p14611599.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]