Dan,

Thanks for the clarification.  I did what you said to
do, put findByIdAndName in the Home interface and in
jaws.xml and I still get:

[JAWS] Could not create the finder findByIdAndName,
because no matching CMP field was found.

I'm pretty sure I don't have another jaws.xml in the
classpath because I only have one jar, 3 beans
deployed.  On top of that, the custom finders for CMP
don't work for me no matter what I name them by any
convention.  I'm using JBoss-2.2.2_Tomcat-3.2.2 on a
Linux 2.4.0 box, if that helps any.  I'm at a complete
loss for what to do next.  Also,  I don't have any
whitespace in the finder name in either jaws.xml nor
in the Home interface.


--- "danch (Dan Christopherson)" <[EMAIL PROTECTED]>
wrote:
> I don't know if you and Fred are looking at the same
> problem.
> 
> Your home and the jaws.xml should both be
> findByIdAndName, you shouldn't 
> have an ejbFindByIdAndName, since you're declaring
> it in the descriptor. 
> Fred's issue is that JBoss currently _requires_ the
> 'By'. I believe this 
> is only true of autogenerated single column finders.
> Fred, can you 
> confirm that what I just said summarizes your
> problem. No to fix that so 
> that find... or findBy... are supported, how does
> JAWS tell cases where 
> the field name starts with 'by' from a 'findBy...'
> Hmm that's a problem 
> anyway isn't it. I guess in those cases, you'd have
> to define the finder 
> in jaws.xml
> 
> Nathan, looking at the JAWS code, the only thing I
> could think of that 
> would cause your problem would be that JAWS gets a
> bad copy of jaws.xml, 
> without your finder declaration in it. Is it
> possible that it's getting 
> another copy out of your classpath, or somewhere.
> The only other thing 
> is a non-obvious, non-visible difference between the
> finder method's 
> name in the home interface and the name in jaws.xml.
> Do you have any 
> whitespace in the method name in jaws.xml (including
> line breaks)?
> 
> -danch
> 
> nathan frund wrote:
> 
> > Fred, thanks for the reply.  I just want to make
> sure
> > I have everything correct so that I can give you
> > accurate information back for a potential patch.
> > 
> > In my Home interface I put:
> > 
> > 
> >      public Collection ejbFindByIdAndName(Integer
> id,
> > String name) throws RemoteException,
> FinderException
> > 
> > 
> > In jaws.xml I put:
> > 
> >     <finder>
> >       <name>ejbFindByIdAndName</name>
> >       <query><![CDATA[ID = {0} AND
> NAME={1}]]></query>
> >       <order>id DESC</order>
> >     </finder>
> > 
> > I know I must be doing something wrong because
> when I
> > put ejbFindBy... in the Home interface I get this
> > error message upon deployment:
> > 
> > Could not deploy
> >
>
file:/home/local/JBoss-2.2.2_Tomcat-3.2.2/jboss/tmp/deploy/Default/xwl.jar,
> > Cause:org.jboss.ejb.DeploymentException: Could not
> > find matching method for public abstract
> > java.util.Collection
> >
>
com.nathanfrund.xwl.ArticleHome.ejbFindByIdAndName(java.lang.Integer,java.lang.String)
> > throws
> > javax.ejb.FinderException,java.rmi.RemoteException
> > 
> > 
> > 
> > 
> > --- Fred Loney <[EMAIL PROTECTED]> wrote:
> > 
> >>You may have discovered a bug.  As far as I can
> >>tell, jboss incorrectly filters out custom finder
> >>methods that don't begin with "ejbFindBy". Your
> >>method is filtered out. An attempt is made to
> >>autogenerate a finder, which results in the
> >>indicated message.
> >>
> >>Change the name of your method to
> ejbFindByIdAndName
> >>and try again. If that works, let me know and I'll
> >>submit a patch.
> >>
> >>--
> >>Fred Loney
> >>Spirited Software, Inc.
> >>[EMAIL PROTECTED]
> >>
> >>nathan frund wrote:
> >>
> >>
> >>>Howdy,
> >>>
> >>>I'm new to both EJB and JBoss and boy, do I have
> a
> >>>problem.  I've been over the documentation on the
> >>>JBoss web site for days and through the mailing
> >>>
> >>list
> >>
> >>>archive from top to bottom but didn't find anyone
> >>>
> >>else
> >>
> >>>having this specific problem.
> >>>
> >>>I can't get certain custom finders to work.
> >>>
> >>>This is the error message I get in the JBoss log
> >>>
> >>when
> >>
> >>>starting the server:
> >>>
> >>>        [Container factory] Finder:idandname
> >>>        [JAWS] Could not create the finder
> >>>
> >>findByIdAndName,
> >>
> >>>because no matching CMP field was found.
> >>>
> >>>================================================
> >>>
> >>>Here is the snippet from the included jaws.xml:
> >>>
> >>>        <entity>
> >>>                <ejb-name>ArticleBean</ejb-name>
> >>>               
> >>>
> >><pk-constraint>true</pk-constraint>
> >>
> >>>                <cmp-field>
> >>>                       
> >>>
> >><field-name>id</field-name>
> >>
> >>>                       
> >>>
> >><column-name>ID</column-name>
> >>
> >>>                </cmp-field>
> >>>                <cmp-field>
> >>>                <field-name>name</field-name>
> >>>                <column-name>NAME</column-name>
> >>>                </cmp-field>
> >>>                <finder>
> >>>                        <name>findById</name>
> >>>                        <query>ID = {0}</query>
> >>>                        <order>ID DESC</order>
> >>>                </finder>
> >>>                <finder>
> >>>                       
> >>>
> >><name>findByIdAndName</name>
> >>
> >>>                        <query><![CDATA[id ={0}
> >>>
> >>AND
> >>
> >>>name={1}]]></query>
> >>>                        <order>id DESC</order>
> >>>                </finder>
> >>>        </entity>
> >>>
> >>>
>
>>===================================================
> >>
> >>>Here is the Home interface of the EJB:
> >>>
> >>>package com.nathanfrund.xwl;
> >>>
> >>>import java.rmi.RemoteException;
> >>>import javax.ejb.*;
> >>>import java.util.Collection;
> >>>
> >>>/**
> >>>This interface defines the home interface for the
> >>>'Article' EJB.
> >>>*/
> >>>public interface ArticleHome extends EJBHome
> >>>{
> >>>    /**
> >>>    Create a new XWL instance.
> >>>    */
> >>>    public Article create(Integer id) throws
> >>>RemoteException, CreateException;
> >>>
> >>>    /**
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to