[EJB 3.0] - Deployment error mapping a parent/child related entity
by abl
I have a self-referencing entity hierarchy like that:
@Entity
| @Inheritance(strategy=InheritanceType.JOINED)
| public abstract class HrcEntity<T extends HrcEntity> extends ComplexEntity
| {
| private List<T> children;
| private T parent;
|
| @OneToMany(mappedBy="parent", cascade=CascadeType.REMOVE)
| public List<T> getChildren()
| {
| return children;
| }
|
| @ManyToOne(fetch=FetchType.LAZY)
| public T getParent()
| {
| return parent;
| }
|
| }
|
| @Entity
| @Inheritance(strategy=InheritanceType.JOINED)
| public class Node extends HrcEntity<Node>
| {
| ...
| }
so I can do for example:
List<Node> children = node.getChildren();
but deploying these entities I get the error:
"java.lang.IllegalStateException: Property parent has an unbound type and no explicit target entity."
from my point of view this should work - there is is a table HrcEntity in db and hibernate simply has to map the column "parent" to the same table.
btw. - if I make HrcEntity non-generic it works, but I get very ugly code with lot of casts and "instanceof"
any comments? thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958144#3958144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958144
19 years, 9 months
[JBoss Seam] - Re: Seam web services (RESTful ones)?
by gavin.king@jboss.com
anonymous wrote : Ah cool, I missed that. Will check it out. Not sure how it works to do POSTs with XML in them to a JSF app, but that's probably just my inner newbie talking... doesn't seem like it should be a problem.
This is the thing that I have spent the most time thinking through. The biggest problem with building RESTful webservices is parsing incoming XML, and I think that calls for a whole new API for XML parsing.
Though I note that Flikr just seems to use plain old request parameters in its API, no XML....
anonymous wrote : That seems like a feature, not a bug :-) If you don't care about big chunks of the lifecycle, stub it right out!
Wellyes, it is automatically stubbed out by JSF (non-faces request).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958143#3958143
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958143
19 years, 9 months
[JBoss Portal] - Re: Getting XAException while logging in to portal as admin
by kslm23
I am running JBoss 4.0.4 and i tried portal 2.4 version SP2 and RC1. Somehow i can login as admin when i run RC1 (though i get some other error messages when i start jboss which i attribute to the fact that it is not a stable version yet) but not with SP2. The XAException is not showing up anymore but i get this when i try to log in:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
--------------------------------------------------------------------------------
Please try the following:
If you typed the page address in the Address bar, make sure that it is spelled correctly.
Open the localhost:8080 home page, and then look for links to the information you want.
Click the Back button to try another link.
Click Search to look for information on the Internet.
HTTP 400 - Bad Request
Internet Explorer
------------------------------------------------------------
I think that XAException was showing up for some other reason. When i try to login now, no exceptions are thrown but i see the page above in the IE.
I tried downloading bundled portal with AS, version SP2 but getting exactly the same problem.
Please let me know if i can provide any more info.
Could you please let me know what version of portal is consistent with current web installer of JBoss?
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958140#3958140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958140
19 years, 9 months
[JBoss jBPM] - JBPM_PROCESSDEFINITION table not found
by abdielj
hi,
has anybody seen this error before ?. I created the JBPMConfiguration object from a xml string (Copy and paste from User guide's Chapter 3 Database example). Then i try to create a process instance and i get the error below. It seems like if the persistence service was not available but i initializate exactly as the example.
| 09:56:05,220 [main] ERROR JDBCExceptionReporter : Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
| org.hibernate.exception.SQLGrammarException: could not execute query
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
| at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
| at org.hibernate.loader.Loader.doList(Loader.java:2153)
| at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
| at org.hibernate.loader.Loader.list(Loader.java:2024)
| at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
| at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
| at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
| at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
| at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
| at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:745)
| at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:138)
| at org.jbpm.JbpmContext.newProcessInstance(JbpmContext.java:266)
| at solicitudes.SolicitudPrestamo.createInstance(SolicitudPrestamo.java:30)
| at solicitudes.Tester.main(Tester.java:13)
| Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
| at org.hsqldb.jdbc.Util.throwError(Unknown Source)
| at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
| at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
| at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
| at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
| at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
| at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
| at org.hibernate.loader.Loader.doQuery(Loader.java:661)
| at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
| at org.hibernate.loader.Loader.doList(Loader.java:2150)
| ... 12 more
| 0
|
Creation of JbpmConfiguration Object
| public static JbpmConfiguration getConfiguration()
| {
|
| JbpmConfiguration jbpmConfiguration = null;
|
| // An example configuration file such as this can be found in
| // 'src/config.files'. Typically the configuration information is in the
| // resource file 'jbpm.cfg.xml', but here we pass in the configuration
| // information as an XML string.
|
| // First we create a JbpmConfiguration statically. One JbpmConfiguration
| // can be used for all threads in the system, that is why we can safely
| // make it static.
|
| jbpmConfiguration = JbpmConfiguration.parseXmlString(
| "<jbpm-configuration>" +
|
| // A jbpm-context mechanism separates the jbpm core
| // engine from the services that jbpm uses from
| // the environment.
|
| " <jbpm-context>" +
| " <service name='persistence' " +
| " factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
| " </jbpm-context>" +
|
| // Also all the resource files that are used by jbpm are
| // referenced from the jbpm.cfg.xml
|
| " <string name='resource.hibernate.cfg.xml' " +
| " value='hibernate.cfg.xml' />" +
| " <string name='resource.business.calendar' " +
| " value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
| " <string name='resource.default.modules' " +
| " value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
| " <string name='resource.converter' " +
| " value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
| " <string name='resource.action.types' " +
| " value='org/jbpm/graph/action/action.types.xml' />" +
| " <string name='resource.node.types' " +
| " value='org/jbpm/graph/node/node.types.xml' />" +
| " <string name='resource.varmapping' " +
| " value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
| "</jbpm-configuration>");
|
| return jbpmConfiguration;
| }
|
Instantiation of process
| public void createInstance() throws Exception
| {
|
| //JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
| JbpmConfiguration jbpmConfiguration = JBPMHelper.getConfiguration();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try
| {
| ProcessInstance processInstance = jbpmContext.newProcessInstance("SolicitudPrestamo");
| if (processInstance.getProcessDefinition().getTaskMgmtDefinition().getStartTask() == null)
| {
| processInstance.signal();
| }
| else
| {
| TaskInstance startTask =
| processInstance.getTaskMgmtInstance().createStartTaskInstance();
| jbpmContext.save(startTask);
| }
| }
| finally
| {
| jbpmContext.close();
| }
| }
|
Thanks in advance for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958133#3958133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958133
19 years, 9 months