strange jboss exception while deploying entity bean

T

tmaus

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
 
S

Sudsy

tmaus wrote:
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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top