geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Daytrader (?) problems
Date Wed, 11 Jul 2007 17:39:06 GMT
Matt's been bugging me to look at some daytrader naming problems for  
a while now.  When I started to look into this yesterday I noticed  
there were a bunch of jpa setup problems which I decided to fix  
first.  They occurred in the openejb module builder and to my  
surprise although extremely serious -- the persistence ref builder  
couldn't find the required persistence unit -- did not prevent  
"successful" deployment.  Anyway I decided to fix this problem first  
(GERONIMO-3307).

Now I can't easily reproduce the naming problem Matt told me about.   
I might just not remember how, but.... I think that perhaps if  
something goes wrong in an ejb the naming context might stop working.

My (limited) evidence for this is that if I run the jpa "method" and  
try to add data before creating the tables I get this:

13:17:14,648 ERROR [Log] Error: TradeBean:ejbCreate  Unable to lookup  
JMS Resources
          -- Asynchronous mode will not work correctly and Quote  
Price change publishing will be disabled
         javax.naming.NameNotFoundException: Name "java:openejb/ 
Resource/jms/TradeStreamerTopic" not found.
javax.naming.NameNotFoundException: Name "java:openejb/Resource/jms/ 
TradeStreamerTopic" not found.
         at org.apache.openejb.core.ivm.naming.IvmContext.federate 
(IvmContext.java:172)
         at org.apache.openejb.core.ivm.naming.IvmContext.lookup 
(IvmContext.java:129)
         at  
org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject 
(IntraVmJndiReference.java:38)
         at org.apache.openejb.core.ivm.naming.Reference.getContent 
(Reference.java:40)
         at org.apache.xbean.naming.context.ContextUtil.resolve 
(ContextUtil.java:61)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:112)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:611)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:152)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:611)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:152)
         at org.apache.xbean.naming.context.AbstractContext.lookup 
(AbstractContext.java:597)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at org.apache.geronimo.samples.daytrader.TradeJPA.ejbCreate 
(TradeJPA.java:901)
...


followed by a bunch of complaints like:

         java.sql.SQLException: Table/View 'QUOTEEJB' does not exist.
ERROR 42X05: Table/View 'QUOTEEJB' does not exist.
         at org.apache.derby.iapi.error.StandardException.newException 
(Unknown Source)
         at  
org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor 
(Unknown Source)
         at  
org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables 
(Unknown Source)
         at org.apache.derby.impl.sql.compile.FromList.bindTables 
(Unknown Source)
         at  
org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown  
Source)
         at  
org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown  
Source)
         at org.apache.derby.impl.sql.compile.DeleteNode.bind(Unknown  
Source)
         at org.apache.derby.impl.sql.GenericStatement.prepMinion 
(Unknown Source)
         at org.apache.derby.impl.sql.GenericStatement.prepare 
(Unknown Source)
         at  
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareI 
nternalStatement(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init> 
(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init> 
(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init> 
(Unknown Source)
         at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement 
(Unknown Source)
         at  
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown  
Source)
         at  
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown  
Source)
         at  
org.apache.derby.iapi.jdbc.BrokeredConnection.prepareStatement 
(Unknown Source)
         at  
org.tranql.connector.jdbc.ConnectionHandle.prepareStatement 
(ConnectionHandle.java:231)
         at  
org.apache.geronimo.samples.daytrader.direct.TradeDirect.getStatement 
(TradeDirect.java:2123)
         at  
org.apache.geronimo.samples.daytrader.direct.TradeDirect.resetTrade 
(TradeDirect.java:1844)
         at org.apache.geronimo.samples.daytrader.TradeJPA.resetTrade 
(TradeJPA.java:819)


whereas if I create the tables first and then try to add users I just  
get this:

13:19:34,281 ERROR [Log] Error: TradeDirect:resetTrade(deleteAll) --  
Error deleting Trade users and stock from the Trade database

         java.sql.SQLException: Cannot set AUTOCOMMIT ON when in an  
XA connection.
java.sql.SQLException: Cannot set AUTOCOMMIT ON when in an XA  
connection.
         at  
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException 
(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException 
(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException 
(Unknown Source)
         at org.apache.derby.impl.jdbc.Util.generateCsSQLException 
(Unknown Source)
         at org.apache.derby.jdbc.EmbedXAConnection.checkAutoCommit 
(Unknown Source)
         at  
org.apache.derby.iapi.jdbc.BrokeredConnection.setAutoCommit(Unknown  
Source)
         at  
org.tranql.connector.jdbc.ManagedXAConnection.localTransactionCommit 
(ManagedXAConnection.java:104)
         at org.tranql.connector.AbstractManagedConnection 
$LocalTransactionImpl.commit(AbstractManagedConnection.java:192)
         at org.tranql.connector.jdbc.ConnectionHandle.commit 
(ConnectionHandle.java:115)
         at  
org.apache.geronimo.samples.daytrader.direct.TradeDirect.commit 
(TradeDirect.java:2096)
         at  
org.apache.geronimo.samples.daytrader.direct.TradeDirect.resetTrade 
(TradeDirect.java:1866)
         at org.apache.geronimo.samples.daytrader.TradeJPA.resetTrade 
(TradeJPA.java:819)

with no mention of jndi errors.

(this is a bug but not too relevant to the current discussion)

Anyway after creating the tables, and filling them using jpa, I can  
log in and trade without apparent problems.

I did not pull down rev 554959 or 554960 so I'm still using the  
correct unhacked names.  I did add a non-jta-datasource directly,  
although I plan to put this in the plan instead (see GERONIMO-3308)  
rather than in the persistence.xml itself.

So, I'm a bit worried that openejb is pretending everything is fine  
and dandy even when there have been significant deployment problems  
leading to the app not working at all.  Anyone else seen things like  
this or have an opinion?

thanks
david jencks


Mime
View raw message