Hi,
[using 3.0.1 RC1]
I have defined finders in my bean which return java.util.Set. When I try
a unit test to verify that the finder works correctly, I get a class
cast exception thrown which suggests that the return type of the finder
is really an ArrayList instead of something which implements Set.
Here's the finder as it is declared in ejb-jar.xml:
<query>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql><![CDATA[SELECT OBJECT(platform) FROM Platform AS
platform]]></ejb-ql>
Here's the stack from the client (cactus-test) side:
[junit] Testcase: test_FindAll took 0.103 sec
[junit] Caused an ERROR
[junit] java.util.ArrayList
[junit] java.lang.ClassCastException: java.util.ArrayList
[junit] at $Proxy198.findAll(Unknown Source)
[junit] at
net.covalent.spider.appdef.server.entity.test.PlatformEJB_test.test_FindAll(PlatformEJB_test.java:127)
[junit] at
org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:524)
[junit] at
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.java:490)
[junit] at
org.apache.cactus.server.AbstractTestCaller.doTest(AbstractTestCaller.java:148)
[junit] at
org.apache.cactus.server.AbstractTestController.dispatch79_handleRequest(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):123)
[junit] at
org.apache.cactus.server.AbstractTestController.around79_handleRequest(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):1140)
[junit] at
org.apache.cactus.server.AbstractTestController.handleRequest(AbstractTestController.java;org/apache/cactus/util/log/LogAspect.java(1k):101)
[junit] at
org.apache.cactus.server.ServletTestRedirector.dispatch88_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):132)
[junit] at
org.apache.cactus.server.ServletTestRedirector.around88_doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):1140)
[junit] at
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java;org/apache/cactus/util/log/LogAspect.java(1k):118)
Any help greatly appreciated. I have other finders which are defined to
return Sets and they all fail in a similar way, I'm about to try to
redefine them to return collections, but I'd rather not.
I also just noticed that I lack the "DISTINCT" ejb-ql keyword in my
select, but I was under the impression that this was not required.
thanks,
-javier
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user