Seam Newbie Problem
mutpup Jan 23, 2006 7:31 PMSo I have created a small application just get a basic understanding of SEAM. I have the app deploying without errors.
17:21:14,832 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.3SP1/server/default/deploy/phone-log.ear 17:21:14,926 INFO [JaccHelper] Initialising JACC Context for deployment: phone-log.ejb3 17:21:14,972 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=org.transaria.noc.UserUtilsAction, class=org.transaria.noc.UserUtilsAction, type=STATELESS 17:21:15,613 INFO [JaccHelper] org.transaria.noc.UserUtilsAction has no @SecurityDomain - skipping JACC configuration 17:21:15,754 INFO [Ejb3Deployment] Found persistence.xml file in EJB3 jar 17:21:15,785 INFO [Ejb3Configuration] found EJB3 Entity bean: org.transaria.noc.User 17:21:15,816 INFO [Configuration] processing extends queue 17:21:15,832 INFO [Configuration] processing collection mappings 17:21:15,832 INFO [Configuration] processing association property references 17:21:15,832 INFO [Configuration] processing foreign key constraints 17:21:15,847 INFO [Configuration] processing extends queue 17:21:15,847 INFO [Configuration] processing collection mappings 17:21:15,847 INFO [Configuration] processing association property references 17:21:15,847 INFO [Configuration] processing foreign key constraints 17:21:15,863 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.InjectedDataSourceConnectionProvider 17:21:15,894 INFO [InjectedDataSourceConnectionProvider] Using provided datasource 17:21:15,894 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0 17:21:15,894 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0 17:21:15,894 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect 17:21:15,894 INFO [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions) 17:21:15,894 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup 17:21:15,910 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup 17:21:15,910 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled 17:21:15,910 INFO [SettingsFactory] Automatic session close at end of transaction: disabled 17:21:15,910 INFO [SettingsFactory] JDBC batch size: 15 17:21:15,910 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled 17:21:15,910 INFO [SettingsFactory] Scrollable result sets: enabled 17:21:15,910 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled 17:21:15,910 INFO [SettingsFactory] Connection release mode: after_statement 17:21:15,910 INFO [SettingsFactory] Default batch fetch size: 1 17:21:15,910 INFO [SettingsFactory] Generate SQL with comments: disabled 17:21:15,910 INFO [SettingsFactory] Order SQL updates by primary key: disabled 17:21:15,910 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 17:21:15,910 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory 17:21:15,910 INFO [SettingsFactory] Query language substitutions: {} 17:21:15,910 INFO [SettingsFactory] Second-level cache: enabled 17:21:15,910 INFO [SettingsFactory] Query cache: disabled 17:21:15,910 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider 17:21:15,910 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 17:21:15,910 INFO [SettingsFactory] Structured second-level cache entries: disabled 17:21:15,910 INFO [SettingsFactory] Statistics: disabled 17:21:15,910 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: enabled 17:21:15,910 INFO [SettingsFactory] Default entity-mode: POJO 17:21:15,926 INFO [SessionFactoryImpl] building session factory 17:21:16,144 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured 17:21:16,144 INFO [Configuration] processing extends queue 17:21:16,144 INFO [Configuration] processing collection mappings 17:21:16,144 INFO [Configuration] processing association property references 17:21:16,160 INFO [Configuration] processing foreign key constraints 17:21:16,160 INFO [Configuration] processing extends queue 17:21:16,160 INFO [Configuration] processing collection mappings 17:21:16,160 INFO [Configuration] processing association property references 17:21:16,160 INFO [Configuration] processing foreign key constraints 17:21:16,160 INFO [SchemaExport] Running hbm2ddl schema export 17:21:16,160 INFO [SchemaExport] exporting generated schema to database 17:21:16,176 INFO [SchemaExport] schema export complete 17:21:16,176 INFO [Configuration] processing extends queue 17:21:16,176 INFO [Configuration] processing collection mappings 17:21:16,176 INFO [Configuration] processing association property references 17:21:16,176 INFO [Configuration] processing foreign key constraints 17:21:16,176 INFO [Configuration] processing extends queue 17:21:16,176 INFO [Configuration] processing collection mappings 17:21:16,176 INFO [Configuration] processing association property references 17:21:16,176 INFO [Configuration] processing foreign key constraints 17:21:16,176 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 17:21:16,176 INFO [SessionFactoryImpl] Checking 0 named queries 17:21:16,191 INFO [Ejb3Deployment] Create EntityManager with JNDI name: phonelogDatabase 17:21:16,191 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service 17:21:16,191 INFO [Ejb3Deployment] EJB3 deployment time took: 1265 17:21:17,176 INFO [ProxyDeployer] no declared remote bindings for : org.transaria.noc.UserUtilsAction 17:21:17,254 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.3SP1/server/default/tmp/deploy/tmp42152phone-log.ear-contents/phone-log.ejb3 17:21:17,269 INFO [TomcatDeployer] deploy, ctxPath=/phone-log, warUrl=.../tmp/deploy/tmp42152phone-log.ear-contents/phone-log-exp.war/ 17:21:17,488 INFO [ServletContextListener] Welcome to Seam 1.0 beta 1 17:21:17,488 INFO [Seam] initializing Seam 17:21:17,488 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init 17:21:17,504 INFO [Component] Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager 17:21:17,566 INFO [Component] Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext 17:21:17,597 INFO [Component] Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext 17:21:17,613 INFO [Component] Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext 17:21:17,629 INFO [Component] Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.StatelessContext 17:21:17,660 INFO [Component] Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext 17:21:17,707 INFO [Component] Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext 17:21:17,738 INFO [Component] Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext 17:21:17,754 INFO [Scanner] scanning: /C:/jboss-4.0.3SP1/server/default/tmp/deploy/tmp42152phone-log.ear 17:21:17,754 INFO [Scanner] scanning: /C:/jboss-4.0.3SP1/server/default/tmp/deploy/tmp42152phone-log.ear-contents/phone-log.ejb3 17:21:17,769 INFO [Scanner] scanning: C:\jboss-4.0.3SP1\server\default\tmp\deploy\tmp42152phone-log.ear-contents\phone-log-exp.war 17:21:17,769 INFO [Component] Component: userutils, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.transaria.noc.UserUtilsAction 17:21:17,801 INFO [Component] Component: user, scope: CONVERSATION, type: ENTITY_BEAN, class: org.transaria.noc.User 17:21:17,816 INFO [Seam] done initializing Seam 17:21:17,816 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-config.xml 17:21:17,972 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml 17:21:18,207 INFO [StartupServletContextListener] ServletContext 'C:\jboss-4.0.3SP1\server\default\.\tmp\deploy\tmp42152phone-log.ear-contents\phone-log-exp.war\' initialized. 17:21:18,332 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.3SP1/server/default/deploy/phone-log.ear
But, it is failing when I run the JSP
17:24:24,365 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:646) at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:254) at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:90) at org.apache.jsp.usercreate_jsp._jspx_meth_f_view_0(org.apache.jsp.usercreate_jsp:100) at org.apache.jsp.usercreate_jsp._jspService(org.apache.jsp.usercreate_jsp:75) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595)
This must be something simple as by code couldn't be much more basic.
usercreate.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head> <title>Create New User</title> </head> <body> <f:view> <h:form> <table border="0"> <tr> <td>Username</td> <td><h:inputText value="#{user.username}"/></td> </tr> <tr> <td>First Name</td> <td><h:inputText value="#{user.first}"/></td> </tr> <tr> <td>Last Name</td> <td><h:inputText value="#{user.last}"/></td> </tr> <tr> <td>Password</td> <td><h:inputSecret value="#{user.password}"/></td> </tr> </table> <h:messages/> <h:commandButton type="submit" value="Register" action="#{userutils.createUser}"/> </h:form> </f:view> </body> </html>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- Seam --> <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <!-- MyFaces --> <listener> <listener-class> org.apache.myfaces.webapp.StartupServletContextListener </listener-class> </listener> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app>
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd"> <faces-config> <navigation-rule> <navigation-case> <from-outcome>created</from-outcome> <to-view-id>/usercreated.jsp</to-view-id> </navigation-case> </navigation-rule> <!-- Same for all Seam applications --> <application> <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver> </application> <lifecycle> <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener> </lifecycle> </faces-config>
Can someone point me in the right direction? I feel like I'm getting close to having an understanding, but must be missing something pretty basic.