Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

strange jboss exception while deploying entity bean

Thread view: 
tmaus - 17 Sep 2004 17:18 GMT
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
Sudsy - 17 Sep 2004 18:08 GMT
<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...
Arnaud - 24 Jun 2005 10:14 GMT
Hi i have the same problem.

I checked what sudsy but everything looks ok.

Did you find your problem?

Arnaud


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.