strange jboss exception while deploying entity bean

Discussion in 'Java' started by tmaus, Sep 17, 2004.

  1. tmaus

    tmaus Guest

    hi there .. im running into a strange problem while deploying an
    entity bean ..

    these are my xdoclet tags:

    * @ejb.finder
    * query = "SELECT object(o) FROM User o WHERE o.login=?1 AND
    o.password=?2"
    * signature = "com.ikatomi.im.user.ejb.UserLocal
    findByUsernameAndPassword(java.lang.String login,java.lang.String
    password)"
    *
    * @jboss.query
    * query = "SELECT object(o) FROM User o WHERE o.login=?1 AND
    o.password=?2"
    * signature = "com.ikatomi.im.user.ejb.UserLocal
    findByUsernameAndPassword(java.lang.String login,java.lang.String
    password)"
    */

    and this is the error jboss is throwing ..

    17:35:48,147 ERROR [EntityContainer] Starting failed
    jboss.j2ee:jndiName=UserLocal,service=EJB
    org.jboss.deployment.DeploymentException: Query method not found:
    findByUsernameAndPassword(java.lang.String,java.lang.String)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaDataFactory.getQueryMethods(JDBCQueryMetaDataFactory.java:322)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaDataFactory.getQueryMethods(JDBCQueryMetaDataFactory.java:243)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaDataFactory.createJDBCQueryMetaData(JDBCQueryMetaDataFactory.java:65)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:862)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:363)
    at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:705)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:417)
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:365)
    at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:147)
    at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)


    i have to add that i can use the findByPrimaryKey method without any
    probems which means that i made a mistake in my finder method ...
    but i dont know why it throws a NullPointerException

    greetings from berlin
     
    tmaus, Sep 17, 2004
    #1
    1. Advertising

  2. tmaus

    Sudsy Guest

    tmaus wrote:
    <snip>
    > 17:35:48,147 ERROR [EntityContainer] Starting failed
    > jboss.j2ee:jndiName=UserLocal,service=EJB
    > org.jboss.deployment.DeploymentException: Query method not found:
    > findByUsernameAndPassword(java.lang.String,java.lang.String)

    <snip>

    Difficult to diagnose as the xdoclets look okay to me. Have you
    had a peek at the META-INF/jbosscmp-jdbc.xml file? It should
    contain something like this:

    <query>
    <query-method>
    <method-name>findByUsernameAndPassword</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <jboss-ql><![CDATA[SELECT object(o) FROM User o WHERE o.login=?1 AND
    o.password=?2]]></jboss-ql>

    </query>

    Only other thing I could suggest (even though it should not make
    a difference, technically speaking) is to add spaces before and
    after the equals sign. I seem to recall having problems in the
    past with parsers which required white-space between tokens...
     
    Sudsy, Sep 17, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Thielen
    Replies:
    2
    Views:
    820
    Marek Lange
    Sep 12, 2003
  2. Replies:
    1
    Views:
    415
    Manish Pandit
    Sep 13, 2006
  3. Replies:
    2
    Views:
    1,269
  4. Francesco
    Replies:
    3
    Views:
    495
  5. markla
    Replies:
    1
    Views:
    573
    Steven Cheng
    Oct 6, 2008
Loading...

Share This Page