2 Replies Latest reply on Jul 31, 2006 9:35 AM by Samuel Mendenhall

    Getting IllegalStateException: No data type for node:...

    Samuel Mendenhall Apprentice

      I successfully got the seam registration example running. I took that example, changed a few classes so I could begin getting familiar with seam, but I can not get past this one exception:

      javax.faces.FacesException: Error calling action method of component with id _id0:_id7
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       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:96)
       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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       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:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       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)
      Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{sellcar.sell}
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       ... 24 more
      Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
       \-[IDENT] IdentNode: 'car' {originalText=car}
      
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
       at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
       at $Proxy78.sell(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
       ... 25 more
      Caused by: java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
       \-[IDENT] IdentNode: 'car' {originalText=car}
      
       at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:144)
       at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:714)
       at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:538)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
       at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
       at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
       at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
       at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
       at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
       at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
       at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
      ...
      




      I mirrored the registration example almost exactly, here are the relevant files:

      @Entity
      @Name("car")
      @Scope(SESSION)
      @Table(name="cars")
      public class Car implements Serializable
      {
       private static final long serialVersionUID = 1881413500711441951L;
      
       private String vin;
       private String make;
       private String model;
       private Integer year;
      
       public Car(String vin, String make, String model, Integer year) {
       this.vin = vin;
       this.make = make;
       this.model = model;
       this.year = year;
       }
      
       public Car() {}
      
       @Id @NotNull
       public String getVin() {
       return vin;
       }
      
       public void setVin(String vin) {
       this.vin = vin;
       }
      
       public void setName(String vin) {
       this.vin = vin;
       }
      
       @NotNull
       public String getMake() {
       return make;
       }
      
       public void setMake(String make) {
       this.make = make;
       }
      
       @NotNull
       public String getModel() {
       return model;
       }
      
       public void setModel(String model) {
       this.model = model;
       }
      
       @NotNull
       public Integer getYear() {
       return year;
       }
      
       public void setYear(Integer year) {
       this.year = year;
       }
      
      
       public String toString()
       {
       return "Car(VIN: " + vin + " Make: " + make + " Model: " + model + " Year: " + year + ")";
       }
      }
      
      


      @Stateless
      @Name("sellcar")
      public class SellCarAction implements SellCar
      {
      
       @In @Valid
       private Car car;
      
       @PersistenceContext
       private EntityManager em;
      
       @Logger
       private Log log;
      
       public String sell() {
       List existing = em.createQuery("select car from Car where vin=:vin")
       .setParameter("vin", car.getVin())
       .getResultList();
       if (existing.size()==0) {
       em.persist(car);
       log.info("Sold car with vin #{car.vin}");
       return "/sold.jsp";
       }
       else {
       FacesMessages.instance().add("Car vin: #{car.vin} has already been sold");
       return null;
       }
       }
      
      }
      


      @Local
      public interface SellCar {
       public String sell();
      }
      


      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
      <html>
       <head>
       <title>Sell your Car</title>
       </head>
       <body>
       <f:view>
       <h:form>
       <table border="0">
       <s:validateAll>
       <tr>
       <td>VIN</td>
       <td><h:inputText value="#{car.vin}" required="true"/></td>
       </tr>
       <tr>
       <td>Make</td>
       <td><h:inputText value="#{car.make}" required="true"/></td>
       </tr>
       <tr>
       <td>Model</td>
       <td><h:inputText value="#{car.model}" required="true"/></td>
       </tr>
       <tr>
       <td>Year</td>
       <td><h:inputText value="#{car.year}" required="true"/></td>
       </tr>
       </s:validateAll>
       </table>
       <h:messages/>
       <h:commandButton type="submit" value="Sell Car" action="#{sellcar.sell}"/>
       </h:form>
       </f:view>
       </body>
      </html>
      



      <persistence>
       <persistence-unit name="carDatabase">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
       </persistence-unit>
      </persistence>
      




      Hibernate claims to be generating all of the schema, and there are no additional errors to report. Any help would be greatly appreciated.

      Thanks.