[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2220) "Not an entity class" error upon migrating to 2.0.0 GA
by Levent Aksu (JIRA)
"Not an entity class" error upon migrating to 2.0.0 GA
------------------------------------------------------
Key: JBSEAM-2220
URL: http://jira.jboss.com/jira/browse/JBSEAM-2220
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.GA
Environment: Linux, glassfish v2, postgresql 8.x
Reporter: Levent Aksu
I migrated my application which was running previously with 1.2.1 GA. It starts and works nicely till it gets to the first "insert" with the following stack trace:
Hibernate: select nextval ('hibernate_sequence')
java.lang.IllegalArgumentException: Not an entity class: datassist.payroll.entity.Category
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: Not an entity class: datassi
st.payroll.entity.Category
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpr
essionAdapter.java:97)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:96)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.jav
a:397)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:216)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:24
0)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:6
67)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.ja
va:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.lang.IllegalArgumentException: Not an entity class: datassist.payroll.entity.Categor
y
at org.jboss.seam.Entity.forClass(Entity.java:208)
at org.jboss.seam.persistence.PersistenceProvider.getPrePersistMethod(PersistenceProvider.ja
va:159)
at org.jboss.seam.security.Identity.checkEntityPermission(Identity.java:681)
at org.jboss.seam.security.HibernateSecurityInterceptor.onSave(HibernateSecurityInterceptor.
java:73)
at org.hibernate.event.def.AbstractSaveEventListener.substituteValuesIfNecessary(AbstractSav
eEventListener.java:394)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEven
tListener.java:270)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.j
ava:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventLi
stener.java:121)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(D
efaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrU
pdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveO
rUpdateEventListener.java:94)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpda
teEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495)
at org.jboss.seam.persistence.HibernateSessionProxy.saveOrUpdate(HibernateSessionProxy.java:
370)
at datassist.payroll.action.CategoryAction.save(CategoryAction.java:131)
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:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIde
ntityInterceptor.java:48)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:4
2)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java
:155)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
at datassist.payroll.action.CategoryAction_$$_javassist_2.save(CategoryAction_$$_javassist_2
.java)
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:597)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpr
essionAdapter.java:77)
... 51 more
Note that "Category" is a mapped class and previously in the log I can read those lines:
...
Mapping class: datassist.payroll.entity.Item -> Item
Mapping union-subclass: datassist.payroll.entity.Category -> Category
Mapping union-subclass: datassist.payroll.entity.Unit -> Unit
...
Here follows my hibernate configuration:
hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="hibernateSession">
<property name="connection.datasource">jdbc/payroll</property>
<property name="hbm2ddl.auto">create-drop</property>
<property name="show_sql">true</property>
<!--property name="hibernate.format_sql">true</property-->
<property name="transaction.flush_before_completion">true</property>
<property name="connection.release_mode">after_statement</property>
<!--property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property-->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.SunONETransactionManagerLookup</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<!-- Mapping files -->
<!--mapping resource="category.hbm.xml"/-->
<mapping resource="variable.hbm.xml"/>
<mapping resource="value.hbm.xml"/>
<mapping resource="item.hbm.xml"/>
</session-factory>
</hibernate-configuration>
mapping files:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="datassist.payroll.entity.variable">
<class name="Variable" >
<id name="id"><generator class="native"/></id>
<discriminator column="type" type="string"/>
<many-to-one name="category" class="datassist.payroll.entity.Category"/>
<property name="name"/>
<property name="label"/>
<property name="description"/>
<property name="finall"/>
<property name="optional"/>
<subclass name="BigDecimalVariable" discriminator-value="N" />
<subclass name="DateVariable" discriminator-value="D" />
<subclass name="StringVariable" discriminator-value="S" />
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="datassist.payroll.entity.value">
<class name="Value" >
<id name="id" unsaved-value="-1"><generator class="native"/></id>
<discriminator column="type" type="string"/>
<many-to-one name="item" class="datassist.payroll.entity.Item"/>
<many-to-one name="variable" class="datassist.payroll.entity.variable.Variable"/>
<property name="since"/>
<property name="till"/>
<property name="ffinal"/>
<subclass name="BigDecimalValue" discriminator-value="N">
<property name="core" column="bigDecimalCore"/>
</subclass>
<subclass name="DateValue" discriminator-value="D" >
<property name="core" column="dateCore"/>
</subclass>
<subclass name="StringValue" discriminator-value="S" >
<property name="core" column="stringCore"/>
</subclass>
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="datassist.payroll.entity">
<class name="Item" abstract="true" >
<id name="id" unsaved-value="-1"><generator class="native"/></id>
<property name="name"/>
<property name="description"/>
<list name="values" cascade="all, delete-orphan">
<key column="item" />
<list-index column="sortOrder"/>
<one-to-many class="datassist.payroll.entity.value.Value"/>
</list>
<union-subclass name="Category">
<property name="type"/>
<many-to-one name="parentCategory" class="Category"/>
<list name="childCategories">
<key column="parentCategory"/>
<list-index column="sortOrder"/>
<one-to-many class="Category"/>
</list>
<list name="variables" cascade="all, delete-orphan" >
<key column="category"/>
<list-index column="sortOrder" />
<one-to-many class="datassist.payroll.entity.variable.Variable"/>
</list>
</union-subclass>
<union-subclass name="Unit">
<many-to-one name="parentUnit" class="Unit"/>
<list name="categories" table="unit_category" cascade="all, delete-orphan" >
<key column="unit"/>
<index column="sortOrder"/>
<many-to-many class="Category" column="category"/>
</list>
<!--set name="employments" cascade="all, delete-orphan" >
<key column="employer"/>
<one-to-many class="Employment"/>
</set-->
</union-subclass>
<union-subclass name="Employment">
<many-to-one name="employer" class="Unit"/>
<many-to-one name="employee" class="Employee"/>
<property name="since"/>
<property name="till"/>
</union-subclass>
<union-subclass name="Employee">
<list name="employments" cascade="all, delete-orphan">
<key column="employee"/>
<list-index column="sortOrder"/>
<one-to-many class="Employment" />
</list>
<set name="categories">
<key column="employee"/>
<many-to-many class="Category" column="category" />
</set>
</union-subclass>
</class>
</hibernate-mapping>
--
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
17 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2217) A single wrong <exception> entry in pages.xml causes all exception handler getting dropped
by Werner Kolov (JIRA)
A single wrong <exception> entry in pages.xml causes all exception handler getting dropped
------------------------------------------------------------------------------------------
Key: JBSEAM-2217
URL: http://jira.jboss.com/jira/browse/JBSEAM-2217
Project: JBoss Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.0.0.GA
Reporter: Werner Kolov
Try to add following 3 entries to your pages.xml
<page view-id="/restricted.xhtml" login-required="true">
<restrict>#{s:hasRole('doesNotExist')}</restrict>
</page>
<exception class="org.jboss.seam.security.AuthorizationException">
<redirect view-id="/home.xhtml">
<message>You don't have permission to do this</message>
</redirect>
</exception>
<exception class="org.jboss.seam.TransactionException">
<end-conversation/>
<redirect view-id="/exceptions.xhtml">
<message>#{messages.seam_specific_exception}</message>
</redirect>
</exception>
You will never be redirected to /home.xhtml after an AuthorizationException, because the exception class org.jboss.seam.TransactionException does not exist (any more) in Seam 2.0. Sure, this is a configuration error, but unfortunately you are not prompted about it during the parsing of pages.xml. The parser simply drops ALL exception handlers, if one of them is wrong, so the complete custom exception handling and all <restrict> tags don't work. This error can easily happen, if you migrate from one Seam version (1.2.1) to another (2.0.0) and some exception classes change.
--
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
17 years, 2 months