[Tomcat, HTTPD, Servlets & JSP] - java.lang.ClassCastException: javax.naming.Reference
by chandara
Hello
I am the new of Message Driven Bean in EJB 3.0. And I try to create a first example of Message Driven Bean in EJB 3.0, but it has an error of:
java.lang.ClassCastException: javax.naming.Reference
at MDBTestClient.main(MDBTestClient.java:21)
My Codes are below:
MDB.java
package mdb;
import javax.ejb.MessageDriven;
import javax.ejb.ActivationConfigProperty;
import javax.jms.MessageListener;
import javax.jms.Message;
@MessageDriven(activationConfig =
{
@ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination",
propertyValue="queue/mdb")
})
public class MDB implements MessageListener {
public void onMessage (Message msg) {
System.out.print("Got Message");
}
}
TestClient
import java.util.Properties;
import javax.jms.QueueConnection;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
public class MDBTestClient {
private static QueueConnectionFactory factory=null;
//private static Queue queue=null;
private static QueueConnection cnn=null;
private static QueueSender sender=null;
private static QueueSession sess=null;
public static void main(String args[]) {
try{
InitialContext ctx=new InitialContext();
Queue queue=(javax.jms.Queue)ctx.lookup("queue/mdb");
factory=(QueueConnectionFactory)ctx.lookup("ConnectionFactory");
cnn=factory.createQueueConnection();
sess=cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
TextMessage txt=sess.createTextMessage("Hello My First MDB");
txt.setLongProperty("send", System.currentTimeMillis());
sender=sess.createSender(queue);
sender.send(txt);
sess.close();
}
catch(Exception e){
e.printStackTrace();
}
}
}
please help me on this.
Thanks all of you in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975452#3975452
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975452
19 years
[EJB/JBoss] - Re: EJB 2.0 / error while calling home.create for any sessio
by MmarcoM
hello
i forgot to post ejb-jar.xml
here it is. i m calling a local slsb from a web app deployed in same ear
| <?xml version="1.0" encoding="UTF-8"?>
|
| <ejb-jar id="ejb-jar_1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
|
| <description><![CDATA[No Description.]]></description>
| <display-name>Generated by XDoclet</display-name>
|
| <enterprise-beans>
|
| <!-- Session Beans -->
| <session id="Session_DLFMaintenanceSession">
| <description><![CDATA[]]></description>
|
| <ejb-name>DLFMaintenanceSession</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.DLFMaintenanceSessionLocalHome</local-home>
| <local>com.waersystems.mw.ejb.DLFMaintenanceSessionLocal</local>
| <ejb-class>com.waersystems.mw.ejb.DLFMaintenanceSessionBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| <ejb-local-ref id="EJBLocalRef_1">
| <ejb-ref-name>ejb/ConfiguratorLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.ConfiguratorLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ConfiguratorLocal</local>
| <ejb-link>Configurator</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_2">
| <ejb-ref-name>ejb/SiteTransmissionTypeLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.SiteTransmissionTypeLocalHome</local-home>
| <local>com.waersystems.mw.ejb.SiteTransmissionTypeLocal</local>
| <ejb-link>SiteTransmissionType</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_3">
| <ejb-ref-name>ejb/StatusRecipientLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.StatusRecipientLocalHome</local-home>
| <local>com.waersystems.mw.ejb.StatusRecipientLocal</local>
| <ejb-link>StatusRecipient</ejb-link>
| </ejb-local-ref>
|
| </session>
|
| <session id="Session_ContactMaintenance">
| <description><![CDATA[]]></description>
|
| <ejb-name>ContactMaintenance</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.ContactMaintenanceLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ContactMaintenanceLocal</local>
| <ejb-class>com.waersystems.mw.ejb.ContactMaintenanceBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| <ejb-local-ref id="EJBLocalRef_4">
| <ejb-ref-name>ejb/ContactLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.ejb.partners.contact.ContactLocalHome</local-home>
| <local>com.waersystems.ejb.partners.contact.ContactLocal</local>
| </ejb-local-ref>
|
| </session>
|
| <session id="Session_Responder">
| <description><![CDATA[]]></description>
|
| <ejb-name>Responder</ejb-name>
|
| <service-endpoint>com.waersystems.mw.webservices.MessengerService</service-endpoint>
| <ejb-class>com.waersystems.mw.ejb.ResponderBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| <ejb-local-ref id="EJBLocalRef_5">
| <ejb-ref-name>ejb/ContactLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.ejb.partners.contact.ContactLocalHome</local-home>
| <local>com.waersystems.ejb.partners.contact.ContactLocal</local>
| </ejb-local-ref>
|
| </session>
|
| <session id="Session_ReplenRequestFacade">
| <description><![CDATA[Bean implementation class for Enterprise Bean: ReplenRequestFacade]]></description>
|
| <ejb-name>ReplenRequestFacade</ejb-name>
|
| <home>com.waersystems.mw.ejb.ReplenRequestFacadeHome</home>
| <remote>com.waersystems.mw.ejb.ReplenRequestFacade</remote>
| <local-home>com.waersystems.mw.ejb.ReplenRequestFacadeLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ReplenRequestFacadeLocal</local>
| <ejb-class>com.waersystems.mw.ejb.ReplenRequestFacadeBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| </session>
|
| <session id="Session_TranslationServiceSession">
| <description><![CDATA[]]></description>
|
| <ejb-name>TranslationServiceSession</ejb-name>
|
| <service-endpoint>com.waersystems.mw.webservices.TranslationService</service-endpoint>
| <ejb-class>com.waersystems.mw.ejb.TranslationServiceSessionBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
| <ejb-local-ref id="EJBLocalRef_6">
| <ejb-ref-name>ejb/SequenceSessionLocalHome</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <local-home>com.waersystems.ejb.util.sequencegenerator.SequenceSessionLocalHome</local-home>
| <local>com.waersystems.ejb.util.sequencegenerator.SequenceSessionLocal</local>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_7">
| <ejb-ref-name>ejb/ContactLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.ejb.partners.contact.ContactLocalHome</local-home>
| <local>com.waersystems.ejb.partners.contact.ContactLocal</local>
| </ejb-local-ref>
|
| <ejb-local-ref id="EJBLocalRef_8">
| <ejb-ref-name>ejb/SiteTransmissionTypeLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.SiteTransmissionTypeLocalHome</local-home>
| <local>com.waersystems.mw.ejb.SiteTransmissionTypeLocal</local>
| <ejb-link>SiteTransmissionType</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_9">
| <ejb-ref-name>ejb/TransferRecordLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.TransferRecordLocalHome</local-home>
| <local>com.waersystems.mw.ejb.TransferRecordLocal</local>
| <ejb-link>TransferRecord</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_10">
| <ejb-ref-name>ejb/ReceiptConfirmationLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.ReceiptConfirmationLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ReceiptConfirmationLocal</local>
| <ejb-link>ReceiptConfirmation</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_11">
| <ejb-ref-name>ejb/ReplenRequestLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.ReplenRequestLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ReplenRequestLocal</local>
| <ejb-link>ReplenRequest</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_12">
| <ejb-ref-name>ejb/ConfiguratorLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.ConfiguratorLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ConfiguratorLocal</local>
| <ejb-link>Configurator</ejb-link>
| </ejb-local-ref>
| <ejb-local-ref id="EJBLocalRef_13">
| <ejb-ref-name>ejb/ExpectedReceiptLocalHome</ejb-ref-name>
| <ejb-ref-type>Entity</ejb-ref-type>
| <local-home>com.waersystems.mw.ejb.ExpectedReceiptLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ExpectedReceiptLocal</local>
| <ejb-link>ExpectedReceipt</ejb-link>
| </ejb-local-ref>
|
| </session>
|
| <!--
| To add session beans that you have deployment descriptor info for, add
| a file to your XDoclet merge directory called session-beans.xml that contains
| the <session></session> markup for those beans.
| -->
|
| <!-- Entity Beans -->
| <entity id="ContainerManagedEntity_StatusRecipient">
| <description><![CDATA[]]></description>
|
| <ejb-name>StatusRecipient</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.StatusRecipientLocalHome</local-home>
| <local>com.waersystems.mw.ejb.StatusRecipientLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.StatusRecipientCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>com.waersystems.mw.ejb.StatusRecipientKey</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>StatusRecipient</abstract-schema-name>
| <cmp-field id="CMPAttribute_1">
| <description><![CDATA[]]></description>
| <field-name>contactRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_2">
| <description><![CDATA[]]></description>
| <field-name>fromSiteRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_3">
| <description><![CDATA[]]></description>
| <field-name>interfaceType</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_4">
| <description><![CDATA[]]></description>
| <field-name>messageMethod</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_5">
| <description><![CDATA[]]></description>
| <field-name>toSiteRef</field-name>
| </cmp-field>
|
| <query>
| <query-method>
| <method-name>findStatusRecipients</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from StatusRecipient o where o.fromSiteRef = ?1 AND o.toSiteRef = ?2]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-StatusRecipientBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_ReplenRequest">
| <description><![CDATA[]]></description>
|
| <ejb-name>ReplenRequest</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.ReplenRequestLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ReplenRequestLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.ReplenRequestCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>ReplenRequest</abstract-schema-name>
| <cmp-field id="CMPAttribute_6">
| <description><![CDATA[]]></description>
| <field-name>locationRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_7">
| <description><![CDATA[]]></description>
| <field-name>manualInd</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_8">
| <description><![CDATA[]]></description>
| <field-name>operatorRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_9">
| <description><![CDATA[]]></description>
| <field-name>productRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_10">
| <description><![CDATA[]]></description>
| <field-name>scanDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_11">
| <description><![CDATA[]]></description>
| <field-name>scanner</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_12">
| <description><![CDATA[]]></description>
| <field-name>scanTime</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_13">
| <description><![CDATA[]]></description>
| <field-name>stockOutInd</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_14">
| <description><![CDATA[]]></description>
| <field-name>versionDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_15">
| <description><![CDATA[]]></description>
| <field-name>requestID</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_16">
| <description><![CDATA[]]></description>
| <field-name>recordKey</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_17">
| <description><![CDATA[]]></description>
| <field-name>version</field-name>
| </cmp-field>
| <primkey-field>requestID</primkey-field>
|
| <query>
| <query-method>
| <method-name>findByRecordKey</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from ReplenRequest o where o.recordKey = ?1]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-ReplenRequestBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_TransferRecord">
| <description><![CDATA[]]></description>
|
| <ejb-name>TransferRecord</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.TransferRecordLocalHome</local-home>
| <local>com.waersystems.mw.ejb.TransferRecordLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.TransferRecordCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>TransferRecord</abstract-schema-name>
| <cmp-field id="CMPAttribute_18">
| <description><![CDATA[]]></description>
| <field-name>status</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_19">
| <description><![CDATA[]]></description>
| <field-name>recordNumber</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_20">
| <description><![CDATA[]]></description>
| <field-name>transmissionNumber</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_21">
| <description><![CDATA[]]></description>
| <field-name>version</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_22">
| <description><![CDATA[]]></description>
| <field-name>interfaceType</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_23">
| <description><![CDATA[]]></description>
| <field-name>transmissionTimestamp</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_24">
| <description><![CDATA[]]></description>
| <field-name>versionDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_25">
| <description><![CDATA[]]></description>
| <field-name>creationTimestamp</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_26">
| <description><![CDATA[]]></description>
| <field-name>dlfSiteRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_27">
| <description><![CDATA[]]></description>
| <field-name>warehouseSiteRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_28">
| <description><![CDATA[]]></description>
| <field-name>recordSequence</field-name>
| </cmp-field>
| <primkey-field>recordSequence</primkey-field>
|
| <query>
| <query-method>
| <method-name>findTransferRecord</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>int</method-param>
| <method-param>int</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from TransferRecord o where o.warehouseSiteRef = ?1 AND o.interfaceType = ?2 AND o.status = ?3 AND o.dlfSiteRef like ?4]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-TransferRecordBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_ReceiptConfirmation">
| <description><![CDATA[]]></description>
|
| <ejb-name>ReceiptConfirmation</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.ReceiptConfirmationLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ReceiptConfirmationLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.ReceiptConfirmationCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>ReceiptConfirmation</abstract-schema-name>
| <cmp-field id="CMPAttribute_29">
| <description><![CDATA[]]></description>
| <field-name>locationRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_30">
| <description><![CDATA[]]></description>
| <field-name>manualInd</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_31">
| <description><![CDATA[]]></description>
| <field-name>version</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_32">
| <description><![CDATA[]]></description>
| <field-name>versionDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_33">
| <description><![CDATA[]]></description>
| <field-name>cofcref</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_34">
| <description><![CDATA[]]></description>
| <field-name>scanner</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_35">
| <description><![CDATA[]]></description>
| <field-name>operatorRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_36">
| <description><![CDATA[]]></description>
| <field-name>receiptID</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_37">
| <description><![CDATA[]]></description>
| <field-name>recordKey</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_38">
| <description><![CDATA[]]></description>
| <field-name>ticket</field-name>
| </cmp-field>
| <primkey-field>receiptID</primkey-field>
|
| <query>
| <query-method>
| <method-name>findByRecordKey</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) FROM ReceiptConfirmation o where o.recordKey = ?1]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-ReceiptConfirmationBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_ExpectedReceipt">
| <description><![CDATA[]]></description>
|
| <ejb-name>ExpectedReceipt</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.ExpectedReceiptLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ExpectedReceiptLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.ExpectedReceiptCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>ExpectedReceipt</abstract-schema-name>
| <cmp-field id="CMPAttribute_39">
| <description><![CDATA[]]></description>
| <field-name>locationRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_40">
| <description><![CDATA[]]></description>
| <field-name>quantity</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_41">
| <description><![CDATA[]]></description>
| <field-name>version</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_42">
| <description><![CDATA[]]></description>
| <field-name>versionDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_43">
| <description><![CDATA[]]></description>
| <field-name>cofcref</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_44">
| <description><![CDATA[]]></description>
| <field-name>partNumber</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_45">
| <description><![CDATA[]]></description>
| <field-name>receiptID</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_46">
| <description><![CDATA[]]></description>
| <field-name>recordKey</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_47">
| <description><![CDATA[]]></description>
| <field-name>ticket</field-name>
| </cmp-field>
| <primkey-field>receiptID</primkey-field>
|
| <query>
| <query-method>
| <method-name>findByRecordKey</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from ExpectedReceipt o where o.recordKey = ?1]]></ejb-ql>
| </query>
| <query>
| <query-method>
| <method-name>findByTicket</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from ExpectedReceipt o where o.ticket = ?1]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-ExpectedReceiptBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_Configurator">
| <description><![CDATA[]]></description>
|
| <ejb-name>Configurator</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.ConfiguratorLocalHome</local-home>
| <local>com.waersystems.mw.ejb.ConfiguratorLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.ConfiguratorCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>java.lang.String</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>Configurator</abstract-schema-name>
| <cmp-field id="CMPAttribute_48">
| <description><![CDATA[]]></description>
| <field-name>xsltPath</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_49">
| <description><![CDATA[]]></description>
| <field-name>site</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_50">
| <description><![CDATA[]]></description>
| <field-name>mappingFile</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_51">
| <description><![CDATA[]]></description>
| <field-name>validator</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_52">
| <description><![CDATA[]]></description>
| <field-name>normalizer</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_53">
| <description><![CDATA[]]></description>
| <field-name>command</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_54">
| <description><![CDATA[]]></description>
| <field-name>translator</field-name>
| </cmp-field>
| <primkey-field>site</primkey-field>
|
| <query>
| <query-method>
| <method-name>findAll</method-name>
| <method-params>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[SELECT object(o) FROM Configurator o]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-ConfiguratorBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <entity id="ContainerManagedEntity_SiteTransmissionType">
| <description><![CDATA[]]></description>
|
| <ejb-name>SiteTransmissionType</ejb-name>
|
| <local-home>com.waersystems.mw.ejb.SiteTransmissionTypeLocalHome</local-home>
| <local>com.waersystems.mw.ejb.SiteTransmissionTypeLocal</local>
|
| <ejb-class>com.waersystems.mw.ejb.SiteTransmissionTypeCMP</ejb-class>
| <persistence-type>Container</persistence-type>
| <prim-key-class>com.waersystems.mw.ejb.SiteTransmissionTypeKey</prim-key-class>
| <reentrant>false</reentrant>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>SiteTransmissionType</abstract-schema-name>
| <cmp-field id="CMPAttribute_55">
| <description><![CDATA[]]></description>
| <field-name>interfaceType</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_56">
| <description><![CDATA[]]></description>
| <field-name>lastTransmissionNumber</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_57">
| <description><![CDATA[]]></description>
| <field-name>recordNumber</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_58">
| <description><![CDATA[]]></description>
| <field-name>layoutRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_59">
| <description><![CDATA[]]></description>
| <field-name>version</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_60">
| <description><![CDATA[]]></description>
| <field-name>versionDate</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_61">
| <description><![CDATA[]]></description>
| <field-name>warehouseSiteRef</field-name>
| </cmp-field>
| <cmp-field id="CMPAttribute_62">
| <description><![CDATA[]]></description>
| <field-name>dlfSiteRef</field-name>
| </cmp-field>
|
| <query>
| <query-method>
| <method-name>findByWarehouseAndDlf</method-name>
| <method-params>
| <method-param>java.lang.String</method-param>
| <method-param>java.lang.String</method-param>
| </method-params>
| </query-method>
| <ejb-ql><![CDATA[select object(o) from SiteTransmissionType o where o.warehouseSiteRef = ?1 AND o.dlfSiteRef = ?2]]></ejb-ql>
| </query>
| <!-- Write a file named ejb-finders-SiteTransmissionTypeBean.xml if you want to define extra finders. -->
|
| </entity>
|
| <!--
| To add entity beans that you have deployment descriptor info for, add
| a file to your XDoclet merge directory called entity-beans.xml that contains
| the <entity></entity> markup for those beans.
| -->
|
| <!-- Message Driven Beans -->
| <!--
| To add message driven beans that you have deployment descriptor info for, add
| a file to your XDoclet merge directory called message-driven-beans.xml that contains
| the <message-driven></message-driven> markup for those beans.
| -->
|
| </enterprise-beans>
|
| <!-- Relationships -->
|
| <!-- Assembly Descriptor -->
| <!--
| To specify your own assembly descriptor info here, add a file to your
| XDoclet merge directory called assembly-descriptor.xml that contains
| the <assembly-descriptor></assembly-descriptor> markup.
| -->
|
| <assembly-descriptor id="AssemblyDescriptor_1">
| <!--
| To specify additional security-role elements, add a file in the merge
| directory called ejb-security-roles.xml that contains them.
| -->
|
| <!-- method permissions -->
| <!--
| To specify additional method-permission elements, add a file in the merge
| directory called ejb-method-permissions.ent that contains them.
| -->
|
| <!-- transactions -->
| <!--
| To specify additional container-transaction elements, add a file in the merge
| directory called ejb-container-transactions.ent that contains them.
| -->
|
| <!-- finder transactions -->
|
| <!-- message destinations -->
| <!--
| To specify additional message-destination elements, add a file in the merge
| directory called ejb-message-destinations.ent that contains them.
| -->
|
| <!-- exclude list -->
| <!--
| To specify an exclude-list element, add a file in the merge directory
| called ejb-exclude-list.xml that contains it.
| -->
| </assembly-descriptor>
|
| </ejb-jar>
|
any help?
thanks and regards
marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975446#3975446
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975446
19 years
[EJB/JBoss] - EJB 2.0 / error while calling home.create for any session ej
by MmarcoM
hi all,
i am deploying an EJB 2.0 app on jboss 4.0.4.GA..
i have following code which results always in this exception (only thing that differs is the local bean involved in the exception)
| 110:52:29,078 ERROR [STDERR] javax.ejb.EJBException: Invalid invocation, check yo
| ur deployment packaging, method=public abstract com.waersystems.mw.ejb.DLFMainte
| nanceSessionLocal com.mm.mw.ejb.DLFMaintenanceSessionLocalHome.create()
| throws javax.ejb.CreateException
| 10:52:29,078 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$Conta
| inerInterceptor.invokeHome(StatelessSessionContainer.java:175)
| 10:52:29,078 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedCo
| nnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanc
| eInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:98)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.inv
| okeHome(AbstractInterceptor.java:105)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.CallValidationIntercept
| or.invokeHome(CallValidationInterceptor.java:56)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.i
| nvokeNext(AbstractTxInterceptor.java:125)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWit
| hTransactions(TxInterceptorCMT.java:350)
| 10:52:29,093 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
| Home(TxInterceptorCMT.java:161)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.inv
| okeHome(SecurityInterceptor.java:145)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHo
| me(LogInterceptor.java:132)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInter
| ceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke
| Home(SessionContainer.java:637)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java
| :975)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.plugins.local.BaseLocalProxyFac
| tory.invokeHome(BaseLocalProxyFactory.java:359)
| 10:52:29,125 ERROR [STDERR] at org.jboss.ejb.plugins.local.LocalHomeProxy.in
| voke(LocalHomeProxy.java:133)
| 10:52:29,125 ERROR [STDERR] at $Proxy109.create(Unknown Source)
| 10:52:29,156 ERROR [STDERR] at com.waersystems.mw.ejb.DLFMaintenanceBusiness
| Delegate.initEJB(DLFMaintenanceBusinessDelegate.java:52)
| 10:52:29,156 ERROR [STDERR] at com.waersystems.mw.ejb.DLFMaintenanceBusiness
| Delegate.<init>(DLFMaintenanceBusinessDelegate.java:35)
| 10:52:29,156 ERROR [STDERR] at com.waersystems.mwweb.DLFMaintenanceSetUpActi
| on.getBusinessDelegate(DLFMaintenanceSetUpAction.java:153)
| 10:52:29,156 ERROR [STDERR] at com.waersystems.mwweb.DLFMaintenanceSetUpActi
| on.getDLFs(DLFMaintenanceSetUpAction.java:114)
| 10:52:29,156 ERROR [STDERR] at com.waersystems.mwweb.DLFMaintenanceSetUpActi
| on.execute(DLFMaintenanceSetUpAction.java:75)
| 10:52:29,156 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro
| cessActionPerform(RequestProcessor.java:431)
| 10:52:29,171 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.pro
| cess(RequestProcessor.java:236)
| 10:52:29,171 ERROR [STDERR] at org.apache.struts.action.ActionServlet.proces
| s(ActionServlet.java:1196)
| 10:52:29,171 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(
| ActionServlet.java:414)
| 10:52:29,171 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
| rvlet.java:697)
| 10:52:29,171 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpSe
| rvlet.java:810)
| 10:52:29,171 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
| in.internalDoFilter(ApplicationFilterChain.java:252)
| 10:52:29,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
| in.doFilter(ApplicationFilterChain.java:173)
| 10:52:29,203 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilte
| r.doFilter(ReplyHeaderFilter.java:96)
| 10:52:29,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
| in.internalDoFilter(ApplicationFilterChain.java:202)
| 10:52:29,203 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterCha
| in.doFilter(ApplicationFilterChain.java:173)
|
can anyone explain me what's wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975445#3975445
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975445
19 years
[JBoss jBPM] - Re: extending eclipse process designer plugin
by koen.aers@jboss.com
Hi Paul and Sunil,
Extending the designer is not really easy at the moment. There are a couple of extension points that allow you to do these kinds of things, but they are not documented and will probably change in the future. Have a look at the plugin.xml file of the org.jbpm.gd.jpdl.ui project.
You will find the 'editPolicies' and 'graphElements' extension points. You can see how they are used in the following excerpts:
<graphElement
| name="state"
| contributor="org.jbpm.ui.contributor.StateContributor">
| <entry
| category="org.jbpm.palette.1.BasicNodeTools"
| id="org.jbpm.ui.palette.2.State"
| label="State"
| tooltip="Creates a State node"
| type="node"/>
| </graphElement>
|
<editPolicy
| id="org.jbpm.ui.NodeComponentEditPolicy"
| part="org.jbpm.ui.part.graph.NodeGraphicalEditPart"
| policy="org.jbpm.ui.policy.NodeComponentEditPolicy"
| role="ComponentEditPolicy"/>
|
Certainly the use of the 'editPolicy' extension point (which serves to modify and customize the way graphical objects react to user input) requires a fair amount of GEF knowledge.
Hopefully this helps.
Regards,
Koen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975443#3975443
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975443
19 years
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Exception: CMR field value is already loaded
by Oyabun
We found the solution for our project. Because of the (old) architecture of our project, we are forced to use a non-standard configuration. That is, we use Standard CMP 2.x EntityBean with cache invalidation for our Entity Beans, with commit option A _and_ Optimistic Locking.
The Wiki article http://wiki.jboss.org/wiki/Wiki.jsp?page=CMPCaching clearly states that when we want global caching we must use Pessimistic Locking (which is default btw.) The problem we had with Pessimistic Locking is that it produced a lot of "Application deadlock" errors so instead we opted for Optimistic Locking which gave us "CMR field value is already loaded".
Our Session Beans use "Supports" by default for transaction type and "Required" only for methods which need to write to the database. Our Entity Beans were completely "Required". Since there was no need for the getter methods to be "Required", we made them read-only and "Supports" to make sure they don't start a new tx.
We use Xdoclet:
| * @ejb.transaction
| * type="Supports"
| * @jboss.method-attributes
| * read-only="true"
Read more about read-only here http://www.onjava.com/pub/a/onjava/2003/05/28/jboss_optimization.html
This configuration worked for us. We think that due to our erroneous configuration, the CMP container tried to load data multiple times into the cache, which JBoss didn't allow. The new configuration doesn't start any tx for reading access (we traced it and know that). It also seems to behave correctly by loading instances only once into the cache and then reading from it too.
Another solution is to use Instance Per Transaction CMP 2.x EntityBean but that is not acceptable because it's too slow.
Hope that helped.
--
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975441#3975441
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975441
19 years