[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1622) NPE in PassivatedEntity
by Christian Bauer (JIRA)
NPE in PassivatedEntity
-----------------------
Key: JBSEAM-1622
URL: http://jira.jboss.com/jira/browse/JBSEAM-1622
Project: JBoss Seam
Issue Type: Bug
Components: Core
Reporter: Christian Bauer
Priority: Minor
Until I write tests (next week), only reproducible in the wiki example: Open start page, click Edit, click Register, click Exit.
java.lang.NullPointerException
at org.jboss.seam.contexts.PassivatedEntity.passivateEntity(PassivatedEntity.java:155)
at org.jboss.seam.contexts.EntityBean.passivate(EntityBean.java:50)
at org.jboss.seam.contexts.ServerConversationContext.isAttributeDirty(ServerConversationContext.java:286)
at org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:256)
at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:371)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:83)
at org.jboss.seam.jsf.SeamPhaseListener.afterRender(SeamPhaseListener.java:515)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:230)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Code that runs on Exit:
public void exitConversation() {
Conversation currentConversation = Conversation.instance();
currentConversation.end();
ConversationEntry entryPoint =
(ConversationEntry)Contexts.getConversationContext().get("conversationEntryPoint");
FacesMessages messages = (FacesMessages)Component.getInstance("facesMessages");
FacesManager.instance().switchConversation(entryPoint.getId());
Contexts.getConversationContext().set("org.jboss.seam.faces.facesMessages", messages);
Conversation.instance().redirect();
}
Log:
17:18:54,193 TRACE [SeamPhaseListener] before phase: RESTORE_VIEW 1
17:18:54,193 DEBUG [FacesLifecycle] >>> Begin JSF request
17:18:54,194 DEBUG [SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
17:18:54,194 TRACE [SeamPhaseListener] after phase: RESTORE_VIEW 1
17:18:54,195 DEBUG [ConversationPropagation] Found conversation id in request parameter: 8
17:18:54,195 DEBUG [Manager] Restoring conversation with id: 8
17:18:54,195 DEBUG [SeamPhaseListener] After restoring conversation context: ConversationContext(8)
17:18:54,195 DEBUG [SeamPhaseListener] committing transaction after phase: RESTORE_VIEW 1
17:18:54,196 TRACE [SeamPhaseListener] before phase: RENDER_RESPONSE 6
17:18:54,196 DEBUG [SeamPhaseListener] beginning transaction prior to phase: RENDER_RESPONSE 6
17:18:54,197 TRACE [RootInterceptor] intercepted: browser.POST_CONSTRUCT
17:18:54,197 TRACE [RootInterceptor] intercepted: browser.captureConversationEntryPoint
17:18:54,197 TRACE [RootInterceptor] intercepted: nodeDAO.POST_CONSTRUCT
17:18:54,202 TRACE [RootInterceptor] intercepted: browser.exitConversation
17:18:54,203 DEBUG [NodeBrowser] ending conversation
17:18:54,203 DEBUG [Manager] Ending long-running conversation
17:18:54,203 DEBUG [NodeBrowser] entry-point of this conversation (8) has been another conversation
17:18:54,203 DEBUG [NodeBrowser] switching to entry-point conversation: 7
17:18:54,203 DEBUG [NodeBrowser] propagating faces messages from the ended conversation into the destination conversation
17:18:54,203 DEBUG [NodeBrowser] switching to last view in previous conversation
17:18:54,204 DEBUG [FacesManager] redirecting to: /wiki/docEdit.seam?cid=7
17:18:54,204 DEBUG [SeamPhaseListener] committing transaction after phase: INVOKE_APPLICATION 5
17:18:54,204 TRACE [SeamPhaseListener] after phase: RENDER_RESPONSE 6
17:18:54,205 DEBUG [Manager] Storing conversation state: 7
17:18:54,205 DEBUG [FacesLifecycle] After render response, destroying contexts
17:18:54,205 DEBUG [FacesLifecycle] <<< End JSF request
17:18:54,206 ERROR [SeamPhaseListener] uncaught exception
java.lang.NullPointerException
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 7 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1805) Enabling "Contact List" sample application on Oracle
by Ali Sadik Kumlali (JIRA)
Enabling "Contact List" sample application on Oracle
----------------------------------------------------
Key: JBSEAM-1805
URL: http://jira.jboss.com/jira/browse/JBSEAM-1805
Project: JBoss Seam
Issue Type: Feature Request
Components: Examples
Affects Versions: 2.0.0.BETA1
Environment: OS: Windows Vista 6.0,x86
Database: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Java VM: Java HotSpot(TM) Server VM 1.5.0_11-b03,Sun Microsystems Inc.
Seam: jboss-seam-2.0.0.BETA1
Reporter: Ali Sadik Kumlali
Priority: Optional
Contact List sample application does not run against Oracle out-of-the-box. So I made some changes and managed it to run on Oracle. Since many enterprise developers must go with Oracle, I wanted to share the steps I followed through the way. Hope I didn't miss the point and this work helps someone else.
Regards,
Ali Sadik Kumlali
--------------------
- Created a user, SEAM, and granted required privileges to it [1]
- Created jboss-seam-contactlist-ds.xml file which defines a datasource whose jndi-name is ContactlistDS
- Put the jboss-seam-contactlist-ds.xml file under resources folder of the sample
- In persistence.xml, changed jta-data-source definition DefaultDS to ContactlistDS
- Since Oracle considers the word "COMMENT" as reserved, it doesn't allow a table named "COMMENT" [2]. So, in Comment.java, I added
@Table(name = "T_COMMENT") annotation below the @Entity. Thus, I let the Seam map Comment bean to T_COMMENT table.
- To preserve consistency, I did the same for Contact.java.
- import.sql cannot be used as is, since it doesn't have ID column filled a valid value[3]. So, I
- Added sequence generator annotations in Contact.java and Comment.java as follows. Thus guaranteed the Seam to create the required sequences on start-up.
@Id
@SequenceGenerator(name = "generator", sequenceName = "COMMENT_SEQ")
@GeneratedValue(strategy = SEQUENCE, generator = "generator")
private Long id;
- Changed each line of import.sql as follows:
insert into T_Contact ( id, firstName, ... ) values ( Contact_Seq.nextval, 'Jacob', ...)
[1]
-- You may/should change the tablespace SYSTEM to preference of your
-- own (e.g. SEAM)
create user "SEAM" profile "DEFAULT"
identified by "SEAM" default tablespace "SYSTEM"
temporary tablespace "TEMP"
quota unlimited on "SYSTEM"
account unlock;
grant create session to "SEAM";
grant create any table to "SEAM";
grant create any sequence to "SEAM";
[2]
2007-08-15 16:13:09,521 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] create table SEAM.Comment (id number(19,0) not null, text varchar2(1500 char) not null, created timestamp not null, contact_id number(19,0) not null, primary key (id))
2007-08-15 16:13:09,522 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: create table SEAM.Comment (id number(19,0) not null, text varchar2(1500 char) not null, created timestamp not null, contact_id number(19,0) not null, primary key (id))
2007-08-15 16:13:09,524 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] ORA-00903: invalid table name
2007-08-15 16:13:09,525 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] create table SEAM.Contact (id number(19,0) not null, firstName varchar2(50 char), lastName varchar2(50 char), address varchar2(250 char), city varchar2(50 char), state varchar2(50 char), zip varchar2(6 char), country varchar2(50 char), homePhone varchar2(20 char), businessPhone varchar2(20 char), cellPhone varchar2(20 char), version number(10,0) not null, primary key (id))
2007-08-15 16:13:10,706 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] alter table SEAM.Comment add constraint FK9BDE863F5C903077 foreign key (contact_id) references SEAM.Contact
2007-08-15 16:13:10,707 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: alter table SEAM.Comment add constraint FK9BDE863F5C903077 foreign key (contact_id) references SEAM.Contact
2007-08-15 16:13:10,709 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] ORA-00903: invalid table name
2007-08-15 16:13:10,711 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] create sequence SEAM.hibernate_sequence
2007-08-15 16:13:10,778 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] Executing import script: /import.sql
2007-08-15 16:13:10,780 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] insert into Contact ( firstName, lastName, cellPhone, address, city, state, zip, country, version ) values ( 'Gavin', 'King', null, 'Peachtree Rd', 'Atlanta', 'GA', '30305', 'USA', 1 )
2007-08-15 16:13:10,867 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] schema export unsuccessful
org.hibernate.JDBCException: Error during import script execution
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
...
[3]
19:18:22,053 ERROR [SchemaExport] schema export unsuccessful
org.hibernate.JDBCException: Error during import script execution
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
...
Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SEAM"."T_CONTACT"."ID")
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 7 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1785) SeamTest to consider ELResolver from faces-config
by Diego Ballve (JIRA)
SeamTest to consider ELResolver from faces-config
-------------------------------------------------
Key: JBSEAM-1785
URL: http://jira.jboss.com/jira/browse/JBSEAM-1785
Project: JBoss Seam
Issue Type: Feature Request
Affects Versions: 2.0.0.BETA1
Reporter: Diego Ballve
Extra ELResolvers defined in faces-config.xml do not get considered when running tests based on SeamTest. This can be verified by checking the registered resolvers in debug mode, from:
ELResolver resolver = FacesContext.getCurrentInstance().getELContext().getELResolver();
As a consequence, applications that depend on those resolver extensions cannot be tested w/o some hacking to register the extra resolve - and then be able to use SeamTest getValue/setValue methods.
Btw, extra resolver works fine when the application is deployed, as expected.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 7 months