Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > strange jboss exception while deploying entity bean

Reply
Thread Tools

strange jboss exception while deploying entity bean

 
 
tmaus
Guest
Posts: n/a
 
      09-17-2004
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.la ng.String)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryM etaDataFactory.getQueryMethods(JDBCQueryMetaDataFa ctory.java:322)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryM etaDataFactory.getQueryMethods(JDBCQueryMetaDataFa ctory.java:243)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryM etaDataFactory.createJDBCQueryMetaData(JDBCQueryMe taDataFactory.java:65)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntity MetaData.<init>(JDBCEntityMetaData.java:862)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplic ationMetaData.<init>(JDBCApplicationMetaData.java: 363)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFil eLoader.load(JDBCXmlFileLoader.java:75)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.lo adJDBCEntityMetaData(JDBCStoreManager.java:705)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.in itStoreManager(JDBCStoreManager.java:417)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.st art(JDBCStoreManager.java:365)
at org.jboss.ejb.plugins.CMPPersistenceManager.start( CMPPersistenceManager.java:147)
at org.jboss.ejb.EntityContainer.startService(EntityC ontainer.java:337)
at org.jboss.system.ServiceMBeanSupport.jbossInternal Start(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternal Lifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.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
 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      09-17-2004
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.la ng.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...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to relate a SQL based entity with an Object based entity in Entity Framework markla ASP .Net 1 10-06-2008 09:42 AM
Modelling an object as Session Bean or Entity Bean ? Francesco Java 3 12-07-2006 04:22 PM
JBoss 4.0.4 Entity Bean using EJB 3.0 w/ Sybase 12.5 puneet.maini@gmail.com Java 2 11-16-2006 09:25 PM
[ejb][jboss]Bean inside a serialized object in another bean carlg@libertybasic.com Java 1 09-13-2006 08:10 PM
can a session bean return a local entity bean object? David Thielen Java 2 09-12-2003 07:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57