[EJB 3.0] - howto? new entity persist with aggregates that are already p
by hanasakijiji
JBoss 4.0.5 - EJB3 - Entity Beans
** The problem is - the foreign key column is not set on the newInstance Row. thus the inserted value is NULL.
There is an new instance of a class that is being worked on as follows:
aggregate = // retrieve / find in database - ie: already persisted
| newInstance = new NewInstance();
| newinstance.setValue(aggregate)
| em.persist(newInstance)
newInstance is saved, as a new row, in the RDBMS just fine; however, the aggregate_fk (see below for table) is set to null - actually I think it is not even in the insert statement.
NewInstance.get/setValue are defined below:
@OneToOne(cascade=CascadeType.ALL)
| @JoinColumn(name="aggregate_fk", insertable=false, updatable=false, referencedColumnName="pk")
| public Aggregate getValue() { return aggregate; }
NewInstance Table (Pseudo Notation for sql)
integer pk
| char(10) column1
| integer aggregate_fk -- foreign key reference to aggregate table
Aggregate is actually a lookup table as below
integer pk
| char(15) key
| varchar(64) value
*Note: this table is referenced by many other tables in the system; therefore, it cannot contain annotations of OneToMany (etc..) to a specific other table.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025431#4025431
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025431
19Â years, 1Â month
[JBoss Messaging] - java.lang.NoClassDefFoundError: org/jboss/aop/WeavingStrateg
by macross27
Hi!
I#ve got a problem with a test application I try to write. If I execute the following piece of code, I get the exception "java.lang.NoClassDefFoundError: org/jboss/aop/WeavingStrategy" on the last line. I don't know at all what to do with it. Google and a forum search didn't turn up anything. Also the messaging documentation didn't help (or at least I haven't found anything). This is the code:
| // properties of context
| Properties props = new Properties();
| props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| props.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
| props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| props.put("jnp.disableDiscovery", "true");
|
| // prepare context for JNDI look ups
| InitialContext jndiContext = new InitialContext(props);
|
| // get connection factory via JNDI look up
| ConnectionFactory factory = (ConnectionFactory)jndiContext.lookup("/ConnectionFactory");
|
I use JBoss AS 5.0.0 Beta 1. The configuration is unmodified. Has anyone tips where to do research or any hints what might be wrong? Thanks in advance.
Cheers,
Sebastian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025429#4025429
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025429
19Â years, 1Â month
[JCA/JBoss] - Re: Spontaneous undeployment under stress load
by ktorn
I finally got access to the test server logs, and found these lines particularly interesting:
| (ScannerThread) WARN [FileURLLister] Could not list directory '/jboss/server/default/farm', reason unknown
| (ScannerThread) WARN [FileURLLister] Could not list directory '/jboss/server/default/deploy', reason unknown
| (ScannerThread) DEBUG [MainDeployer] Undeploying file:/jboss/server/default/farm/some-app.ear
| (ScannerThread) DEBUG [MainDeployer] Undeploying file:/jboss/server/default/deploy/some-other-app.ear
|
And so on...
Spontaneous app undeployment due to the ScannerThread not being able to read the deploy and farm directories, possibly due to the load put on the server. So my conclusion is that CPU starvation is causing the undeployment issue.
This is not a problem as we will never hit this kind of load when live, but still looks like odd behaviour and something that might be addressed more gracefully (i.e. issue warning when not able to read farm/deploy dirs, but don't undeploy by default).
As this is not directly related to the ResourceAdapter, feel free to move this thread to a more suitable location.
I will now investigate if this is something worth raising as a bug.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025428#4025428
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025428
19Â years, 1Â month