[JBoss-user] [Persistence & CMP/JBoss] - Re: Bug in EJB QL compiler?
"ManneF" wrote : Hi Sesques, | | Thanks for looking into this. | | The originalLanguage and targetLanguage fields (properties) are in fact references to other entity beans, not Strings or anything like that. Is there a problem with that? | | As I said, I'm new to JBoss CMP beans and wouldn't consider myself an expert on entity beans generally, so bear with me if I'm being silly. | | However, my code works fine in Orion AS, so I think this is either a bug in JBoss, or Orion provides functionality over the EJB spec. Imho JBoss should at least trap any error I may have made and produce a meaningful error message rather than stopping with a NullPointerException. | | Regards, | Manne I don't know Orion AS but I'm sure that each application server has its own fashion to handle CMR fields. The problem is not in your code, but in the descriptors. Nomally, the relationships must be declared in ejb-jar.xml (names, roles, multiplicity and cmr fields) in a section tag, this is the EJB spec. And additionnaly, the mapping between CMR fields and the database are described in the jbosscmp-jdbc.xml descriptor. I agree 100% with you about the meaningful error message you get. You should have a look to your relationships definitions. I don't know how do you gererate the descriptors, but have a look to the XDoclet documentation. If you are in a dead end, post theses files on the forum. Pascal View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831381#3831381 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831381 --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: Bug in EJB QL compiler?
Hi Sesques, Thanks for looking into this. The originalLanguage and targetLanguage fields (properties) are in fact references to other entity beans, not Strings or anything like that. Is there a problem with that? As I said, I'm new to JBoss CMP beans and wouldn't consider myself an expert on entity beans generally, so bear with me if I'm being silly. However, my code works fine in Orion AS, so I think this is either a bug in JBoss, or Orion provides functionality over the EJB spec. Imho JBoss should at least trap any error I may have made and produce a meaningful error message rather than stopping with a NullPointerException. Regards, Manne View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831378#3831378 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831378 --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: Bug in EJB QL compiler?
Forget the JBoss code. Your fields originalLanguage and targetLanguage are CMP fields, not CMR. So they are mapped to a column type in your database. How can you define a finder taking parameters which are references to another bean, and compare them to column types. For me, your finder can only work if originalLanguage and targetLanguage are CMR fields, not CMP. But perhaps you forgot to tell all the story, or I misunderstand something ? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830637#3830637 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830637 --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: Bug in EJB QL compiler?
Hi, Thanks for the reply - sorry about the terse info in my first post. Stepping through the JBoss code, I've found that the cause of the nullpointer is the fact that the getEntity() method in org.jboss.ejb.plugins.cmp.ejbql.ASTPath returns null, because the last object in the fieldList is neither an instance of CMRFieldBridge nor of EntityBridge, but of JDBCCMP2xFieldBridge. This causes an exception on line 323 in the class JDBCEJBQLCompiler. Looks like a bug to me (especially since this deploys without errors in Orion AS), but a snippet from the configuration of the EJB in question and the start of the stack trace I get follow below. Regards, Manne TranslationErrorEJB com.zinesoft.translationerror.ejb.entity.TranslationErrorHome com.zinesoft.translationerror.ejb.entity.TranslationError com.zinesoft.translationerror.ejb.entity.TranslationErrorBean Container java.lang.String False 2.x TranslationError originalLanguage targetLanguage incorrectTranslation suggestedTranslation The phrase in the original language phrase id id findByLanguages com.zinesoft.translationerror.ejb.entity.Language com.zinesoft.translationerror.ejb.entity.Language SELECT OBJECT(t) FROM TranslationError t WHERE t.originalLanguage = ?1 AND t.targetLanguage = ?2 2004-04-14 21:51:40,093 ERROR [org.jboss.ejb.EntityContainer] Starting failed org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(t) FROM TranslationError t WHERE t.originalLanguage = ?1 AND t.targetLanguage = ?2'; - nested throwable: (java.lang.NullPointerException) at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:50) at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:59) ... View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830633#3830633 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830633 --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence & CMP/JBoss] - Re: Bug in EJB QL compiler?
Hi, Post the exact log or your code snippet. Not enough info to investigate. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830577#3830577 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830577 --- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user