[Persistence, JBoss/CMP, Hibernate, Database] - Bug in JBoss EJBQL Implementation?
by bbeloff
Hi
I have an EJBQL finder that appears to produce the incorrect result when deployed on JBoss 4.0.2. I wonder if anyone would like to comment on this: perhaps this is a know bug, maybe there is a work-around, or maybe I'm doing something wrong.
The situation: I have three entity beans: Course, Product and Group. There is a many-to-many relationship between Course and Group, and between Product and Group.
I have three finders:
| <query>
| <query-method>
| <method-name>findWithCourses</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND (g.courses IS NOT EMPTY)]]></ejb-ql>
| </query>
|
This correctly returns all the Groups that have at least one Course member.
| <query>
| <query-method>
| <method-name>findWithProducts</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND (g.products IS NOT EMPTY)]]></ejb-ql>
| </query>
|
This correctly returns all Groups that have at least one Product member.
However:
| <query>
| <query-method>
| <method-name>findNonEmpty</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND ((g.courses IS NOT EMPTY) OR (g.products IS NOT EMPTY))]]></ejb-ql>
| </query>
|
I believe that this should return all Groups that have EITHER at least one Course member OR at least one Product member.
But it doesn't! It returns only the Groups that have BOTH at least one Course member AND at least one Product member.
Does anyone have any ideas?
Bruno Beloff.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050578#4050578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050578
18Â years, 10Â months
[EJB 3.0] - message driven bean
by subratjyetki
hi
i need a little help
i have a mdb called as ExportRequestProcessorBean
i want to deply this on jboss
i am having ejb-jar.xml as
<message-driven>
<ejb-name>net.vertical.sa.web.export.ExportRequestProcessorBean</ejb-name>
<ejb-class>net.vertical.sa.web.export.ExportRequestProcessorBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>
javax.jms.Topic
</destination-type>
</message-driven-destination>
</message-driven>
<container-transaction>
<ejb-name>net.vertical.sa.web.export.ExportRequestProcessorBean</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
and jboss.xml as
<message-driven>
<ejb-name>net.vertical.sa.web.export.ExportRequestProcessorBean</ejb-name>
<destination-jndi-name>WebRuleExportTopic</destination-jndi-name>
</message-driven>
still i am getting error as
23:26:46,068 WARN [JMSContainerInvoker] destination not found: topic/WebRuleImportTopic reason: javax.naming.NameNotFoundExc
eption: WebRuleImportTopic not bound
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050577#4050577
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050577
18Â years, 10Â months
[JBoss AOP] - Re: NullPointerException problem and no trace of the interce
by flavia.rainoneï¼ jboss.com
So, the example injboss is not working in your configuration of JBoss AS server?
Let's check the following steps:
- let's start with a clean server to help us tracking what is missing here (fresh installed, and you haven't edited any file of it, nor have you deployed anything)
- in this JBoss AS, remove the jboss-aop-jdk50.deployer directory of server/all/deploy
- download the latest stable version of JBoss AOP (1.5.5 GA)
- in the directory docs/aspect-framework/examples/injboss of your JBoss AOP installation, edit build.xml file, in order to set your jboss.home directory as follows:
| <property name="jboss.dir" value="your jboss home directory here"/>
|
- run one of the loadtime deployment tasks of the injboss example, like the following:
| $ ant deploy-basic-lt-war-in-jar
|
- copy the appropriate jboss-aop-jdk50.deployer directory from your JBoss AOP installation to your server/all/deploy directory.
- edit jboss-aop-jdk50.deployer/jboss-service.xml, setting EnableLoadTimeWeaving with a true value, like follows:
| <attribute name="EnableLoadtimeWeaving">true</attribute>
|
- follow the instructions of the jboss-aop-jdk50.deployer/ReadMe.txt file
- copy pluggable-instrumentor.jar file (located in the lib-50 directory of your JBoss AOP installation) to the bin directory of your server
- edit your run.sh or run.bat to include -javaagent:pluggable-instrumentor.jar in the JAVA_OPTS
- start up your server on the "all" mode
- now, access the address http://localhost:8080/aopexample/index.jsp and you should see the interceptor messages on your console.
This should work. Once you have this up and running, just replace the injboss jar by your application file in the deploy dir.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050572#4050572
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050572
18Â years, 10Â months