You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by robnangle <ro...@gmail.com> on 2011/03/01 13:18:54 UTC

org.apache.tapestry5.runtime.ComponentEventException

I have seen a couple thru the forum but I dont think they apply to the error
im getting.

org.apache.tapestry5.runtime.ComponentEventException
context
eventType:
action
location:
context:SelectPlayers.tml, line 10
5	    <body>
6	        <h1>Select Player</h1>
7	
8			
9	
10	        <t:form t:id="user_team">
11	        	<input align="center" t:type="TextField" t:id="team_name"
size="25" value="team_name" />
12	        	
13	            <t:select t:id="goalkeeper" model="goalkeepers"
value="keeper"/><br/><br/>
14	            
15	            <t:select t:id="fullBack1" model="fullBack"
value="fullBack1"/>
org.apache.tapestry5.runtime.ComponentEventException
context
eventType:
success
location:
context:SelectPlayers.tml, line 10
java.lang.NullPointerException
Hide uninteresting stack frames Stack trace 
FantasyGaa.pages.SelectPlayers.onSuccess(SelectPlayers.java:246)
FantasyGaa.pages.SelectPlayers.dispatchComponentEvent(SelectPlayers.java)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:902)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081)
org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:263)
org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:398)
org.apache.tapestry5.corelib.components.Form$onAction$invocation_12e7158d084.invokeAdvisedMethod(Form$onAction$invocation_12e7158d084.java)
org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71)
org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37)
org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54)
org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80)
org.apache.tapestry5.corelib.components.Form.onAction(Form.java)
org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:910)
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081)
org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75)
org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164)
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245)
FantasyGaa.services.AppModule$1.service(AppModule.java:90)
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85)
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103)
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197)
org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726)
org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127)


Any help would be greatly appreciated.


-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3404853.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Richard Hill <ri...@su3analytics.com>.
Yes. query the db for the id that has been created.


On Wed, 2011-03-02 at 03:49 -0800, robnangle wrote:
> Is it because when a new user registers there user id is set by the database
> and not the java class? If so is there any way of solving the problem?
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3406425.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
> 



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


Re: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Is it because when a new user registers there user id is set by the database
and not the java class? If so is there any way of solving the problem?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3406425.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Tue, Mar 1, 2011 at 9:59 AM, robnangle <ro...@gmail.com> wrote:
>
> Richard Hill-7 wrote:
>>
>> I haven't used the @SessionState annotation, I use the
>> ApplicationStateManager directly to store SSOs but a quick look at the
>> docs suggest it's doing the same thing.
>>
>> Firstly, I don't understand your User class - it seems to also contain a
>> User field? Sounds like a stackoverflow in the making....
>>
>> Secondly, whatever object you're persisting as an SSO does not need it's
>> class annotated with @SessionState.
>>
>> AFAIU tapestry will instantiate any SSO that you access if it's null
>> (you can override this behaviour). However of course any class fields
>> will be null unless they get instantiated in the default constructor
>> somehow.

Tapestry does some tricky things with bytecode transformation. Often,
it stops using your fields entirely, so what you see in the debugger
may not match what's really going on in the live code.  This is
somewhat fixed in trunk (5.3.0) and will be fixed in 5.2.5.


>>
>> A very simple login might look like this (ignoring things like hashing
>> passwords):
>>
>> @SessionState(create=false)
>> private User user;
>>
>> @Property
>> private String loginName;
>> @Propety
>> private String password;
>>
>> @Inject
>> private UserDao userDao;
>>
>> private String onSuccessFromLoginForm() {
>>
>>     user = userDao.get(loginName);
>>
>>     if (user != null && user.getPassword().equals(password) {
>>          return "PrivatePage";
>>     } else {
>>        user = null;  // if user is null not logged in
>>     }
>>     return null; // stay on login page
>> }
>>
>> Now assuming the passwords matched, user should be non-null on other
>> pages.
>>
>
> Yes the user is not null, as when I navigate from that page I display:
>
> Logged in as: username
>
> But the user_id still remains null for some reason.
>
> Tryed setting it in the user constructor but no difference:
> user(string user_id) {
> this.user_id = user_id;}
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405407.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
>
>



-- 
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: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Richard Hill-7 wrote:
> 
> I haven't used the @SessionState annotation, I use the
> ApplicationStateManager directly to store SSOs but a quick look at the
> docs suggest it's doing the same thing.
> 
> Firstly, I don't understand your User class - it seems to also contain a
> User field? Sounds like a stackoverflow in the making....
> 
> Secondly, whatever object you're persisting as an SSO does not need it's
> class annotated with @SessionState.
> 
> AFAIU tapestry will instantiate any SSO that you access if it's null
> (you can override this behaviour). However of course any class fields
> will be null unless they get instantiated in the default constructor
> somehow.
> 
> A very simple login might look like this (ignoring things like hashing
> passwords):
> 
> @SessionState(create=false)
> private User user;
> 
> @Property
> private String loginName;
> @Propety
> private String password;
> 
> @Inject
> private UserDao userDao;
> 
> private String onSuccessFromLoginForm() {
> 
>     user = userDao.get(loginName);
>    
>     if (user != null && user.getPassword().equals(password) {
>          return "PrivatePage";
>     } else {
>        user = null;  // if user is null not logged in
>     }
>     return null; // stay on login page
> }
> 
> Now assuming the passwords matched, user should be non-null on other
> pages.
> 

Yes the user is not null, as when I navigate from that page I display:

Logged in as: username

But the user_id still remains null for some reason.

Tryed setting it in the user constructor but no difference: 
user(string user_id) {
this.user_id = user_id;}


-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405407.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Rich M <ri...@moremagic.com>.
If you want it to return a String, do something like this. Also, 
@SessionState would not be necessary in a class like this. The 
@SessionState in your page class(es) will maintain the object for you.

public class User {
     private String user_id;

     public User getUser_id() { return user_id; }
     public void setUser_id(String user_id){ this.user_id = user_id; }
     public void setUser(User user){ this.user_id = user.getUser_id; }

}

If you haven't already done so at login or something along those lines 
before a user gets to the page in question, you'll want to do something 
like the following (maybe in onActivate rather, but I don't know your 
application) otherwise it would make sense that the @SessionState User 
user_id is null.

@SetupRender
void initUser(){
     if(user_id == null || user_id.getUser_id() == null){
         user_id = new User();
         user_id.setUser_id( /* whatever the user_id String would be 
that you need to set */ );
     }
}

> Yes I have a method like that but it keep's returning null, my user class:
>
>           //These were originally strings but changed in an effort to get
> working
>
> 	@SessionState
> 	private User user_id;
>
>          public User getUser_id() {
> 		return user_id;
> 	}
>
> 	public void setUser_id(User user_id) {
> 		this.user_id = user_id;
> 	}
>
> then the in my page:
>
>          @SessionState
> 	private User user;
>
>          @Property
> 	private String user_id;
>
>          public User getUser() {
> 		return user;
> 	}
> 	
> 	public void setUser(User user) {
> 		this.user = user;
> 	}	
>
>         prep.setString(1, user_id);
>
>
>
>
>
>


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


RE: org.apache.tapestry5.runtime.ComponentEventException

Posted by Richard Hill <ri...@su3analytics.com>.
I haven't used the @SessionState annotation, I use the
ApplicationStateManager directly to store SSOs but a quick look at the
docs suggest it's doing the same thing.

Firstly, I don't understand your User class - it seems to also contain a
User field? Sounds like a stackoverflow in the making....

Secondly, whatever object you're persisting as an SSO does not need it's
class annotated with @SessionState.

AFAIU tapestry will instantiate any SSO that you access if it's null
(you can override this behaviour). However of course any class fields
will be null unless they get instantiated in the default constructor
somehow.

A very simple login might look like this (ignoring things like hashing
passwords):

@SessionState(create=false)
private User user;

@Property
private String loginName;
@Propety
private String password;

@Inject
private UserDao userDao;

private String onSuccessFromLoginForm() {

    user = userDao.get(loginName);
   
    if (user != null && user.getPassword().equals(password) {
         return "PrivatePage";
    } else {
       user = null;  // if user is null not logged in
    }
    return null; // stay on login page
}

Now assuming the passwords matched, user should be non-null on other
pages.





On Tue, 2011-03-01 at 07:01 -0800, robnangle wrote:
> Richard Hill-7 wrote:
> > 
> > 
> > Getting the user id depends on what public methods your user object has.
> > Presumably it has something like .getId() ?
> > 
> > 
> > 
> > On Tue, 2011-03-01 at 06:44 -0800, robnangle wrote:
> >> Im probably wording the question wrong but that returns something like a
> >> memory address: Entities.User@12e7cb6
> >> 
> >> I want to find the user_id of that user?
> >> 
> > 
> > 
> > 
> > 
> > 
> 
> Yes I have a method like that but it keep's returning null, my user class:
> 
>          //These were originally strings but changed in an effort to get
> working
> 
> 	@SessionState
> 	private User user_id;
> 
>         public User getUser_id() {
> 		return user_id;
> 	}
> 
> 	public void setUser_id(User user_id) {
> 		this.user_id = user_id;
> 	}
> 
> then the in my page:
> 
>         @SessionState
> 	private User user;
> 
>         @Property
> 	private String user_id;
> 
>         public User getUser() {
> 		return user;
> 	}
> 	
> 	public void setUser(User user) {
> 		this.user = user;
> 	}	
> 
>        prep.setString(1, user_id);
> 
> 
> 
> 
> 
> 



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


RE: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Richard Hill-7 wrote:
> 
> 
> Getting the user id depends on what public methods your user object has.
> Presumably it has something like .getId() ?
> 
> 
> 
> On Tue, 2011-03-01 at 06:44 -0800, robnangle wrote:
>> Im probably wording the question wrong but that returns something like a
>> memory address: Entities.User@12e7cb6
>> 
>> I want to find the user_id of that user?
>> 
> 
> 
> 
> 
> 

Yes I have a method like that but it keep's returning null, my user class:

         //These were originally strings but changed in an effort to get
working

	@SessionState
	private User user_id;

        public User getUser_id() {
		return user_id;
	}

	public void setUser_id(User user_id) {
		this.user_id = user_id;
	}

then the in my page:

        @SessionState
	private User user;

        @Property
	private String user_id;

        public User getUser() {
		return user;
	}
	
	public void setUser(User user) {
		this.user = user;
	}	

       prep.setString(1, user_id);






-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405064.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Richard Hill <ri...@su3analytics.com>.
Getting the user id depends on what public methods your user object has.
Presumably it has something like .getId() ?



On Tue, 2011-03-01 at 06:44 -0800, robnangle wrote:
> Im probably wording the question wrong but that returns something like a
> memory address: Entities.User@12e7cb6
> 
> I want to find the user_id of that user?
> 



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


RE: org.apache.tapestry5.runtime.ComponentEventException

Posted by Kristian Marinkovic <kr...@porscheinformatik.at>.
override the toString() implementation of your user entity... you can use 
apache-commons ToStringBuilder.



Von:    robnangle <ro...@gmail.com>
An:     users@tapestry.apache.org
Datum:  01.03.2011 15:44
Betreff:        RE: org.apache.tapestry5.runtime.ComponentEventException



Im probably wording the question wrong but that returns something like a
memory address: Entities.User@12e7cb6

I want to find the user_id of that user?

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405030.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Im probably wording the question wrong but that returns something like a
memory address: Entities.User@12e7cb6

I want to find the user_id of that user?

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405030.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by WINDEY Pieter AWL-IT <pi...@atosorigin.com>.
        >>> Hi,
        >>>Is there any way to convert the @Sessionstate user value to a string or a
        >>>readable value?

Yes
user.toString() !





Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

"The information contained in this e-mail and any attachment thereto is confidential and may contain information which is protected by intellectual property rights.
This information is intended for the exclusive use of the recipient(s) named above.
This e-mail does not constitute any binding relationship or offer toward any of the addressees.
If you are not one of the addressees , one of their employees or a proxy holder entitled to hand over this message to the addressee(s), any use of the information contained herein (e.g. reproduction, divulgation, communication or distribution,...) is prohibited.
If you have received this message in error, please notify the sender and destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability."


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


Re: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Hi,
Is there any way to convert the @Sessionstate user value to a string or a
readable value?

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3405008.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Hi ye the craeateDb() set's all of that. Got it sorted anyway, thanks people.
I didn'y fully understand the @Property annotation, that was my problem. All
the elements were null.

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3404965.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Kristian Marinkovic <kr...@porscheinformatik.at>.
where is your connection (field conn) set?



Von:    robnangle <ro...@gmail.com>
An:     users@tapestry.apache.org
Datum:  01.03.2011 13:53
Betreff:        Re: org.apache.tapestry5.runtime.ComponentEventException



Yes stupidly I forgot to set the connection but the errors remain. The
onSuccess():

public String onSuccess() throws Exception {
                                 createDb();
                                 String statement = "INSERT INTO 
teams(user_id, team_name, keeper,
fullBack1, fullBack2, fullBack3, halfBack1, halfBack2, halfBack3, 
midfield1,
midfield2, halfForward1, halfForward2, halfForward3, fullForward1,
fullForward2, fullForward3) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?,
?, ?, ?)";
                                 prep = conn.prepareStatement(statement);
                                 prep.setObject(1, team.getUser_id());
                                 prep.setString(2, team.getTeam_name());
                                 prep.setString(3, team.getKeeper());
                                 prep.setString(4, team.getFullBack1());
                                 prep.setString(5, team.getFullBack2());
                                 prep.setString(6, team.getFullBack3());
                                 prep.setString(7, team.getHalfBack1());
                                 prep.setString(8, team.getHalfBack2());
                                 prep.setString(9, team.getHalfBack3());
                                 prep.setString(10, team.getMidfield1());
                                 prep.setString(11, team.getMidfield2());
                                 prep.setString(12, 
team.getHalfForward1());
                                 prep.setString(13, 
team.getHalfForward2());
                                 prep.setString(14, 
team.getHalfForward3());
                                 prep.setString(15, 
team.getFullForward1());
                                 prep.setString(16, 
team.getFullForward2());
                                 prep.setString(17, 
team.getFullForward3());
                                 prep.executeUpdate();
                                 return "index";  
                 }

I know its not a great idea to have the code in here, once working it will
be moved to the correct package.

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3404886.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Yes stupidly I forgot to set the connection but the errors remain. The
onSuccess():

public String onSuccess() throws Exception {
		createDb();
		String statement = "INSERT INTO teams(user_id, team_name, keeper,
fullBack1, fullBack2, fullBack3, halfBack1, halfBack2, halfBack3, midfield1,
midfield2, halfForward1, halfForward2, halfForward3, fullForward1,
fullForward2, fullForward3) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?)";
		prep = conn.prepareStatement(statement);
		prep.setObject(1, team.getUser_id());
		prep.setString(2, team.getTeam_name());
		prep.setString(3, team.getKeeper());
		prep.setString(4, team.getFullBack1());
		prep.setString(5, team.getFullBack2());
		prep.setString(6, team.getFullBack3());
		prep.setString(7, team.getHalfBack1());
		prep.setString(8, team.getHalfBack2());
		prep.setString(9, team.getHalfBack3());
		prep.setString(10, team.getMidfield1());
		prep.setString(11, team.getMidfield2());
		prep.setString(12, team.getHalfForward1());
		prep.setString(13, team.getHalfForward2());
		prep.setString(14, team.getHalfForward3());
		prep.setString(15, team.getFullForward1());
		prep.setString(16, team.getFullForward2());
		prep.setString(17, team.getFullForward3());
		prep.executeUpdate();
		return "index";		
	}

I know its not a great idea to have the code in here, once working it will
be moved to the correct package.

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3404886.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 01 Mar 2011 09:35:00 -0300, robnangle <ro...@gmail.com> wrote:

> Ye I noticed that but cant see what could be wrong with that line:
>
> Line 245:
> String statement = "INSERT INTO teams(user_id, team_name, keeper,  
> fullBack1,
> fullBack2, fullBack3, halfBack1, halfBack2, halfBack3, midfield1,  
> midfield2,
> halfForward1, halfForward2, halfForward3, fullForward1, fullForward2,
> fullForward3) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
> 		
> Line 246:
> prep = conn.prepareStatement(statement);

The conn variable seems to be null. And are you sure you want JDBC code in  
a Tapestry page?

-- 
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: org.apache.tapestry5.runtime.ComponentEventException

Posted by robnangle <ro...@gmail.com>.
Ye I noticed that but cant see what could be wrong with that line:

Line 245:
String statement = "INSERT INTO teams(user_id, team_name, keeper, fullBack1,
fullBack2, fullBack3, halfBack1, halfBack2, halfBack3, midfield1, midfield2,
halfForward1, halfForward2, halfForward3, fullForward1, fullForward2,
fullForward3) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
		
Line 246:
prep = conn.prepareStatement(statement);

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/org-apache-tapestry5-runtime-ComponentEventException-tp3404853p3404869.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: org.apache.tapestry5.runtime.ComponentEventException

Posted by Bryan Lewis <jb...@gmail.com>.
The stack trace says you have an NPE in your onSuccess method, at
SelectPlayers.java:246.  The ComponentEventException has little to do with
it... it's only saying the exception occurred during the 'success' event.


On Tue, Mar 1, 2011 at 7:18 AM, robnangle <ro...@gmail.com> wrote:

> I have seen a couple thru the forum but I dont think they apply to the
> error
> im getting.
>
> org.apache.tapestry5.runtime.ComponentEventException
> context
> eventType:
> action
> location:
> context:SelectPlayers.tml, line 10
> 5           <body>
> 6               <h1>Select Player</h1>
> 7
> 8
> 9
> 10              <t:form t:id="user_team">
> 11                      <input align="center" t:type="TextField"
> t:id="team_name"
> size="25" value="team_name" />
> 12
> 13                  <t:select t:id="goalkeeper" model="goalkeepers"
> value="keeper"/><br/><br/>
> 14
> 15                  <t:select t:id="fullBack1" model="fullBack"
> value="fullBack1"/>
> org.apache.tapestry5.runtime.ComponentEventException
> context
> eventType:
> success
> location:
> context:SelectPlayers.tml, line 10
> java.lang.NullPointerException
> Hide uninteresting stack frames Stack trace
> FantasyGaa.pages.SelectPlayers.onSuccess(SelectPlayers.java:246)
> FantasyGaa.pages.SelectPlayers.dispatchComponentEvent(SelectPlayers.java)
>
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:902)
>